SkePU(integratedwithStarPU)
0.8.1
|
A class representing a CUDA device memory allocation. More...
#include <device_mem_pointer_cu.h>
Public Member Functions | |
DeviceMemPointer_CU (T *root, T *start, int numElements, int deviceID, int totalVecSize=-1) | |
~DeviceMemPointer_CU () | |
void | copyHostToDevice (int numElements=-1, bool copyLast=true) const |
void | copyDeviceToHost (int numElements=-1, bool copyLast=true) const |
void | copyDeviceToDevice (T *copyToPointer, int numElements, int dstOffset=0, int srcOffset=0) const |
T * | getDeviceDataPointer () const |
int | getDeviceID () const |
void | changeDeviceData () |
A class representing a CUDA device memory allocation.
A class representing a CUDA device memory allocation for Matrix.
This class represents a CUDA 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_CU< T >::DeviceMemPointer_CU | ( | T * | root, |
T * | start, | ||
int | numElements, | ||
int | deviceID, | ||
int | totalVecSize = -1 |
||
) |
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. |
numElements | Number of elements to allocate memory for. |
deviceID | ID of a valid CUDA device to allocate memory on. |
skepu::DeviceMemPointer_CU< T >::~DeviceMemPointer_CU | ( | ) |
The destructor releases the allocated device memory.
void skepu::DeviceMemPointer_CU< T >::changeDeviceData | ( | ) |
Marks the device data as changed.
void skepu::DeviceMemPointer_CU< T >::copyDeviceToDevice | ( | T * | copyToPointer, |
int | numElements, | ||
int | dstOffset = 0 , |
||
int | srcOffset = 0 |
||
) | const |
Copies data between device memory. Used internally.
copyToPointer | the pointer from where to copy |
numElements | Number of elements to copy, default value -1 = all elements. |
dstOffset | Offset in the destination pointer. |
srcOffset | Offset in the source pointer. |
void skepu::DeviceMemPointer_CU< T >::copyDeviceToHost | ( | int | numElements = -1 , |
bool | copyLast = true |
||
) | const |
Copies data from device memory to host memory. Only copies if data on device has been marked as changed.
numElements | Number of elements to copy, default value -1 = all elements. |
copyLast | Specify whether should copy only the last allocated data. |
void skepu::DeviceMemPointer_CU< T >::copyHostToDevice | ( | int | numElements = -1 , |
bool | copyLast = true |
||
) | const |
Copies data from host memory to device memory.
numElements | Number of elements to copy, default value -1 = all elements. |
copyLast | Specify whether should copy only the last allocated data. |
T * skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer | ( | ) | const |
int skepu::DeviceMemPointer_CU< T >::getDeviceID | ( | ) | const |