UMPIRE
Umpire: resource management and provision
umpire::DeviceAllocator Class Reference

Lightweight allocator for use in GPU code. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/DeviceAllocator.hpp>

Public Member Functions

__host__ __device__ ~DeviceAllocator ()
 
__host__ __device__ DeviceAllocator (const DeviceAllocator &other)
 
__device__ void * allocate (size_t size)
 
__host__ __device__ int getID ()
 
__host__ __device__ const char * getName ()
 
__host__ void destroy ()
 
__host__ __device__ bool isInitialized ()
 
__host__ __device__ unsigned int getCurrentSize ()
 
__host__ __device__ size_t getTotalSize ()
 
__host__ __device__ void reset ()
 

Friends

__host__ DeviceAllocator make_device_allocator (Allocator allocator, size_t size, const std::string &name)
 Construct a new DeviceAllocator. Calls the private Device Allocator constructor that records the associated id. More...
 

Detailed Description

Lightweight allocator for use in GPU code.

Constructor & Destructor Documentation

◆ ~DeviceAllocator()

__host__ __device__ umpire::DeviceAllocator::~DeviceAllocator ( )

◆ DeviceAllocator()

__host__ __device__ umpire::DeviceAllocator::DeviceAllocator ( const DeviceAllocator other)

Member Function Documentation

◆ allocate()

__device__ void * umpire::DeviceAllocator::allocate ( size_t  size)

References UMPIRE_ERROR.

◆ getID()

__host__ __device__ int umpire::DeviceAllocator::getID ( )

◆ getName()

__host__ __device__ const char * umpire::DeviceAllocator::getName ( )

◆ destroy()

__host__ void umpire::DeviceAllocator::destroy ( )

◆ isInitialized()

__host__ __device__ bool umpire::DeviceAllocator::isInitialized ( )

◆ getCurrentSize()

__host__ __device__ unsigned int umpire::DeviceAllocator::getCurrentSize ( )

◆ getTotalSize()

__host__ __device__ size_t umpire::DeviceAllocator::getTotalSize ( )

◆ reset()

__host__ __device__ void umpire::DeviceAllocator::reset ( )

Friends And Related Function Documentation

◆ make_device_allocator

__host__ DeviceAllocator make_device_allocator ( Allocator  allocator,
size_t  size,
const std::string &  name 
)
friend

Construct a new DeviceAllocator. Calls the private Device Allocator constructor that records the associated id.

Parameters
allocatorAllocator to build the DeviceAllocator from.
sizeTotal size of the DeviceAllocator.
nameof the DeviceAllocator