QMCPACK
SYCLHostAllocator< T, ALIGN > Struct Template Reference

allocator for SYCL host pinned memory T data type ALIGN alignment in bytes More...

+ Inheritance diagram for SYCLHostAllocator< T, ALIGN >:
+ Collaboration diagram for SYCLHostAllocator< T, ALIGN >:

Classes

struct  rebind
 

Public Types

typedef T value_type
 
typedef size_t size_type
 
typedef T * pointer
 
typedef const T * const_pointer
 

Public Member Functions

 SYCLHostAllocator ()=default
 
template<class U >
 SYCLHostAllocator (const SYCLHostAllocator< U > &)
 
T * allocate (std::size_t n)
 
void deallocate (T *p, std::size_t)
 

Static Public Attributes

static constexpr size_t alignment = ALIGN
 

Detailed Description

template<typename T, size_t ALIGN = QMC_SIMD_ALIGNMENT>
struct qmcplusplus::SYCLHostAllocator< T, ALIGN >

allocator for SYCL host pinned memory T data type ALIGN alignment in bytes

Definition at line 214 of file SYCLallocator.hpp.


Class Documentation

◆ qmcplusplus::SYCLHostAllocator::rebind

struct qmcplusplus::SYCLHostAllocator::rebind

template<typename T, size_t ALIGN = QMC_SIMD_ALIGNMENT>
template<class U>
struct qmcplusplus::SYCLHostAllocator< T, ALIGN >::rebind< U >

Definition at line 229 of file SYCLallocator.hpp.

+ Collaboration diagram for SYCLHostAllocator< T, ALIGN >::rebind< U >:
Class Members
typedef SYCLHostAllocator< U > other

Member Typedef Documentation

◆ const_pointer

typedef const T* const_pointer

Definition at line 219 of file SYCLallocator.hpp.

◆ pointer

typedef T* pointer

Definition at line 218 of file SYCLallocator.hpp.

◆ size_type

typedef size_t size_type

Definition at line 217 of file SYCLallocator.hpp.

◆ value_type

typedef T value_type

Definition at line 216 of file SYCLallocator.hpp.

Constructor & Destructor Documentation

◆ SYCLHostAllocator() [1/2]

SYCLHostAllocator ( )
default

◆ SYCLHostAllocator() [2/2]

SYCLHostAllocator ( const SYCLHostAllocator< U > &  )
inline

Definition at line 225 of file SYCLallocator.hpp.

226  {}

Member Function Documentation

◆ allocate()

T* allocate ( std::size_t  n)
inline

Definition at line 234 of file SYCLallocator.hpp.

234 { return sycl::aligned_alloc_host<T>(ALIGN, n, getSYCLDefaultDeviceDefaultQueue()); }
sycl::queue & getSYCLDefaultDeviceDefaultQueue()
return a reference to the per-device default queue
Definition: SYCLruntime.cpp:18

◆ deallocate()

void deallocate ( T *  p,
std::size_t   
)
inline

Definition at line 235 of file SYCLallocator.hpp.

235 { sycl::free(p, getSYCLDefaultDeviceDefaultQueue()); }
sycl::queue & getSYCLDefaultDeviceDefaultQueue()
return a reference to the per-device default queue
Definition: SYCLruntime.cpp:18

Member Data Documentation

◆ alignment

constexpr size_t alignment = ALIGN
static

Definition at line 221 of file SYCLallocator.hpp.


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