go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLCommandQueue.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkOpenCLCommandQueue_h
19 #define __itkOpenCLCommandQueue_h
20 
21 #include "itkOpenCL.h"
22 #include <ostream>
23 
24 namespace itk
25 {
48 // Forward declaration
49 class OpenCLContext;
50 
52 {
53 public:
54 
57 
59  OpenCLCommandQueue() : m_Context( 0 ), m_Id( 0 ) {}
60 
64  OpenCLCommandQueue( OpenCLContext * context, cl_command_queue id ) :
65  m_Context( context ), m_Id( id ) {}
66 
68  OpenCLCommandQueue( const OpenCLCommandQueue & other );
69 
73 
75  OpenCLCommandQueue & operator=( const OpenCLCommandQueue & other );
76 
78  bool IsNull() const { return this->m_Id == 0; }
79 
82  bool IsOutOfOrder() const;
83 
88  bool IsProfilingEnabled() const;
89 
91  cl_command_queue GetQueueId() const { return this->m_Id; }
92 
94  OpenCLContext * GetContext() const { return this->m_Context; }
95 
96 private:
97 
99  cl_command_queue m_Id;
100 };
101 
105 bool ITKOpenCL_EXPORT operator==( const OpenCLCommandQueue & lhs, const OpenCLCommandQueue & rhs );
106 
110 bool ITKOpenCL_EXPORT operator!=( const OpenCLCommandQueue & lhs, const OpenCLCommandQueue & rhs );
111 
113 template< typename charT, typename traits >
114 inline
115 std::basic_ostream< charT, traits > &
116 operator<<( std::basic_ostream< charT, traits > & strm,
117  const OpenCLCommandQueue & queue )
118 {
119  if( queue.IsNull() )
120  {
121  strm << "OpenCLCommandQueue(null)";
122  return strm;
123  }
124 
125  const char indent = ' ';
126 
127  strm << "OpenCLCommandQueue" << std::endl
128  << indent << "Id: " << queue.GetQueueId() << std::endl
129  << indent << "Out of order: " << ( queue.IsOutOfOrder() ? "Yes" : "No" ) << std::endl
130  << indent << "Profiling enabled: " << ( queue.IsProfilingEnabled() ? "Yes" : "No" ) << std::endl;
131 
132  return strm;
133 }
134 
135 
136 } // end namespace itk
137 
138 #endif /* __itkOpenCLCommandQueue_h */
OpenCLCommandQueue(OpenCLContext *context, cl_command_queue id)
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
The OpenCLContext class represents an OpenCL context.
cl_command_queue GetQueueId() const
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
OpenCLContext * GetContext() const
#define ITKOpenCL_EXPORT


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo