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
itkOpenCLProgram.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 __itkOpenCLProgram_h
19
#define __itkOpenCLProgram_h
20
21
#include "
itkOpenCLDevice.h
"
22
#include "
itkOpenCLKernel.h
"
23
24
#include <string>
25
26
namespace
itk
27
{
34
// Forward declaration
35
class
OpenCLContext;
36
37
class
ITKOpenCL_EXPORT
OpenCLProgram
38
{
39
public
:
40
42
typedef
OpenCLProgram
Self
;
43
45
OpenCLProgram
();
46
50
OpenCLProgram
(
OpenCLContext
* context, cl_program
id
,
51
const
std::string & fileName = std::string() );
52
54
OpenCLProgram
(
const
OpenCLProgram
& other );
55
58
~
OpenCLProgram
();
59
61
OpenCLProgram
& operator=(
const
OpenCLProgram
& other );
62
64
bool
IsNull
()
const
{
return
this->m_Id == 0; }
65
67
OpenCLContext
*
GetContext
()
const
{
return
this->m_Context; }
68
70
cl_program
GetProgramId
()
const
{
return
this->m_Id; }
71
73
std::string
GetFileName
()
const
{
return
this->m_FileName; }
74
81
bool
Build(
const
std::string & extraBuildOptions = std::string() );
82
93
bool
Build(
const
std::list< OpenCLDevice > & devices,
94
const
std::string & extraBuildOptions = std::string() );
95
98
std::string GetLog()
const
;
99
102
std::list< OpenCLDevice > GetDevices()
const
;
103
107
OpenCLKernel
CreateKernel(
const
std::string & name )
const
;
108
110
std::list< OpenCLKernel > CreateKernels()
const
;
111
112
private
:
113
114
OpenCLContext
*
m_Context
;
115
cl_program
m_Id
;
116
std::string
m_FileName
;
117
};
118
122
bool
ITKOpenCL_EXPORT
operator==
(
const
OpenCLProgram
& lhs,
const
OpenCLProgram
& rhs );
123
127
bool
ITKOpenCL_EXPORT
operator!=
(
const
OpenCLProgram
& lhs,
const
OpenCLProgram
& rhs );
128
130
template
<
typename
char
T,
typename
traits >
131
inline
132
std::basic_ostream< charT, traits > &
133
operator<<( std::basic_ostream< charT, traits > & strm,
134
const
OpenCLProgram
& program )
135
{
136
if
( program.IsNull() )
137
{
138
strm <<
"OpenCLProgram(null)"
;
139
return
strm;
140
}
141
142
const
char
indent =
' '
;
143
144
strm <<
"OpenCLProgram"
<< std::endl
145
<< indent <<
"Id: "
<< program.
GetProgramId
() << std::endl;
146
147
return
strm;
148
}
149
150
151
}
// end namespace itk
152
153
#endif
/* __itkOpenCLProgram_h */
itk
Definition:
itkAdvancedImageToImageMetric.h:39
itkOpenCLDevice.h
itk::OpenCLProgram::Self
OpenCLProgram Self
Definition:
itkOpenCLProgram.h:42
itk::OpenCLProgram::GetFileName
std::string GetFileName() const
Definition:
itkOpenCLProgram.h:73
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition:
itkOpenCLContext.h:76
itk::OpenCLProgram::m_Id
cl_program m_Id
Definition:
itkOpenCLProgram.h:115
itk::OpenCLProgram::m_Context
OpenCLContext * m_Context
Definition:
itkOpenCLProgram.h:114
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::OpenCLProgram::m_FileName
std::string m_FileName
Definition:
itkOpenCLProgram.h:116
itk::OpenCLProgram::GetProgramId
cl_program GetProgramId() const
Definition:
itkOpenCLProgram.h:70
itk::OpenCLProgram::IsNull
bool IsNull() const
Definition:
itkOpenCLProgram.h:64
itk::OpenCLKernel
The OpenCLKernel class represents an executable entry point function in an OpenCL program...
Definition:
itkOpenCLKernel.h:138
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition:
itkOpenCLExport.h:31
itkOpenCLKernel.h
itk::OpenCLProgram
The OpenCLProgram class represents an OpenCL program object.
Definition:
itkOpenCLProgram.h:37
itk::OpenCLProgram::GetContext
OpenCLContext * GetContext() const
Definition:
itkOpenCLProgram.h:67
Generated on 07-03-2016 for elastix by
1.8.11