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

Uses sycl_shared and sycl_free to allocate and deallocate unified shared memory (USM) on Intel GPUs. More...

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

Public Member Functions

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

Detailed Description

Uses sycl_shared and sycl_free to allocate and deallocate unified shared memory (USM) on Intel GPUs.

Member Function Documentation

◆ allocate()

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

Allocate bytes of memory using sycl::malloc_shared.

Parameters
bytesNumber of bytes to allocate.
Returns
Pointer to start of the allocation.
Exceptions
umpire::util::runtime_errorif memory cannot be allocated.

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

◆ deallocate()

void umpire::alloc::SyclMallocManagedAllocator::deallocate ( void *  usm_ptr,
const sycl::queue &  queue_t 
)
inline

Deallocate memory using sycl::free.

Parameters
usm_ptrAddress to deallocate.
Exceptions
umpire::util::runtime_errorif memory be free'd.

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

◆ isAccessible()

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