The CLMemoryAssistant class is a helper class to maintain buffers and images for opencl-program pipelines.
More...
#include <CLMemoryAssistant.h>
|
| CLMemoryAssistant () |
| CLMemoryAssistant Default constructor, creates a dummy instance. More...
|
|
| CLMemoryAssistant (std::string const &deviceType) |
| CLMemoryAssistant Creates an instance for the given device type (see CLDeviceContext for details) More...
|
|
| ~CLMemoryAssistant () |
| Destructor. More...
|
|
CLBuffer | createNamedBuffer (MemKeyType const &key, const string &accessMode, const size_t length, const size_t byteDepth, const void *src=0) |
| createNamedBuffer creates a CLBuffer object (internally handled as a CLMemory-pointer) More...
|
|
CLImage2D | createNamedImage2D (MemKeyType const &key, const string &accessMode, const size_t width, const size_t height, const int depth, const int num_channel, const void *src=0) |
| createNamedImage2D creates a Image2D object (internally handled as a CLMemory-pointer) More...
|
|
CLMemory * | operator[] (MemKeyType const &key) |
| operator [] Direct access operator to the internal CLMemory More...
|
|
CLBuffer & | asBuf (MemKeyType const &key) |
| asBuf shortcut to access and cast the internal CLMemory instance (CLBuffer) More...
|
|
CLImage2D & | asImg (MemKeyType const &key) |
| asBuf shortcut to access and cast the internal CLMemory instance (CLBuffer) More...
|
|
bool | keyExist (MemKeyType const &key) |
| keyExist Returns true if the given key exists in this instance More...
|
|
void | clearAll () |
| clearAll clears and deletes all internal buffers. Use with care! More...
|
|
void | remove (MemKeyType const &key) |
| remove removes and deletes the CLMemory instance for key if available More...
|
|
CLDeviceContext const & | getDeviceContext () |
| getDeviceContext returns the used device context that can be shared with CLProgram instances More...
|
|
The CLMemoryAssistant class is a helper class to maintain buffers and images for opencl-program pipelines.
In case of a pipeline of operators that use a CLProgram internally one can use the CLMemoryAssistant to instanciate a CLDeviceContext and create shared buffers and images for the device. So far, all implementations of an opencl program need to allow to pass CLBuffer or CLImage2D instances as in and output.
◆ CLMemoryMap
◆ MemKeyType
◆ CLMemoryAssistant() [1/2]
icl::utils::CLMemoryAssistant::CLMemoryAssistant |
( |
| ) |
|
◆ CLMemoryAssistant() [2/2]
icl::utils::CLMemoryAssistant::CLMemoryAssistant |
( |
std::string const & |
deviceType | ) |
|
◆ ~CLMemoryAssistant()
icl::utils::CLMemoryAssistant::~CLMemoryAssistant |
( |
| ) |
|
◆ asBuf()
asBuf shortcut to access and cast the internal CLMemory instance (CLBuffer)
- Parameters
-
key | The name (std::string) and identifier for this CLMemory instance |
- Returns
- CLImage2D instance
◆ asImg()
asBuf shortcut to access and cast the internal CLMemory instance (CLBuffer)
- Parameters
-
key | The name (std::string) and identifier for this CLMemory instance |
- Returns
- CLImage2D instance
◆ clearAll()
void icl::utils::CLMemoryAssistant::clearAll |
( |
| ) |
|
clearAll clears and deletes all internal buffers. Use with care!
◆ createNamedBuffer()
CLBuffer icl::utils::CLMemoryAssistant::createNamedBuffer |
( |
MemKeyType const & |
key, |
|
|
const string & |
accessMode, |
|
|
const size_t |
length, |
|
|
const size_t |
byteDepth, |
|
|
const void * |
src = 0 |
|
) |
| |
◆ createNamedImage2D()
CLImage2D icl::utils::CLMemoryAssistant::createNamedImage2D |
( |
MemKeyType const & |
key, |
|
|
const string & |
accessMode, |
|
|
const size_t |
width, |
|
|
const size_t |
height, |
|
|
const int |
depth, |
|
|
const int |
num_channel, |
|
|
const void * |
src = 0 |
|
) |
| |
createNamedImage2D creates a Image2D object (internally handled as a CLMemory-pointer)
- Parameters
-
key | The name (std::string) and identifier for this CLMemory instance |
Please see CLDeviceContext::createImage2D() for more details
◆ getDeviceContext()
getDeviceContext returns the used device context that can be shared with CLProgram instances
- Returns
- the internal CLDeviceContext instance
◆ keyExist()
bool icl::utils::CLMemoryAssistant::keyExist |
( |
MemKeyType const & |
key | ) |
|
|
inline |
keyExist Returns true if the given key exists in this instance
- Parameters
-
key | The name (std::string) and identifier for this CLMemory instance |
- Returns
- true if the key exists, false otherwise
◆ operator[]()
operator [] Direct access operator to the internal CLMemory
- Parameters
-
key | The name (std::string) and identifier for this CLMemory instance |
- Returns
- CLMemory pointer
◆ remove()
void icl::utils::CLMemoryAssistant::remove |
( |
MemKeyType const & |
key | ) |
|
remove removes and deletes the CLMemory instance for key if available
- Parameters
-
key | Identifier of the memory object to remove from this instance |
◆ m_context
◆ m_memory_map
CLMemoryMap icl::utils::CLMemoryAssistant::m_memory_map |
|
protected |
the map for internal storage
The documentation for this class was generated from the following file: