Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
Src
E
elastix
Common
OpenCL
ITKimprovements
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
51
class
ITKOpenCL_EXPORT
OpenCLCommandQueue
52
{
53
public
:
55
using
Self
=
OpenCLCommandQueue
;
56
58
OpenCLCommandQueue
()
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
72
OpenCLCommandQueue
(
const
OpenCLCommandQueue
& other);
73
76
~OpenCLCommandQueue
();
77
79
OpenCLCommandQueue
&
80
operator=
(
const
OpenCLCommandQueue
& other);
81
83
bool
84
IsNull
()
const
85
{
86
return
this->m_Id == 0;
87
}
88
91
bool
92
IsOutOfOrder
()
const
;
93
98
bool
99
IsProfilingEnabled
()
const
;
100
102
cl_command_queue
103
GetQueueId
()
const
104
{
105
return
this->m_Id;
106
}
107
109
OpenCLContext
*
110
GetContext
()
const
111
{
112
return
this->m_Context;
113
}
114
115
private
:
116
OpenCLContext
*
m_Context
;
117
cl_command_queue
m_Id
;
118
};
119
123
bool
ITKOpenCL_EXPORT
124
operator==
(
const
OpenCLCommandQueue
& lhs,
const
OpenCLCommandQueue
& rhs);
125
129
bool
ITKOpenCL_EXPORT
130
operator!=
(
const
OpenCLCommandQueue
& lhs,
const
OpenCLCommandQueue
& rhs);
131
133
template
<
typename
char
T,
typename
traits>
134
inline
std::basic_ostream<charT, traits> &
135
operator<<
(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 */
itk::OpenCLCommandQueue
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
Definition
itkOpenCLCommandQueue.h:52
itk::OpenCLCommandQueue::GetContext
OpenCLContext * GetContext() const
Definition
itkOpenCLCommandQueue.h:110
itk::OpenCLCommandQueue::m_Id
cl_command_queue m_Id
Definition
itkOpenCLCommandQueue.h:117
itk::OpenCLCommandQueue::GetQueueId
cl_command_queue GetQueueId() const
Definition
itkOpenCLCommandQueue.h:103
itk::OpenCLCommandQueue::operator=
OpenCLCommandQueue & operator=(const OpenCLCommandQueue &other)
itk::OpenCLCommandQueue::m_Context
OpenCLContext * m_Context
Definition
itkOpenCLCommandQueue.h:116
itk::OpenCLCommandQueue::IsNull
bool IsNull() const
Definition
itkOpenCLCommandQueue.h:84
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue()
Definition
itkOpenCLCommandQueue.h:58
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(OpenCLContext *context, cl_command_queue id)
Definition
itkOpenCLCommandQueue.h:66
itk::OpenCLCommandQueue::~OpenCLCommandQueue
~OpenCLCommandQueue()
itk::OpenCLCommandQueue::IsProfilingEnabled
bool IsProfilingEnabled() const
itk::OpenCLCommandQueue::IsOutOfOrder
bool IsOutOfOrder() const
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(const OpenCLCommandQueue &other)
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition
itkOpenCLContext.h:77
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition
itkOpenCLExport.h:33
itkOpenCL.h
itk
Definition
itkAdvancedImageToImageMetric.h:43
itk::operator==
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator!=
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)
Definition
itkOpenCLCommandQueue.h:135
Generated on 2024-07-17 for elastix by
1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d)