Unified Memory Group Allocator
Public Member Functions | List of all members
groupallocator::GroupAllocator Class Reference

#include <GroupAllocator.h>

Public Member Functions

 GroupAllocator (int group_num, std::size_t page_size)
 
 ~GroupAllocator ()
 
void freeall ()
 
template<class T >
void free (T *ptr)
 
template<class T >
void allocate (T **ptr, size_t s, bool forceAligned128)
 
void moveToDevice (int device, cudaStream_t stream)
 
size_t pagesAllocated ()
 
size_t getPageSize ()
 

Detailed Description

Allocates with group affinity

Constructor & Destructor Documentation

◆ GroupAllocator()

groupallocator::GroupAllocator::GroupAllocator ( int  group_num,
std::size_t  page_size 
)
inline

Constructor takes group_num to allocate to

Parameters
group_num

◆ ~GroupAllocator()

groupallocator::GroupAllocator::~GroupAllocator ( )
inline

Delete function

Member Function Documentation

◆ allocate()

template<class T >
void groupallocator::GroupAllocator::allocate ( T **  ptr,
size_t  s,
bool  forceAligned128 
)
inline

Allocates memory of type T and sets *ptr to this memory of size s

Template Parameters
T
Parameters
ptr
s
forceAligned128

◆ free()

template<class T >
void groupallocator::GroupAllocator::free ( T *  ptr)
inline

Free pointer T* ptr

Template Parameters
T
Parameters
ptr

◆ freeall()

void groupallocator::GroupAllocator::freeall ( )
inline

Function to free all memory of group allocator

◆ moveToDevice()

void groupallocator::GroupAllocator::moveToDevice ( int  device,
cudaStream_t  stream 
)
inline

Move to memory device in stream

Parameters
device
stream

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