CMS 3D CMS Logo

getHostCachingAllocator.h
Go to the documentation of this file.
1 #ifndef HeterogeneousCore_AlpakaInterface_interface_getHostCachingAllocator_h
2 #define HeterogeneousCore_AlpakaInterface_interface_getHostCachingAllocator_h
3 
4 #include <alpaka/alpaka.hpp>
5 
11 
12 namespace cms::alpakatools {
13 
14  template <typename TQueue, typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
16  AllocatorConfig const& config = AllocatorConfig{}, bool debug = false) {
17  // thread safe initialisation of the host allocator
18  CMS_THREAD_SAFE static CachingAllocator<alpaka_common::DevHost, TQueue> allocator(
19  host(),
20  config,
21  false, // reuseSameQueueAllocations
22  debug);
23 
24  // the public interface is thread safe
25  return allocator;
26  }
27 
28 } // namespace cms::alpakatools
29 
30 #endif // HeterogeneousCore_AlpakaInterface_interface_getHostCachingAllocator_h
Definition: config.py:1
#define CMS_THREAD_SAFE
CachingAllocator< alpaka_common::DevHost, TQueue > & getHostCachingAllocator(AllocatorConfig const &config=AllocatorConfig{}, bool debug=false)
alpaka::DevCpu const & host()
Definition: host.h:14
#define debug
Definition: HDRShower.cc:19