src
HeterogeneousCore
AlpakaInterface
interface
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 "
FWCore/Utilities/interface/thread_safety_macros.h
"
5
#include "
HeterogeneousCore/AlpakaInterface/interface/AllocatorConfig.h
"
6
#include "
HeterogeneousCore/AlpakaInterface/interface/CachingAllocator.h
"
7
#include "
HeterogeneousCore/AlpakaInterface/interface/config.h
"
8
#include "
HeterogeneousCore/AlpakaInterface/interface/host.h
"
9
#include "
HeterogeneousCore/AlpakaInterface/interface/traits.h
"
10
11
namespace
cms::alpakatools
{
12
13
template
<
typename
TQueue,
typename
= std::enable_if_t<cms::alpakatools::is_queue_v<TQueue>>>
14
inline
CachingAllocator<alpaka_common::DevHost, TQueue>
&
getHostCachingAllocator
() {
15
// thread safe initialisation of the host allocator
16
CMS_THREAD_SAFE
static
CachingAllocator<alpaka_common::DevHost, TQueue>
allocator
(
17
host
(),
18
config::binGrowth
,
19
config::minBin
,
20
config::maxBin
,
21
config::maxCachedBytes
,
22
config::maxCachedFraction
,
23
false
,
// reuseSameQueueAllocations
24
false
);
// debug
25
26
// the public interface is thread safe
27
return
allocator
;
28
}
29
30
}
// namespace cms::alpakatools
31
32
#endif // HeterogeneousCore_AlpakaInterface_interface_getHostCachingAllocator_h
HLT_2022v15_cff.allocator
allocator
Definition:
HLT_2022v15_cff.py:6690
cms::alpakatools::getHostCachingAllocator
CachingAllocator< alpaka_common::DevHost, TQueue > & getHostCachingAllocator()
Definition:
getHostCachingAllocator.h:14
cms::alpakatools::config::minBin
constexpr unsigned int minBin
Definition:
AllocatorConfig.h:14
CachingAllocator.h
thread_safety_macros.h
cms::alpakatools::config::maxBin
constexpr unsigned int maxBin
Definition:
AllocatorConfig.h:17
cms::alpakatools
Definition:
PortableCollection.h:43
cms::alpakatools::config::maxCachedFraction
constexpr double maxCachedFraction
Definition:
AllocatorConfig.h:23
host.h
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
cms::alpakatools::config::maxCachedBytes
constexpr size_t maxCachedBytes
Definition:
AllocatorConfig.h:20
traits.h
cms::alpakatools::host
alpaka::DevCpu const & host()
Definition:
host.h:24
cms::alpakatools::CachingAllocator
Definition:
CachingAllocator.h:88
cms::alpakatools::config::binGrowth
constexpr unsigned int binGrowth
Definition:
AllocatorConfig.h:11
config.h
AllocatorConfig.h
Generated for CMSSW Reference Manual by
1.8.14