Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
src
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
:
54
56
typedef
OpenCLCommandQueue
Self
;
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
72
~
OpenCLCommandQueue
();
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
98
OpenCLContext
*
m_Context
;
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
char
T,
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 */
itkOpenCL.h
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(OpenCLContext *context, cl_command_queue id)
Definition:
itkOpenCLCommandQueue.h:64
itk
Definition:
itkAdvancedImageToImageMetric.h:39
itk::OpenCLCommandQueue
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
Definition:
itkOpenCLCommandQueue.h:51
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition:
itkOpenCLContext.h:76
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue()
Definition:
itkOpenCLCommandQueue.h:59
itk::OpenCLCommandQueue::Self
OpenCLCommandQueue Self
Definition:
itkOpenCLCommandQueue.h:56
itk::OpenCLCommandQueue::GetQueueId
cl_command_queue GetQueueId() const
Definition:
itkOpenCLCommandQueue.h:91
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::OpenCLCommandQueue::GetContext
OpenCLContext * GetContext() const
Definition:
itkOpenCLCommandQueue.h:94
itk::OpenCLCommandQueue::m_Id
cl_command_queue m_Id
Definition:
itkOpenCLCommandQueue.h:99
itk::OpenCLCommandQueue::m_Context
OpenCLContext * m_Context
Definition:
itkOpenCLCommandQueue.h:98
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition:
itkOpenCLExport.h:31
itk::OpenCLCommandQueue::IsNull
bool IsNull() const
Definition:
itkOpenCLCommandQueue.h:78
Generated on 07-03-2016 for elastix by
1.8.11