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
itkOpenCLVector.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 __itkOpenCLVector_h
19
#define __itkOpenCLVector_h
20
21
#include "
itkOpenCLVectorBase.h
"
22
#include "
itkOpenCLBuffer.h
"
23
#include "itkMacro.h"
24
25
namespace
itk
26
{
51
template
<
typename
T >
52
class
OpenCLVector
:
public
OpenCLVectorBase
53
{
54
public
:
55
57
typedef
OpenCLVector
Self
;
58
61
OpenCLVector
();
62
67
OpenCLVector
(
const
OpenCLVector< T >
& other );
68
71
~OpenCLVector
();
72
76
OpenCLVector< T >
&
operator=
(
const
OpenCLVector< T >
& other );
77
79
bool
IsNull
()
const
;
80
84
void
Release
();
85
87
bool
IsEmpty
()
const
{
return
this->
m_Size
== 0; }
88
90
std::size_t
GetSize
()
const
{
return
this->
m_Size
; }
91
94
T &
operator[]
(
const
std::size_t index );
95
99
const
T &
operator[]
(
const
std::size_t index )
const
;
100
104
void
Read
( T * data,
const
std::size_t count,
const
std::size_t offset = 0 );
105
108
void
Write
(
const
T * data,
const
std::size_t count,
const
std::size_t offset = 0 );
109
111
void
Write
(
const
Vector< T > & data,
const
std::size_t offset = 0 );
112
114
OpenCLContext
*
GetContext
()
const
;
115
117
OpenCLBuffer
GetBuffer
()
const
;
118
119
private
:
120
123
OpenCLVector
(
OpenCLContext
* context,
124
const
OpenCLMemoryObject::Access
access,
const
std::size_t size );
125
127
friend
class
OpenCLContext
;
128
};
129
130
//------------------------------------------------------------------------------
132
template
<
typename
char
T,
typename
traits,
typename
dataType >
133
inline
134
std::basic_ostream< charT, traits > &
135
operator<<( std::basic_ostream< charT, traits > & strm,
136
const
OpenCLVector< dataType >
& vector )
137
{
138
if
( vector.IsNull() )
139
{
140
strm <<
"OpenCLVector(null)"
;
141
return
strm;
142
}
143
144
const
char
indent =
' '
;
145
146
strm <<
"OpenCLVector"
<< std::endl
147
<< indent <<
"Size: "
<< vector.
GetSize
() << std::endl;
148
149
strm << std::endl;
150
151
return
strm;
152
}
153
154
155
}
// end namespace itk
156
157
#ifndef ITK_MANUAL_INSTANTIATION
158
#include "itkOpenCLVector.hxx"
159
#endif
160
161
#endif
/* __itkOpenCLVector_h */
itk::OpenCLVector::Release
void Release()
itk::OpenCLVector::GetSize
std::vcl_size_t GetSize() const
Definition:
itkOpenCLVector.h:90
itk::OpenCLVector::IsEmpty
bool IsEmpty() const
Definition:
itkOpenCLVector.h:87
itk::OpenCLVector::operator[]
T & operator[](const std::vcl_size_t index)
itk::OpenCLVector::IsNull
bool IsNull() const
itk::OpenCLVector::~OpenCLVector
~OpenCLVector()
itk::OpenCLVector::Self
OpenCLVector Self
Definition:
itkOpenCLVector.h:57
itk::OpenCLMemoryObject::Access
Access
Definition:
itkOpenCLMemoryObject.h:83
itk
Definition:
itkAdvancedImageToImageMetric.h:39
itkOpenCLVectorBase.h
itk::OpenCLBuffer
The OpenCLBuffer class represents an OpenCL buffer object.
Definition:
itkOpenCLBuffer.h:53
itk::OpenCLVectorBase
The base class for the OpenCLVector implementation.
Definition:
itkOpenCLVectorBase.h:37
itk::OpenCLVector::OpenCLVector
OpenCLVector()
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition:
itkOpenCLContext.h:76
itk::OpenCLVector::GetBuffer
OpenCLBuffer GetBuffer() const
itk::OpenCLVector::GetContext
OpenCLContext * GetContext() const
itk::OpenCLVectorBase::m_Size
std::vcl_size_t m_Size
Definition:
itkOpenCLVectorBase.h:93
itkOpenCLBuffer.h
itk::OpenCLVector::operator=
OpenCLVector< T > & operator=(const OpenCLVector< T > &other)
itk::OpenCLVector
The OpenCLVector class represents a templated OpenCL buffer object.
Definition:
itkOpenCLVector.h:52
itk::OpenCLVector::Write
void Write(const T *data, const std::vcl_size_t count, const std::vcl_size_t offset=0)
itk::OpenCLVector::Read
void Read(T *data, const std::vcl_size_t count, const std::vcl_size_t offset=0)
Generated on 07-03-2016 for elastix by
1.8.11