SkePU(integratedwithStarPU)
0.8.1
|
A class representing an OpenCL device memory allocation for Matrix. 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.
This class represents an OpenCL device memory allocation and controls the data transfers between host and device. Used rarely in this translation as data management is mostly done by StarPU.
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 |