UMPIRE
Umpire: resource management and provision
umpire::alloc::SyclPinnedAllocator Struct Reference

Uses sycl's malloc_host and free to allocate and deallocate pinned memory on host. More...

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

Public Member Functions

void * allocate (std::size_t size, const sycl::queue &queue_t)
 Allocate bytes of memory using SYCL malloc_host. More...
 
void deallocate (void *ptr, const sycl::queue &queue_t)
 Deallocate memory using SYCL free. More...
 
bool isAccessible (Platform p)
 

Detailed Description

Uses sycl's malloc_host and free to allocate and deallocate pinned memory on host.

Member Function Documentation

◆ allocate()

void* umpire::alloc::SyclPinnedAllocator::allocate ( std::size_t  size,
const sycl::queue &  queue_t 
)
inline

Allocate bytes of memory using SYCL malloc_host.

Parameters
sizeNumber of bytes to allocate.
queue_tSYCL queue for providing information on device and context
Returns
Pointer to start of the allocation on host.
Exceptions
umpire::util::runtime_errorif memory cannot be allocated.

References umpire::util::message::Debug, UMPIRE_ERROR, and UMPIRE_LOG.

◆ deallocate()

void umpire::alloc::SyclPinnedAllocator::deallocate ( void *  ptr,
const sycl::queue &  queue_t 
)
inline

Deallocate memory using SYCL free.

Parameters
ptrAddress to deallocate.
queue_tSYCL queue this pointer was asociated with
Exceptions
umpire::util::runtime_errorif memory cannot be free'd.

References umpire::util::message::Debug, umpire::free(), and UMPIRE_LOG.

◆ isAccessible()

bool umpire::alloc::SyclPinnedAllocator::isAccessible ( Platform  p)
inline