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