QMCPACK
PinnedAllocator.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2019 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_PINNED_ALLOCATOR_H
14 #define QMCPLUSPLUS_PINNED_ALLOCATOR_H
15 
16 #include <memory>
18 #if defined(ENABLE_CUDA)
19 #include "CUDA/CUDAallocator.hpp"
20 #elif defined(ENABLE_SYCL)
21 #include "SYCL/SYCLallocator.hpp"
22 #endif
23 
24 namespace qmcplusplus
25 {
26 
27 /** The fact that the pinned allocators are not always pinned hurts readability elsewhere. */
28 template<typename T>
29 #if defined(ENABLE_CUDA)
30 using PinnedAllocator = CUDALockedPageAllocator<T>;
31 #elif defined(ENABLE_SYCL)
32 using PinnedAllocator = SYCLHostAllocator<T>;
33 #else
34 using PinnedAllocator = std::allocator<T>;
35 #endif
36 
37 template<typename T, size_t ALIGN = QMC_SIMD_ALIGNMENT>
38 #if defined(ENABLE_CUDA)
40 #elif defined(ENABLE_SYCL)
42 #else
44 #endif
45 
46 } // namespace qmcplusplus
47 
48 #endif
allocator for SYCL host pinned memory T data type ALIGN alignment in bytes
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
this file provides three C++ memory allocators using CUDA specific memory allocation functions...
std::allocator< T > PinnedAllocator
The fact that the pinned allocators are not always pinned hurts readability elsewhere.
this file provides three C++ memory allocators using SYCL specific memory allocation functions...
allocator locks memory pages allocated by ULPHA