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:
56
59 : m_Context(0)
60 , m_Id(0)
61 {}
62
66 OpenCLCommandQueue(OpenCLContext * context, cl_command_queue id)
67 : m_Context(context)
68 , m_Id(id)
69 {}
70
73
77
81
83 bool
84 IsNull() const
85 {
86 return this->m_Id == 0;
87 }
88
91 bool
92 IsOutOfOrder() const;
93
98 bool
100
102 cl_command_queue
104 {
105 return this->m_Id;
106 }
107
111 {
112 return this->m_Context;
113 }
114
115private:
117 cl_command_queue m_Id;
118};
119
125
131
133template <typename charT, typename traits>
134inline std::basic_ostream<charT, traits> &
135operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLCommandQueue & queue)
136{
137 if (queue.IsNull())
138 {
139 strm << "OpenCLCommandQueue(null)";
140 return strm;
141 }
142
143 const char indent = ' ';
144
145 strm << "OpenCLCommandQueue\n"
146 << indent << "Id: " << queue.GetQueueId() << '\n'
147 << indent << "Out of order: " << (queue.IsOutOfOrder() ? "Yes" : "No") << '\n'
148 << indent << "Profiling enabled: " << (queue.IsProfilingEnabled() ? "Yes" : "No") << std::endl;
149
150 return strm;
151}
152
153
154} // end namespace itk
155
156#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 2023-01-13 for elastix by doxygen 1.9.6 elastix logo