QMCPACK
SYCLSharedAllocator< T, ALIGN > Struct Template Reference

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

+ Collaboration diagram for SYCLSharedAllocator< 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

 SYCLSharedAllocator ()=default
 
template<class U >
 SYCLSharedAllocator (const SYCLSharedAllocator< 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::SYCLSharedAllocator< T, ALIGN >

allocator for SYCL shared memory T data type ALIGN alignment in bytes

Definition at line 44 of file SYCLallocator.hpp.


Class Documentation

◆ qmcplusplus::SYCLSharedAllocator::rebind

struct qmcplusplus::SYCLSharedAllocator::rebind

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

Definition at line 59 of file SYCLallocator.hpp.

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

Member Typedef Documentation

◆ const_pointer

typedef const T* const_pointer

Definition at line 49 of file SYCLallocator.hpp.

◆ pointer

typedef T* pointer

Definition at line 48 of file SYCLallocator.hpp.

◆ size_type

typedef size_t size_type

Definition at line 47 of file SYCLallocator.hpp.

◆ value_type

typedef T value_type

Definition at line 46 of file SYCLallocator.hpp.

Constructor & Destructor Documentation

◆ SYCLSharedAllocator() [1/2]

SYCLSharedAllocator ( )
default

◆ SYCLSharedAllocator() [2/2]

SYCLSharedAllocator ( const SYCLSharedAllocator< U > &  )
inline

Definition at line 55 of file SYCLallocator.hpp.

56  {}

Member Function Documentation

◆ allocate()

T* allocate ( std::size_t  n)
inline

Definition at line 64 of file SYCLallocator.hpp.

References qmcplusplus::getSYCLDefaultDeviceDefaultQueue(), and qmcplusplus::n.

65  {
66  T* pt = sycl::aligned_alloc_shared<T>(ALIGN, n, getSYCLDefaultDeviceDefaultQueue());
67  return pt;
68  }
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 69 of file SYCLallocator.hpp.

References qmcplusplus::getSYCLDefaultDeviceDefaultQueue().

69 { 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 51 of file SYCLallocator.hpp.


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