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 
12 
13 namespace cms::alpakatools {
14 
15  template <typename TQueue, typename = std::enable_if_t<alpaka::isQueue<TQueue>>>
17  AllocatorConfig const& config = AllocatorConfig{}, bool debug = false) {
18  // thread safe initialisation of the host allocator
19  CMS_THREAD_SAFE static CachingAllocator<alpaka_common::DevHost, TQueue> allocator(
20  host(),
21  config,
22  false, // reuseSameQueueAllocations
23  debug);
24 
25  // the public interface is thread safe
26  return allocator;
27  }
28 
29 } // namespace cms::alpakatools
30 
31 #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