SkePU  1.2
 All Classes Namespaces Files Functions Variables Enumerations Friends Macros Groups Pages
Public Member Functions | List of all members
skepu::DeviceMemPointer_Matrix_CU< T > Class Template Reference

A class representing a CUDA 2D device memory allocation for Matrix container. More...

#include <device_mem_pointer_matrix_cu.h>

Public Member Functions

 DeviceMemPointer_Matrix_CU (T *start, int rows, int cols, Device_CU *device, bool usePitch=false)
 
 ~DeviceMemPointer_Matrix_CU ()
 
void copyHostToDevice (int rows=-1, int cols=-1) const
 
void copyDeviceToHost (int rows=-1, int cols=-1) const
 
T * getDeviceDataPointer () const
 
int getDeviceID () const
 
void changeDeviceData ()
 

Detailed Description

template<typename T>
class skepu::DeviceMemPointer_Matrix_CU< T >

A class representing a CUDA 2D device memory allocation for Matrix container.

Author
Usman Dastgeer
Version
0.7

This class represents a CUDA device memory allocation and controls the data transfers between host and device.

Constructor & Destructor Documentation

template<typename T >
skepu::DeviceMemPointer_Matrix_CU< T >::DeviceMemPointer_Matrix_CU ( T *  start,
int  rows,
int  cols,
Device_CU device,
bool  usePitch = false 
)

The constructor allocates a certain amount of space in device memory internally as 1D and stores a pointer to same data in host memory.

Parameters
startPointer to data in host memory.
rowsNumber of rows.
colsNumber of columns.
deviceIDID of a valid CUDA device to allocate memory on.

References skepu::Device_CU::getDeviceID().

Here is the call graph for this function:

The destructor releases the allocated device memory.

Member Function Documentation

template<typename T >
void skepu::DeviceMemPointer_Matrix_CU< T >::changeDeviceData ( )

Marks the device data as changed.

template<typename T >
void skepu::DeviceMemPointer_Matrix_CU< 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.

Parameters
rowsNumber of rows.
colsNumber of columns.
template<typename T >
void skepu::DeviceMemPointer_Matrix_CU< T >::copyHostToDevice ( int  rows = -1,
int  cols = -1 
) const

Copies data from host memory to device memory.

Parameters
rowsNumber of rows.
colsNumber of columns.
template<typename T >
T * skepu::DeviceMemPointer_Matrix_CU< T >::getDeviceDataPointer ( ) const
Returns
Pointer to device memory.
template<typename T >
int skepu::DeviceMemPointer_Matrix_CU< T >::getDeviceID ( ) const
Returns
The device ID of the CUDA device that has the allocation.

The documentation for this class was generated from the following file: