1 #ifndef HeterogeneousCore_AlpakaCore_interface_QueueCache_h 2 #define HeterogeneousCore_AlpakaCore_interface_QueueCache_h 7 #include <alpaka/alpaka.hpp> 17 template <
typename Queue>
19 #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED 20 friend class alpaka_cuda_async::AlpakaService;
22 #ifdef ALPAKA_ACC_GPU_HIP_ENABLED 23 friend class alpaka_rocm_async::AlpakaService;
25 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED 26 friend class alpaka_serial_sync::AlpakaService;
28 #ifdef ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLED 29 friend class alpaka_tbb_async::AlpakaService;
43 std::shared_ptr<Queue>
get(
Device const& dev) {
44 return cache_[alpaka::getNativeHandle(dev)].makeOrGet([dev]() {
return std::make_unique<Queue>(dev); });
59 std::vector<edm::ReusableObjectHolder<Queue>>
cache_;
64 template <
typename Queue>
73 #endif // HeterogeneousCore_AlpakaCore_interface_QueueCache_h