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 
69 
73 
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 
106 
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 */
itk::operator!=
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::OpenCLCommandQueue::m_Id
cl_command_queue m_Id
Definition: itkOpenCLCommandQueue.h:99
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue()
Definition: itkOpenCLCommandQueue.h:59
itk::OpenCLCommandQueue
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
Definition: itkOpenCLCommandQueue.h:52
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(OpenCLContext *context, cl_command_queue id)
Definition: itkOpenCLCommandQueue.h:64
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition: itkOpenCLExport.h:31
itk::OpenCLCommandQueue::~OpenCLCommandQueue
~OpenCLCommandQueue()
itk::OpenCLCommandQueue::operator=
OpenCLCommandQueue & operator=(const OpenCLCommandQueue &other)
itk::OpenCLCommandQueue::GetQueueId
cl_command_queue GetQueueId() const
Definition: itkOpenCLCommandQueue.h:91
itk::OpenCLCommandQueue::Self
OpenCLCommandQueue Self
Definition: itkOpenCLCommandQueue.h:56
itk::OpenCLCommandQueue::IsOutOfOrder
bool IsOutOfOrder() const
itkOpenCL.h
itk::OpenCLCommandQueue::IsNull
bool IsNull() const
Definition: itkOpenCLCommandQueue.h:78
itk::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)
Definition: itkOpenCLCommandQueue.h:116
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(const OpenCLCommandQueue &other)
itk::operator==
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::OpenCLCommandQueue::m_Context
OpenCLContext * m_Context
Definition: itkOpenCLCommandQueue.h:98
itk::OpenCLCommandQueue::GetContext
OpenCLContext * GetContext() const
Definition: itkOpenCLCommandQueue.h:94
itk
Definition: itkAdvancedImageToImageMetric.h:40
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition: itkOpenCLContext.h:77
itk::OpenCLCommandQueue::IsProfilingEnabled
bool IsProfilingEnabled() const


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo