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
22
23namespace itk
24{
32// Forward declaration
33class OpenCLContext;
34class OpenCLKernel;
35class OpenCLVectorBasePimpl;
36
38{
39protected:
41 OpenCLVectorBase(const std::size_t elemSize);
42
46 OpenCLVectorBase(const std::size_t elemSize, const OpenCLVectorBase & other);
47
51
53 void
54 Assign(const OpenCLVectorBase & other);
55
57 void
58 Create(OpenCLContext * context, const OpenCLMemoryObject::Access access, const std::size_t size);
59
61 void
63
67 void
68 Map();
69
72 void
73 Unmap() const;
74
77 void
78 Read(void * data, const std::size_t size, const std::size_t offset = 0);
79
82 void
83 Write(const void * data, const std::size_t size, const std::size_t offset = 0);
84
86 cl_mem
87 GetMemoryId() const;
88
91 GetContext() const;
92
94 cl_mem
96
97protected:
98 OpenCLVectorBasePimpl * d_ptr;
99 std::size_t m_ElementSize;
100 std::size_t m_Size;
101 mutable void * m_Mapped;
102
104 friend class OpenCLKernel;
105};
106
107} // end namespace itk
108
109#endif /* itkOpenCLVectorBase_h */
The OpenCLContext class represents an OpenCL context.
The OpenCLKernel class represents an executable entry point function in an OpenCL program.
The base class for the OpenCLVector implementation.
void Assign(const OpenCLVectorBase &other)
OpenCLContext * GetContext() const
void Create(OpenCLContext *context, const OpenCLMemoryObject::Access access, const std::vcl_size_t size)
std::vcl_size_t m_ElementSize
OpenCLVectorBase(const std::vcl_size_t elemSize)
void Write(const void *data, const std::vcl_size_t size, const std::vcl_size_t offset=0)
OpenCLVectorBase(const std::vcl_size_t elemSize, const OpenCLVectorBase &other)
OpenCLVectorBasePimpl * d_ptr
void Read(void *data, const std::vcl_size_t size, const std::vcl_size_t offset=0)
cl_mem GetKernelArgument() const
cl_mem GetMemoryId() const
#define ITKOpenCL_EXPORT


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo