A class representing an OpenCL device memory allocation for Matrix container. Not used much right now. More...
#include <device_mem_pointer_matrix_cl.h>
Public Member Functions | |
DeviceMemPointer_Matrix_CL (T *start, int rows, int cols, Device_CL *device) | |
~DeviceMemPointer_Matrix_CL () | |
void | copyHostToDevice (int rows=-1, int cols=-1) const |
void | copyDeviceToHost (int rows=-1, int cols=-1) const |
cl_mem | getDeviceDataPointer () const |
void | changeDeviceData () |
A class representing an OpenCL device memory allocation for Matrix container. Not used much right now.
This class represents an OpenCL device 2D memory allocation and controls the data transfers between host and device.
skepu::DeviceMemPointer_Matrix_CL< T >::DeviceMemPointer_Matrix_CL | ( | T * | start, |
int | rows, | ||
int | cols, | ||
Device_CL * | device | ||
) |
The constructor allocates a certain amount of space in device memory and stores a pointer to some data in host memory.
start | Pointer to data in host memory. |
rows | Number of rows. |
cols | Number of columns. |
device | Pointer to a valid device to allocate the space on. |
References skepu::Device_CL::getContext().
skepu::DeviceMemPointer_Matrix_CL< T >::~DeviceMemPointer_Matrix_CL | ( | ) |
The destructor releases the allocated device memory.
void skepu::DeviceMemPointer_Matrix_CL< T >::changeDeviceData | ( | ) |
Marks the device data as changed.
void skepu::DeviceMemPointer_Matrix_CL< T >::copyDeviceToHost | ( | int | rows = -1 , |
int | cols = -1 |
||
) | const |
Copies data from device memory to host memory. Only copies if data on device has been marked as changed.
rows | Number of rows. |
cols | Number of columns. |
void skepu::DeviceMemPointer_Matrix_CL< T >::copyHostToDevice | ( | int | rows = -1 , |
int | cols = -1 |
||
) | const |
Copies data from host memory to device memory.
rows | Number of rows. |
cols | Number of columns. |
cl_mem skepu::DeviceMemPointer_Matrix_CL< T >::getDeviceDataPointer | ( | ) | const |