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

A class representing an OpenCL device memory allocation for container. More...

#include <device_mem_pointer_cl.h>

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

List of all members.

Public Member Functions

 DeviceMemPointer_CL (T *root, T *start, int numElements, Device_CL *device)
 DeviceMemPointer_CL (T *start, int numElements, Device_CL *device)
 ~DeviceMemPointer_CL ()
void copyHostToDevice (int numElements=-1, bool copyLast=false) const
void copyDeviceToHost (int numElements=-1, bool copyLast=false) const
void copyDeviceToDevice (cl_mem copyToPointer, int numElements, int dstOffset=0, int srcOffset=0) const
cl_mem getDeviceDataPointer () const
void changeDeviceData ()

Detailed Description

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

A class representing an OpenCL device memory allocation for container.

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


Constructor & Destructor Documentation

template<typename T >
skepu::DeviceMemPointer_CL< T >::DeviceMemPointer_CL ( T *  root,
T *  start,
int  numElements,
Device_CL 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.
devicePointer to a valid device to allocate the space on.

References skepu::Device_CL::getContext(), and skepu::Device_CL::getQueue().

Here is the call graph for this function:

template<typename T >
skepu::DeviceMemPointer_CL< T >::DeviceMemPointer_CL ( T *  start,
int  numElements,
Device_CL 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.
devicePointer to a valid device to allocate the space on.

References skepu::Device_CL::getContext(), and skepu::Device_CL::getQueue().

Here is the call graph for this function:

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

The destructor releases the allocated device memory.


Member Function Documentation

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

Marks the device data as changed.

template<typename T >
void skepu::DeviceMemPointer_CL< T >::copyDeviceToDevice ( cl_mem  copyToPointer,
int  numElements,
int  dstOffset = 0,
int  srcOffset = 0 
) const

Copies data from device memory to another device memory.

Parameters:
copyToPointerThe destination address.
numElementsNumber of elements to copy, default value -1 = all elements.
dstOffsetOffset (if any) in destination pointer.
srcOffsetOffset (if any) in source pointer.
template<typename T >
void skepu::DeviceMemPointer_CL< T >::copyDeviceToHost ( int  numElements = -1,
bool  copyLast = false 
) 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.
copyLastBoolean flag specifying whether should copy last updated copy only (default: false).
template<typename T >
void skepu::DeviceMemPointer_CL< T >::copyHostToDevice ( int  numElements = -1,
bool  copyLast = false 
) const

Copies data from host memory to device memory.

Parameters:
numElementsNumber of elements to copy, default value -1 = all elements.
copyLastBoolean flag specifying whether should copy last updated copy only (default: false).
template<typename T >
cl_mem skepu::DeviceMemPointer_CL< T >::getDeviceDataPointer ( ) const
Returns:
OpenCL memory object representing data on the device.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Enumerations Friends Defines