QMCPACK
qmc_allocator_traits< OMPallocator< T, HostAllocator > > Struct Template Reference

Specialization for OMPallocator which is a special DualAllocator with fused device and dualspace allocator functionality. More...

+ Collaboration diagram for qmc_allocator_traits< OMPallocator< T, HostAllocator > >:

Static Public Member Functions

static void fill_n (T *ptr, size_t n, const T &value)
 
static void attachReference (const OMPallocator< T, HostAllocator > &from, OMPallocator< T, HostAllocator > &to, std::ptrdiff_t ptr_offset)
 
static void updateTo (OMPallocator< T, HostAllocator > &alloc, T *host_ptr, size_t n, size_t offset=0)
 
static void updateFrom (OMPallocator< T, HostAllocator > &alloc, T *host_ptr, size_t n, size_t offset=0)
 
static void deviceSideCopyN (OMPallocator< T, HostAllocator > &alloc, size_t to, size_t n, size_t from)
 

Static Public Attributes

static constexpr bool is_host_accessible = true
 
static constexpr bool is_dual_space = true
 

Detailed Description

template<typename T, class HostAllocator>
struct qmcplusplus::qmc_allocator_traits< OMPallocator< T, HostAllocator > >

Specialization for OMPallocator which is a special DualAllocator with fused device and dualspace allocator functionality.

Definition at line 133 of file OMPallocator.hpp.

Member Function Documentation

◆ attachReference()

static void attachReference ( const OMPallocator< T, HostAllocator > &  from,
OMPallocator< T, HostAllocator > &  to,
std::ptrdiff_t  ptr_offset 
)
inlinestatic

Definition at line 144 of file OMPallocator.hpp.

References OMPallocator< T, HostAllocator >::attachReference().

147  {
148  to.attachReference(from, ptr_offset);
149  }

◆ deviceSideCopyN()

static void deviceSideCopyN ( OMPallocator< T, HostAllocator > &  alloc,
size_t  to,
size_t  n,
size_t  from 
)
inlinestatic

Definition at line 162 of file OMPallocator.hpp.

References OMPallocator< T, HostAllocator >::get_device_ptr(), and qmcplusplus::n.

163  {
164  auto* dev_ptr = alloc.get_device_ptr();
165  PRAGMA_OFFLOAD("omp target teams distribute parallel for is_device_ptr(dev_ptr)")
166  for (int i = 0; i < n; i++)
167  dev_ptr[to + i] = dev_ptr[from + i];
168  }
for(int i=0;i< size_test;++i) CHECK(Approx(gauss_random_vals[offset_for_rs+i])

◆ fill_n()

static void fill_n ( T *  ptr,
size_t  n,
const T &  value 
)
inlinestatic

Definition at line 138 of file OMPallocator.hpp.

References qmc_allocator_traits< Allocator >::fill_n(), and qmcplusplus::n.

139  {
141  //PRAGMA_OFFLOAD("omp target update to(ptr[:n])")
142  }
static void fill_n(value_type *ptr, size_t n, const value_type &value)

◆ updateFrom()

static void updateFrom ( OMPallocator< T, HostAllocator > &  alloc,
T *  host_ptr,
size_t  n,
size_t  offset = 0 
)
inlinestatic

Definition at line 156 of file OMPallocator.hpp.

157  {
158  PRAGMA_OFFLOAD("omp target update from(host_ptr[offset:n])");
159  }

◆ updateTo()

static void updateTo ( OMPallocator< T, HostAllocator > &  alloc,
T *  host_ptr,
size_t  n,
size_t  offset = 0 
)
inlinestatic

Definition at line 151 of file OMPallocator.hpp.

152  {
153  PRAGMA_OFFLOAD("omp target update to(host_ptr[offset:n])");
154  }

Member Data Documentation

◆ is_dual_space

constexpr bool is_dual_space = true
static

Definition at line 136 of file OMPallocator.hpp.

◆ is_host_accessible

constexpr bool is_host_accessible = true
static

Definition at line 135 of file OMPallocator.hpp.


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