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
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
CachingAllocator.h
thread_safety_macros.h
config
Definition:
config.py:1
cms::alpakatools
Definition:
HcalRecoParamWithPulseShapeHost.h:11
host.h
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
cms::alpakatools::getHostCachingAllocator
CachingAllocator< alpaka_common::DevHost, TQueue > & getHostCachingAllocator(AllocatorConfig const &config=AllocatorConfig{}, bool debug=false)
Definition:
getHostCachingAllocator.h:15
cms::alpakatools::host
alpaka::DevCpu const & host()
Definition:
host.h:14
cms::alpakatools::CachingAllocator
Definition:
CachingAllocator.h:89
debug
#define debug
Definition:
HDRShower.cc:19
cms::alpakatools::AllocatorConfig
Definition:
AllocatorConfig.h:10
config.h
AllocatorConfig.h
Generated for CMSSW Reference Manual by
1.8.14