UMPIRE
Umpire: resource management and provision
device_allocator_helper.hpp File Reference
#include <string.h>
#include "umpire/DeviceAllocator.hpp"
#include "umpire/util/error.hpp"

Namespaces

 umpire
 

Macros

#define UMPIRE_SET_UP_DEVICE_ALLOCATORS()
 

Functions

__host__ __device__ DeviceAllocator umpire::get_device_allocator (const char *name)
 
__host__ __device__ DeviceAllocator umpire::get_device_allocator (int da_id)
 
__host__ __device__ bool umpire::is_device_allocator (int da_id)
 
__host__ __device__ bool umpire::is_device_allocator (const char *name)
 
__host__ DeviceAllocator umpire::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...
 
__host__ void umpire::destroy_device_allocator ()
 

Variables

constexpr int umpire::UMPIRE_TOTAL_DEV_ALLOCS {64}
 

Macro Definition Documentation

◆ UMPIRE_SET_UP_DEVICE_ALLOCATORS

#define UMPIRE_SET_UP_DEVICE_ALLOCATORS ( )
Value:
{ \
if (umpire::macro_tracking == 0) { \
UMPIRE_LOG(Debug, "Calling cudaMemcpyToSymbol DeviceAllocator macro."); \
cudaError_t err = cudaMemcpyToSymbol(umpire::UMPIRE_DEV_ALLOCS, &umpire::UMPIRE_DEV_ALLOCS_h, \
if (err != cudaSuccess) { \
UMPIRE_ERROR(umpire::runtime_error, \
fmt::format("cudaMemcpyToSymbol failed with error: {}", cudaGetErrorString(err))); \
} \
} \
umpire::macro_tracking = 1; \
}
Lightweight allocator for use in GPU code.
Definition: DeviceAllocator.hpp:19
Definition: error.hpp:20
@ Debug
Definition: Logger.hpp:20
__device__ DeviceAllocator * UMPIRE_DEV_ALLOCS
Definition: device_allocator_helper.cpp:25
DeviceAllocator * UMPIRE_DEV_ALLOCS_h
Definition: device_allocator_helper.cpp:24