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
24namespace itk
25{
48// Forward declaration
49class OpenCLContext;
50
52{
53public:
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
96private:
97
99 cl_command_queue m_Id;
100};
101
106
111
113template< typename charT, typename traits >
114inline
115std::basic_ostream< charT, traits > &
116operator<<( 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 */
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
OpenCLContext * GetContext() const
cl_command_queue GetQueueId() const
OpenCLCommandQueue & operator=(const OpenCLCommandQueue &other)
OpenCLCommandQueue(OpenCLContext *context, cl_command_queue id)
bool IsProfilingEnabled() const
bool IsOutOfOrder() const
OpenCLCommandQueue(const OpenCLCommandQueue &other)
The OpenCLContext class represents an OpenCL context.
#define ITKOpenCL_EXPORT
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo