go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLVectorBase.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 __itkOpenCLVectorBase_h
19 #define __itkOpenCLVectorBase_h
20 
21 #include "itkOpenCLMemoryObject.h"
22 
23 namespace itk
24 {
32 // Forward declaration
33 class OpenCLContext;
34 class OpenCLKernel;
35 class OpenCLVectorBasePimpl;
36 
38 {
39 protected:
40 
42  OpenCLVectorBase( const std::size_t elemSize );
43 
47  OpenCLVectorBase( const std::size_t elemSize, const OpenCLVectorBase & other );
48 
52 
54  void Assign( const OpenCLVectorBase & other );
55 
57  void Create( OpenCLContext * context,
58  const OpenCLMemoryObject::Access access, const std::size_t size );
59 
61  void Release();
62 
66  void Map();
67 
70  void Unmap() const;
71 
74  void Read( void * data, const std::size_t size, const std::size_t offset = 0 );
75 
78  void Write( const void * data, const std::size_t size, const std::size_t offset = 0 );
79 
81  cl_mem GetMemoryId() const;
82 
84  OpenCLContext * GetContext() const;
85 
87  cl_mem GetKernelArgument() const;
88 
89 protected:
90 
91  OpenCLVectorBasePimpl * d_ptr;
92  std::size_t m_ElementSize;
93  std::size_t m_Size;
94  mutable void * m_Mapped;
95 
97  friend class OpenCLKernel;
98 };
99 
100 } // end namespace itk
101 
102 #endif /* __itkOpenCLVectorBase_h */
The base class for the OpenCLVector implementation.
std::vcl_size_t m_ElementSize
The OpenCLContext class represents an OpenCL context.
The OpenCLKernel class represents an executable entry point function in an OpenCL program...
OpenCLVectorBasePimpl * d_ptr
#define ITKOpenCL_EXPORT


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo