![]() |
QMCPACK
|
Generalizes the DualMemorySpace allocator This provides a limited alternative to OMPallocator for testing/benchmarking without dependence of OMPTarget/ offload. More...
Classes | |
struct | rebind |
Public Types | |
using | Value = typename HostAllocator::value_type |
using | Size = typename HostAllocator::size_type |
using | Pointer = typename HostAllocator::pointer |
using | ConstPointer = typename HostAllocator::const_pointer |
Public Member Functions | |
DualAllocator () | |
DualAllocator (const DualAllocator &) | |
DualAllocator & | operator= (const DualAllocator &) |
template<class U , class V > | |
DualAllocator (const DualAllocator< U, V > &) | |
Value * | allocate (std::size_t n) |
void | deallocate (Value *pt, std::size_t n) |
void | attachReference (const DualAllocator &from, std::ptrdiff_t ptr_offset) |
T * | get_device_ptr () |
const T * | get_device_ptr () const |
DeviceAllocator & | get_device_allocator () |
const DeviceAllocator & | get_device_allocator () const |
Private Attributes | |
HostAllocator | allocator_ |
DeviceAllocator | device_allocator_ |
T * | device_ptr_ |
Generalizes the DualMemorySpace allocator This provides a limited alternative to OMPallocator for testing/benchmarking without dependence of OMPTarget/ offload.
It does not provide an alternative to OMPtarget transfer semantics so many production objects will not be functional if it is used as the allocator for the data objects they depend on. If you use DualAllocator at this time you need to handle data transfer yourself.
Definition at line 48 of file DualAllocator.hpp.
struct qmcplusplus::DualAllocator::rebind |
Definition at line 66 of file DualAllocator.hpp.
Class Members | ||
---|---|---|
typedef DualAllocator< U, V > | other |
using ConstPointer = typename HostAllocator::const_pointer |
Definition at line 53 of file DualAllocator.hpp.
using Pointer = typename HostAllocator::pointer |
Definition at line 52 of file DualAllocator.hpp.
using Size = typename HostAllocator::size_type |
Definition at line 51 of file DualAllocator.hpp.
using Value = typename HostAllocator::value_type |
Definition at line 50 of file DualAllocator.hpp.
|
inline |
Definition at line 55 of file DualAllocator.hpp.
|
inline |
Definition at line 56 of file DualAllocator.hpp.
|
inline |
Definition at line 62 of file DualAllocator.hpp.
|
inline |
Definition at line 71 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::allocator_, DualAllocator< T, DeviceAllocator, HostAllocator >::device_allocator_, DualAllocator< T, DeviceAllocator, HostAllocator >::device_ptr_, qmcplusplus::dual_device_mem_allocated, and qmcplusplus::n.
|
inline |
Definition at line 90 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::device_ptr_, and DualAllocator< T, DeviceAllocator, HostAllocator >::get_device_ptr().
Referenced by qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::attachReference().
|
inline |
Definition at line 82 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::allocator_, DualAllocator< T, DeviceAllocator, HostAllocator >::device_allocator_, DualAllocator< T, DeviceAllocator, HostAllocator >::device_ptr_, qmcplusplus::dual_device_mem_allocated, and qmcplusplus::n.
|
inline |
Definition at line 98 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::device_allocator_.
Referenced by qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::deviceSideCopyN(), qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::updateFrom(), and qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::updateTo().
|
inline |
Definition at line 99 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::device_allocator_.
|
inline |
Definition at line 95 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::device_ptr_.
Referenced by DualAllocator< T, DeviceAllocator, HostAllocator >::attachReference(), qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::deviceSideCopyN(), qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::updateFrom(), and qmc_allocator_traits< DualAllocator< T, DeviceAllocator, HostAllocator > >::updateTo().
|
inline |
Definition at line 96 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::device_ptr_.
|
inline |
Definition at line 57 of file DualAllocator.hpp.
References DualAllocator< T, DeviceAllocator, HostAllocator >::device_ptr_.
|
private |
Definition at line 102 of file DualAllocator.hpp.
Referenced by DualAllocator< T, DeviceAllocator, HostAllocator >::allocate(), and DualAllocator< T, DeviceAllocator, HostAllocator >::deallocate().
|
private |
|
private |
Definition at line 104 of file DualAllocator.hpp.
Referenced by DualAllocator< T, DeviceAllocator, HostAllocator >::allocate(), DualAllocator< T, DeviceAllocator, HostAllocator >::attachReference(), DualAllocator< T, DeviceAllocator, HostAllocator >::deallocate(), DualAllocator< T, DeviceAllocator, HostAllocator >::get_device_ptr(), and DualAllocator< T, DeviceAllocator, HostAllocator >::operator=().