20 #ifndef QMCPLUSPLUS_SYCL_ALLOCATOR_H 21 #define QMCPLUSPLUS_SYCL_ALLOCATOR_H 28 #include <sycl/sycl.hpp> 43 template<
typename T,
size_t ALIGN = QMC_SIMD_ALIGNMENT>
72 template<
class T1,
class T2>
77 template<
class T1,
class T2>
96 template<
typename T,
size_t ALIGN = 64>
147 template<
class U,
class... Args>
175 template<
class T1,
class T2>
180 template<
class T1,
class T2>
191 static void fill_n(T* ptr,
size_t n,
const T& value)
198 T* device_ptr = alloc.getDevicePtr(host_ptr);
204 T* device_ptr = alloc.getDevicePtr(host_ptr);
213 template<
typename T,
size_t ALIGN = QMC_SIMD_ALIGNMENT>
238 template<
class T1,
class T2>
244 template<
class T1,
class T2>
void copyFromDevice(T *host_ptr, T *device_ptr, size_t n)
allocator for SYCL host pinned memory T data type ALIGN alignment in bytes
sycl::queue & getSYCLDefaultDeviceDefaultQueue()
return a reference to the per-device default queue
static constexpr bool is_dual_space
T * allocate(std::size_t n)
SYCLSharedAllocator(const SYCLSharedAllocator< U > &)
helper functions for EinsplineSetBuilder
T * allocate(std::size_t n)
static void updateFrom(SYCLAllocator< T > &alloc, T *host_ptr, size_t n)
static void updateTo(SYCLAllocator< T > &alloc, T *host_ptr, size_t n)
static void destroy(U *p)
Give std::allocator_traits something to call.
SYCLSharedAllocator()=default
allocator for SYCL device memory T data type ALIGN alignment in bytes
SYCLHostAllocator< U > other
bool operator==(const Matrix< T, Alloc > &lhs, const Matrix< T, Alloc > &rhs)
static void fill_n(T *ptr, size_t n, const T &value)
void copyToDevice(T *device_ptr, T *host_ptr, size_t n)
void deallocate(T *p, std::size_t n)
static void construct(U *p, Args &&... args)
Provide a construct for std::allocator_traits::contruct to call.
void deallocate(T *p, std::size_t)
SYCLAllocator(const SYCLAllocator< U > &)
static constexpr bool is_host_accessible
static constexpr size_t alignment
template class analogous to std::allocator_traits.
size_t getSYCLdeviceMemAllocated()
std::atomic< size_t > SYCLallocator_device_mem_allocated
void copyDeviceToDevice(T *to_ptr, size_t n, T *from_ptr)
SYCLHostAllocator()=default
SYCLSharedAllocator< U > other
static constexpr size_t alignment
SYCLHostAllocator(const SYCLHostAllocator< U > &)
static constexpr size_t alignment
T * allocate(std::size_t n)
void deallocate(T *p, std::size_t)
allocator for SYCL shared memory T data type ALIGN alignment in bytes
bool operator!=(const Matrix< T, Alloc > &lhs, const Matrix< T, Alloc > &rhs)