SkePU 0.7
Public Member Functions
skepu::DeviceMemPointer_CU< T > Class Template Reference

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

#include <device_mem_pointer_cu.h>

Collaboration diagram for skepu::DeviceMemPointer_CU< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Detailed Description

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

A class representing a CUDA device memory allocation for container.

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


Constructor & Destructor Documentation

template<typename T >
skepu::DeviceMemPointer_CU< T >::DeviceMemPointer_CU ( T *  start,
int  numElements,
Device_CU device 
)

The constructor allocates a certain amount of space in device memory and stores a pointer to some data in host memory.

Parameters:
startPointer to data in host memory.
numElementsNumber of elements to allocate memory for.
deviceIDID of a valid CUDA device to allocate memory on.

References skepu::Device_CU::getDeviceID().

Here is the call graph for this function:

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

The constructor allocates a certain amount of space in device memory and stores a pointer to some data in host memory.

Parameters:
startPointer to data in host memory.
rowsNumber of rows to allocate memory for.
colsNumber of columns to allocate memory for.
deviceIDID of a valid CUDA device to allocate memory on.
usePitchTo specify whether to use padding to ensure proper coalescing for row-wise access from CUDA global memory.

References skepu::Device_CU::getDeviceID().

Here is the call graph for this function:

template<typename T >
skepu::DeviceMemPointer_CU< T >::DeviceMemPointer_CU ( T *  root,
T *  start,
int  numElements,
Device_CU device 
)

The constructor allocates a certain amount of space in device memory and stores a pointer to some data in host memory.

Parameters:
rootPointer to starting address of data in host memory (can be same as start).
startPointer to data in host memory.
numElementsNumber of elements to allocate memory for.
deviceIDID of a valid CUDA device to allocate memory on.

References skepu::Device_CU::getDeviceID().

Here is the call graph for this function:

template<typename T >
skepu::DeviceMemPointer_CU< T >::~DeviceMemPointer_CU ( )

The destructor releases the allocated device memory.


Member Function Documentation

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

Marks the device data as changed.

template<typename T >
void skepu::DeviceMemPointer_CU< T >::copyDeviceToHost ( int  numElements = -1) const

Copies data from device memory to host memory. Only copies if data on device has been marked as changed.

Parameters:
numElementsNumber of elements to copy, default value -1 = all elements.
template<typename T >
void skepu::DeviceMemPointer_CU< T >::copyHostToDevice ( int  numElements = -1) const

Copies data from host memory to device memory.

Parameters:
numElementsNumber of elements to copy, default value -1 = all elements.
template<typename T >
T * skepu::DeviceMemPointer_CU< T >::getDeviceDataPointer ( ) const
Returns:
Pointer to device memory.
template<typename T >
int skepu::DeviceMemPointer_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:
 All Classes Namespaces Files Functions Enumerations Friends Defines