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
#include "
HeterogeneousCore/AlpakaInterface/interface/traits.h
"
12
13
namespace
cms::alpakatools
{
14
15
template
<
typename
TQueue,
typename
= std::enable_if_t<alpaka::isQueue<TQueue>>>
16
inline
CachingAllocator<alpaka_common::DevHost, TQueue>
&
getHostCachingAllocator
(
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
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:16
traits.h
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