Create memory buffer associated to an array of type T. More...
|operator cl_mem ()|
|Buffer publically available for OpenCL API. |
|cl_mem *||ptr ()|
|Pointer to buffer for |
|void||put (const T *ptr)|
|Copy elements ptr,..., ptr[len-1] into buffer. |
|void||get (T *ptr)|
|Copy elements from buffer into ptr,..., ptr[len-1]. |
|CLArrayBuf (CLQueue &Q, cl_mem_flags FLAG, size_t len)|
|Allocate memory buffer to use CLQueue for data transfers. |
|Command queue for read/write calls. |
|Number of array elements. |
|OpenCL memory buffer. |
|Size of array in bytes. |
The put and get members facilitate transfer between the host and device by wrapping the clEnqueueWriteBuffer and clEnqueueReadBuffer commands. The class must be initialized with a command queue for these operations.
The size of the buffer is computed as that of an array of length len of objects specified by the template parameter.
|void CLArrayBuf< T >::put||(||const T *||ptr||)|
This is a blocking write, meaning that the command queue waits until all memory is copied.
|void CLArrayBuf< T >::get||(||T *||ptr||)|
This is a blocking read, meaning that the command queue waits until all memory is copied.