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

#include <device_allocations_cu.h>

Public Member Functions

void addAllocation (void *datapointer, MemPointerBase *device_mem_pointer, int deviceid)
 
void removeAllocation (void *datapointer, MemPointerBase *device_mem_pointer, int deviceid)
 
bool freeAllocation (size_t minsize, int deviceid)
 
void printList (int deviceid)
 

Static Public Member Functions

static DeviceAllocations_CUgetInstance ()
 

Protected Member Functions

 DeviceAllocations_CU ()
 
virtual ~DeviceAllocations_CU ()
 

Detailed Description

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

singleton class keeping track of all skepu containers and their device memory allocations

Constructor & Destructor Documentation

template<typename T >
skepu::DeviceAllocations_CU< T >::DeviceAllocations_CU ( )
protected

The constructor initializes the devices.

template<typename T >
skepu::DeviceAllocations_CU< T >::~DeviceAllocations_CU ( )
protectedvirtual

Destructor

Member Function Documentation

template<typename T >
void skepu::DeviceAllocations_CU< T >::addAllocation ( void *  datapointer,
MemPointerBase *  device_mem_pointer,
int  deviceid 
)

Add a device memory allocation to the list

Parameters
datapointerPointer to device memory
device_mem_pointerDeviceMemPointer_CU object related to the memory allocation
deviceidID of device where the allocation resides

Referenced by skepu::DeviceMemPointer_CU< T >::DeviceMemPointer_CU().

template<typename T >
bool skepu::DeviceAllocations_CU< T >::freeAllocation ( size_t  minsize,
int  deviceid 
)

Attempts to free up memory on the device Called when memory allocation fails due to lack of memory

Parameters
minsizeThe amount of memory required by the failed malloc call
deviceidThe device to free up memory on
template<typename T >
DeviceAllocations_CU< T > * skepu::DeviceAllocations_CU< T >::getInstance ( )
static

Gets pointer to first instance, at first call a new instance is created.

Returns
Pointer to class instance.

Referenced by skepu::DeviceMemPointer_CU< T >::DeviceMemPointer_CU(), skepu::DeviceMemPointer_CU< T >::markCopyInvalid(), and skepu::DeviceMemPointer_CU< T >::~DeviceMemPointer_CU().

template<typename T >
void skepu::DeviceAllocations_CU< T >::printList ( int  deviceid)

Print information regarding device allocations

Parameters
deviceidID of device for which to print information
template<typename T >
void skepu::DeviceAllocations_CU< T >::removeAllocation ( void *  datapointer,
MemPointerBase *  device_mem_pointer,
int  deviceid 
)

Remove a device memory allocation from the list

Parameters
datapointerPointer to device memory used to identify which object should be removed
device_mem_pointerDeviceMemPointer_CU object related to the memory allocation
deviceidID of device where the allocation resides

Referenced by skepu::DeviceMemPointer_CU< T >::markCopyInvalid(), and skepu::DeviceMemPointer_CU< T >::~DeviceMemPointer_CU().


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