git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2091 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
boufaras 2011-01-28 16:35:57 +00:00
commit 81f8b40894
5 changed files with 14 additions and 18 deletions

View file

@ -42,7 +42,7 @@
* class for allocation data on GPU global memory * class for allocation data on GPU global memory
*/ */
template<typename T>
class moCudaAllocator { class moCudaAllocator {
public: public:
@ -59,7 +59,7 @@ public:
*@param _data the data to allocate on GPU global memory *@param _data the data to allocate on GPU global memory
*@param _dataSize the size of data to allocate on GPU memory *@param _dataSize the size of data to allocate on GPU memory
*/ */
template<typename T>
void operator()(T* & _data, unsigned _dataSize) { void operator()(T* & _data, unsigned _dataSize) {
//Allocate data in GPU memory //Allocate data in GPU memory

View file

@ -42,7 +42,6 @@
* class to copy data from CPU memory to GPU global memory and vice versa * class to copy data from CPU memory to GPU global memory and vice versa
*/ */
template<typename T>
class moCudaCopy { class moCudaCopy {
public: public:
@ -60,7 +59,7 @@ public:
*@param _dataTocpy the data to copy from CPU memory to GPU memory *@param _dataTocpy the data to copy from CPU memory to GPU memory
*@param _dataSize the size of data to copy *@param _dataSize the size of data to copy
*/ */
template<typename T>
void operator()(T* & _data, T * & _dataTocpy, unsigned _dataSize) { void operator()(T* & _data, T * & _dataTocpy, unsigned _dataSize) {
//copy data from CPU memory to GPU memory //copy data from CPU memory to GPU memory
@ -77,7 +76,7 @@ public:
*@param _dev_data the device global variable *@param _dev_data the device global variable
*@param _dataTocpy the data to copy GPU global memory to GPU global variable *@param _dataTocpy the data to copy GPU global memory to GPU global variable
*/ */
template<typename T>
void operator()(T* & _dev_data, T * & _dataTocpy) { void operator()(T* & _dev_data, T * & _dataTocpy) {
//Copy n bytes from the memory area pointed to by _dataTocpy to the memory area pointed to by offset bytes from the start of symbol _dev_data //Copy n bytes from the memory area pointed to by _dataTocpy to the memory area pointed to by offset bytes from the start of symbol _dev_data
@ -93,7 +92,7 @@ public:
*@param _dataSize the size of data to copy *@param _dataSize the size of data to copy
*@param _HostToDevice the direction of copy(true if copy will be done from CPU memory to GPU memory) *@param _HostToDevice the direction of copy(true if copy will be done from CPU memory to GPU memory)
*/ */
template<typename T>
void operator()(T* & _data, T * & _dataTocpy, unsigned _dataSize, void operator()(T* & _data, T * & _dataTocpy, unsigned _dataSize,
bool _HostToDevice) { bool _HostToDevice) {

View file

@ -42,7 +42,6 @@
* class for Desallocation of data from GPU global memory * class for Desallocation of data from GPU global memory
*/ */
template<typename T>
class moCudaDesallocator { class moCudaDesallocator {
public: public:
@ -58,7 +57,7 @@ public:
*Desallocate data on GPU global memory *Desallocate data on GPU global memory
*@param _data the data to desallocate from GPU global memory *@param _data the data to desallocate from GPU global memory
*/ */
template<typename T>
void operator()(T* & _data) { void operator()(T* & _data) {
//Desallocate data from GPU global memory //Desallocate data from GPU global memory

View file

@ -45,7 +45,6 @@
* class of managment of data on GPU global memory (allocation,desallocation & copy) * class of managment of data on GPU global memory (allocation,desallocation & copy)
*/ */
template<typename T>
class moCudaObject { class moCudaObject {
public: public:
@ -56,7 +55,7 @@ public:
*@param _dataTocpy the data to copy from CPU memory to _data on GPU memory *@param _dataTocpy the data to copy from CPU memory to _data on GPU memory
*@param _dataSize the size of data to copy *@param _dataSize the size of data to copy
*/ */
template<typename T>
void memCopy(T* & _data, T * & _dataTocpy, unsigned _dataSize) { void memCopy(T* & _data, T * & _dataTocpy, unsigned _dataSize) {
malloc(_data, _dataSize); malloc(_data, _dataSize);
copy(_data, _dataTocpy, _dataSize); copy(_data, _dataTocpy, _dataSize);
@ -67,7 +66,7 @@ public:
*@param _dev_data the device global variable *@param _dev_data the device global variable
*@param _dataTocpy the data to copy GPU global memory to GPU global variable *@param _dataTocpy the data to copy GPU global memory to GPU global variable
*/ */
template<typename T>
void memCopyGlobalVariable(T* & _dev_data, T * & _dataTocpy) { void memCopyGlobalVariable(T* & _dev_data, T * & _dataTocpy) {
copy(_dev_data, _dataTocpy); copy(_dev_data, _dataTocpy);
} }
@ -76,16 +75,16 @@ public:
*Desallocate data on GPU global memory *Desallocate data on GPU global memory
*@param _data the data to desallocate from GPU global memory *@param _data the data to desallocate from GPU global memory
*/ */
template<typename T>
void memFree(T* & _data) { void memFree(T* & _data) {
free(_data); free(_data);
} }
public: public:
moCudaAllocator<T> malloc; moCudaAllocator malloc;
moCudaCopy<T> copy; moCudaCopy copy;
moCudaDesallocator<T> free; moCudaDesallocator free;
}; };

View file

@ -41,7 +41,6 @@
* class of managment of specific data problem * class of managment of specific data problem
*/ */
template<class T>
class moCudaSpecificData { class moCudaSpecificData {
public: public:
@ -78,10 +77,10 @@ public:
sizeData = _size; sizeData = _size;
} }
public: public:
unsigned int sizeData; unsigned int sizeData;
moCudaObject<T> cudaObject; moCudaObject cudaObject;
}; };
#endif #endif