go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLBuffer.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/*=========================================================================
19 *
20 * Copyright UMC Utrecht and contributors
21 *
22 * Licensed under the Apache License, Version 2.0 (the "License");
23 * you may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at
25 *
26 * http://www.apache.org/licenses/LICENSE-2.0.txt
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 *=========================================================================*/
35#ifndef __itkOpenCLBuffer_h
36#define __itkOpenCLBuffer_h
37
39#include "itkOpenCLEvent.h"
40
41namespace itk
42{
50// Forward declaration
51class OpenCLImage;
52
54{
55public:
56
59
62
67 OpenCLBuffer( OpenCLContext * context, const cl_mem id );
68
70 OpenCLBuffer( const OpenCLBuffer & other );
71
74
80 bool Read( void * data, const std::size_t size, const std::size_t offset = 0 );
81
88 OpenCLEvent ReadAsync( void * data, const std::size_t size,
89 const OpenCLEventList & event_list = OpenCLEventList(),
90 const std::size_t offset = 0 );
91
98 bool Write( const void * data, const std::size_t size, const std::size_t offset = 0 );
99
106 OpenCLEvent WriteAsync( const void * data, const std::size_t size,
107 const OpenCLEventList & event_list = OpenCLEventList(),
108 const std::size_t offset = 0 );
109
117 bool ReadRect( void * data, const RectangleType & rect,
118 const std::size_t bufferBytesPerLine, const std::size_t hostBytesPerLine );
119
126 OpenCLEvent ReadRectAsync( void * data, const RectangleType & rect,
127 const std::size_t bufferBytesPerLine, const std::size_t hostBytesPerLine,
128 const OpenCLEventList & event_list = OpenCLEventList() );
129
138 bool ReadRect( void * data,
139 const std::size_t origin[ 3 ], const std::size_t size[ 3 ],
140 const std::size_t bufferBytesPerLine, const std::size_t bufferBytesPerSlice,
141 const std::size_t hostBytesPerLine, const std::size_t hostBytesPerSlice );
142
150 const std::size_t origin[ 3 ], const std::size_t size[ 3 ],
151 const std::size_t bufferBytesPerLine, const std::size_t bufferBytesPerSlice,
152 const std::size_t hostBytesPerLine, const std::size_t hostBytesPerSlice,
153 const OpenCLEventList & event_list = OpenCLEventList() );
154
161 bool WriteRect( const void * data, const RectangleType & rect,
162 const std::size_t bufferBytesPerLine, const std::size_t hostBytesPerLine );
163
170 OpenCLEvent WriteRectAsync( const void * data, const RectangleType & rect,
171 const std::size_t bufferBytesPerLine, const std::size_t hostBytesPerLine,
172 const OpenCLEventList & event_list = OpenCLEventList() );
173
181 bool WriteRect( const void * data,
182 const std::size_t origin[ 3 ], const std::size_t size[ 3 ],
183 const std::size_t bufferBytesPerLine, const std::size_t bufferBytesPerSlice,
184 const std::size_t hostBytesPerLine, const std::size_t hostBytesPerSlice );
185
192 OpenCLEvent WriteRectAsync( const void * data,
193 const std::size_t origin[ 3 ], const std::size_t size[ 3 ],
194 const std::size_t bufferBytesPerLine, const std::size_t bufferBytesPerSlice,
195 const std::size_t hostBytesPerLine, const std::size_t hostBytesPerSlice,
196 const OpenCLEventList & event_list = OpenCLEventList() );
197
204 bool CopyToBuffer( const OpenCLBuffer & dest, const std::size_t size,
205 const std::size_t dst_offset = 0, const std::size_t offset = 0 );
206
214 const std::size_t size,
215 const OpenCLEventList & event_list = OpenCLEventList(),
216 const std::size_t dst_offset = 0,
217 const std::size_t offset = 0 );
218
224 bool CopyToImage( const OpenCLImage & dest,
225 const OpenCLSize & origin, const OpenCLSize & region,
226 const std::size_t src_offset = 0 );
227
235 const OpenCLSize & origin, const OpenCLSize & region,
236 const OpenCLEventList & event_list = OpenCLEventList(),
237 const std::size_t src_offset = 0 );
238
246 bool CopyToRect( const OpenCLBuffer & dest,
247 const RectangleType & rect, const PointType & destPoint,
248 const std::size_t bufferBytesPerLine, std::size_t destBytesPerLine );
249
257 const RectangleType & rect, const PointType & destPoint,
258 const std::size_t bufferBytesPerLine, const std::size_t destBytesPerLine,
259 const OpenCLEventList & event_list = OpenCLEventList() );
260
269 bool CopyToRect( const OpenCLBuffer & dest,
270 const std::size_t origin[ 3 ], const std::size_t size[ 3 ],
271 const std::size_t destOrigin[ 3 ],
272 const std::size_t bufferBytesPerLine, const std::size_t bufferBytesPerSlice,
273 const std::size_t destBytesPerLine, const std::size_t destBytesPerSlice );
274
282 const std::size_t origin[ 3 ], const std::size_t size[ 3 ],
283 const std::size_t destOrigin[ 3 ],
284 const std::size_t bufferBytesPerLine, const std::size_t bufferBytesPerSlice,
285 const std::size_t destBytesPerLine, const std::size_t destBytesPerSlice,
286 const OpenCLEventList & event_list = OpenCLEventList() );
287
294 void * Map( const OpenCLMemoryObject::Access access,
295 const std::size_t size, const std::size_t offset = 0 );
296
304 const std::size_t size, const OpenCLEventList & event_list = OpenCLEventList(),
305 const std::size_t offset = 0 );
306
310 void * Map( const OpenCLMemoryObject::Access access );
311
318 ( const OpenCLMemoryObject::Access access,
319 const std::size_t size, const std::size_t offset = 0 );
320
324
328 std::size_t GetOffset() const;
329
330};
331
332} // end namespace itk
333
334#endif /* __itkOpenCLBuffer_h */
The OpenCLBuffer class represents an OpenCL buffer object.
bool CopyToImage(const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize &region, const std::vcl_size_t src_offset=0)
OpenCLBuffer CreateSubBuffer(const OpenCLMemoryObject::Access access, const std::vcl_size_t size, const std::vcl_size_t offset=0)
bool CopyToBuffer(const OpenCLBuffer &dest, const std::vcl_size_t size, const std::vcl_size_t dst_offset=0, const std::vcl_size_t offset=0)
OpenCLEvent MapAsync(void **ptr, const OpenCLMemoryObject::Access access, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t offset=0)
bool CopyToRect(const OpenCLBuffer &dest, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t destOrigin[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t destBytesPerLine, const std::vcl_size_t destBytesPerSlice)
OpenCLEvent WriteAsync(const void *data, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t offset=0)
void * Map(const OpenCLMemoryObject::Access access, const std::vcl_size_t size, const std::vcl_size_t offset=0)
OpenCLEvent CopyToImageAsync(const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t src_offset=0)
OpenCLEvent WriteRectAsync(const void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine, const OpenCLEventList &event_list=OpenCLEventList())
bool Read(void *data, const std::vcl_size_t size, const std::vcl_size_t offset=0)
bool ReadRect(void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice)
void * Map(const OpenCLMemoryObject::Access access)
OpenCLBuffer Self
OpenCLEvent ReadAsync(void *data, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t offset=0)
std::vcl_size_t GetOffset() const
OpenCLEvent WriteRectAsync(const void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice, const OpenCLEventList &event_list=OpenCLEventList())
bool ReadRect(void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine)
OpenCLEvent CopyToRectAsync(const OpenCLBuffer &dest, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t destOrigin[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t destBytesPerLine, const std::vcl_size_t destBytesPerSlice, const OpenCLEventList &event_list=OpenCLEventList())
OpenCLEvent CopyToRectAsync(const OpenCLBuffer &dest, const RectangleType &rect, const PointType &destPoint, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t destBytesPerLine, const OpenCLEventList &event_list=OpenCLEventList())
OpenCLEvent ReadRectAsync(void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine, const OpenCLEventList &event_list=OpenCLEventList())
bool Write(const void *data, const std::vcl_size_t size, const std::vcl_size_t offset=0)
OpenCLBuffer & operator=(const OpenCLBuffer &other)
OpenCLBuffer(const OpenCLBuffer &other)
OpenCLEvent ReadRectAsync(void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice, const OpenCLEventList &event_list=OpenCLEventList())
bool WriteRect(const void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice)
OpenCLEvent CopyToBufferAsync(const OpenCLBuffer &dest, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t dst_offset=0, const std::vcl_size_t offset=0)
OpenCLBuffer(OpenCLContext *context, const cl_mem id)
bool WriteRect(const void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine)
bool CopyToRect(const OpenCLBuffer &dest, const RectangleType &rect, const PointType &destPoint, const std::vcl_size_t bufferBytesPerLine, std::vcl_size_t destBytesPerLine)
OpenCLBuffer GetParentBuffer() const
The OpenCLContext class represents an OpenCL context.
OpenCLEventList class represents a list of OpenCLEvent objects.
OpenCLEvent class represents an OpenCL event object.
The OpenCLImage class represents an image object is used to store a one, two or three dimensional tex...
The OpenCLMemoryObject class represents all common memory objects such as buffers and image objects.
Point< std::vcl_size_t, 2 > PointType
The OpenCLSize class defines the size of an item of work for an OpenCL kernel.
Definition: itkOpenCLSize.h:50
#define ITKOpenCL_EXPORT


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo