QMCPACK
qmc_allocator_traits< Allocator > Struct Template Reference

template class analogous to std::allocator_traits. More...

+ Collaboration diagram for qmc_allocator_traits< Allocator >:

Public Types

using value_type = typename Allocator::value_type
 

Static Public Member Functions

static void fill_n (value_type *ptr, size_t n, const value_type &value)
 
static void attachReference (Allocator &from, Allocator &to, std::ptrdiff_t ptr_offset)
 So we can write generic tests that work with all QMCPACK allocators. More...
 
static void updateTo (Allocator &a, value_type *host_ptr, size_t n, size_t offset=0)
 
static void updateFrom (Allocator &a, value_type *host_ptr, size_t n, size_t offset=0)
 
static void deviceSideCopyN (Allocator &a, 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 = false
 

Detailed Description

template<class Allocator>
struct qmcplusplus::qmc_allocator_traits< Allocator >

template class analogous to std::allocator_traits.

  • defines the is_host_accessible and is_dual_space traits
  • abstracts the data movement on,off and from place to place on device.
  • abstracts the fill function for the allocator.

Definition at line 26 of file allocator_traits.hpp.

Member Typedef Documentation

◆ value_type

using value_type = typename Allocator::value_type

Definition at line 28 of file allocator_traits.hpp.

Member Function Documentation

◆ attachReference()

static void attachReference ( Allocator &  from,
Allocator &  to,
std::ptrdiff_t  ptr_offset 
)
static

So we can write generic tests that work with all QMCPACK allocators.

Parameters
ptr_offsetpointer offset between to and from

Referenced by Vector< T, std::allocator< T > >::attachReference(), VectorSoaContainer< ST, 5 >::attachReference(), and Vector< T, std::allocator< T > >::Vector().

◆ deviceSideCopyN()

static void deviceSideCopyN ( Allocator &  a,
size_t  to,
size_t  n,
size_t  from 
)
static

◆ fill_n()

◆ updateFrom()

static void updateFrom ( Allocator &  a,
value_type host_ptr,
size_t  n,
size_t  offset = 0 
)
static

◆ updateTo()

static void updateTo ( Allocator &  a,
value_type host_ptr,
size_t  n,
size_t  offset = 0 
)
static

Member Data Documentation

◆ is_dual_space

constexpr bool is_dual_space = false
static

Definition at line 31 of file allocator_traits.hpp.

◆ is_host_accessible

constexpr bool is_host_accessible = true
static

Definition at line 30 of file allocator_traits.hpp.


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