SkePU(integratedwithStarPU)  0.8.1
 All Classes Namespaces Files Functions Enumerations Friends Macros Groups Pages
Public Member Functions | List of all members
skepu::DeviceMemPointer_Matrix_CL< T > Class Template Reference

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 ()
 

Detailed Description

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

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.

Constructor & Destructor Documentation

template<typename T >
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.

Parameters
startPointer to data in host memory.
rowsNumber of rows.
colsNumber of columns.
devicePointer to a valid device to allocate the space on.

References skepu::Device_CL::getContext().

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_CL< T >::changeDeviceData ( )

Marks the device data as changed.

template<typename T >
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.

Parameters
rowsNumber of rows.
colsNumber of columns.
template<typename T >
void skepu::DeviceMemPointer_Matrix_CL< 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 >
cl_mem skepu::DeviceMemPointer_Matrix_CL< T >::getDeviceDataPointer ( ) const
Returns
OpenCL memory object representing data on the device.

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