Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
RecoLocalCalo
HGCalRecProducers
plugins
HeterogeneousHGCalHEBConditions.h
Go to the documentation of this file.
1
#ifndef HeterogeneousHGCalHEBConditions_h
2
#define HeterogeneousHGCalHEBConditions_h
3
4
#include <numeric>
//accumulate
5
#include <typeinfo>
6
7
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
8
#include "
HeterogeneousCore/CUDACore/interface/ESProduct.h
"
9
#include "
HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h
"
10
#include "
CUDADataFormats/HGCal/interface/HGCConditions.h
"
11
#include "
Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
"
12
#include "
Geometry/HGCalCommonData/interface/HGCalParameters.h
"
13
#include "
RecoLocalCalo/HGCalRecProducers/plugins/KernelManagerHGCalRecHit.h
"
14
15
namespace
cp
=
hgcal_conditions::parameters
;
16
17
// Declare the wrapper ESProduct. The corresponding ESProducer should
18
// produce objects of this type.
19
class
HeterogeneousHGCalHEBConditionsWrapper
{
20
public
:
21
// Constructor takes the standard CPU ESProduct, and transforms the
22
// necessary data to array(s) in pinned host memory
23
HeterogeneousHGCalHEBConditionsWrapper
(
const
HGCalParameters
*);
24
25
// Deallocates all pinned host memory
26
~HeterogeneousHGCalHEBConditionsWrapper
();
27
28
// Function to return the actual payload on the memory of the current device
29
hgcal_conditions::HeterogeneousHEBConditionsESProduct
const
*
getHeterogeneousConditionsESProductAsync
(
30
cudaStream_t
stream
)
const
;
31
32
private
:
33
// Holds the data in pinned CPU memory
34
// Contrary to its non-heterogeneous counterpart (constructor argument) it is *not* a pointer (so to avoid an extra allocation)
35
cp::HeterogeneousHGCalHEBParameters
params_
;
36
37
std::vector<size_t>
sizes_
;
38
size_t
chunk_
;
39
40
void
calculate_memory_bytes
(
const
HGCalParameters
*);
41
double
*&
select_pointer_d
(
cp::HeterogeneousHGCalHEBParameters
*,
const
unsigned
int
&)
const
;
42
std::vector<double>
select_pointer_d
(
const
HGCalParameters
*,
const
unsigned
int
&)
const
;
43
int32_t *&
select_pointer_i
(
cp::HeterogeneousHGCalHEBParameters
*,
const
unsigned
int
&)
const
;
44
std::vector<int32_t>
select_pointer_i
(
const
HGCalParameters
*,
const
unsigned
int
&)
const
;
45
46
// Helper struct to hold all information that has to be allocated and
47
// deallocated per device
48
struct
GPUData
{
49
// Destructor should free all member pointers
50
~GPUData
();
51
// internal pointers are on device, struct itself is on CPU
52
hgcal_conditions::HeterogeneousHEBConditionsESProduct
*
host
=
nullptr
;
53
// internal pounters and struct are on device
54
hgcal_conditions::HeterogeneousHEBConditionsESProduct
*
device
=
nullptr
;
55
};
56
57
// Helper that takes care of complexity of transferring the data to
58
// multiple devices
59
cms::cuda::ESProduct<GPUData>
gpuData_
;
60
};
61
62
#endif //HeterogeneousHGCalHEBConditions_h
HeterogeneousHGCalHEBConditionsWrapper::sizes_
std::vector< size_t > sizes_
Definition:
HeterogeneousHGCalHEBConditions.h:37
HeterogeneousHGCalHEBConditionsWrapper::select_pointer_i
int32_t *& select_pointer_i(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const
Definition:
HeterogeneousHGCalHEBConditions.cc:102
BeamSpotPI::parameters
parameters
Definition:
BeamSpotPayloadInspectorHelper.h:30
MessageLogger.h
HeterogeneousHGCalHEBConditionsWrapper::~HeterogeneousHGCalHEBConditionsWrapper
~HeterogeneousHGCalHEBConditionsWrapper()
Definition:
HeterogeneousHGCalHEBConditions.cc:74
HeterogeneousHGCalHEBConditionsWrapper::gpuData_
cms::cuda::ESProduct< GPUData > gpuData_
Definition:
HeterogeneousHGCalHEBConditions.h:59
HeterogeneousHGCalHEBConditionsWrapper::getHeterogeneousConditionsESProductAsync
const hgcal_conditions::HeterogeneousHEBConditionsESProduct * getHeterogeneousConditionsESProductAsync(cudaStream_t stream) const
Definition:
HeterogeneousHGCalHEBConditions.cc:125
HeterogeneousHGCalHEBConditionsWrapper::select_pointer_d
double *& select_pointer_d(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const
Definition:
HeterogeneousHGCalHEBConditions.cc:80
HeterogeneousHGCalHEBConditionsWrapper::calculate_memory_bytes
void calculate_memory_bytes(const HGCalParameters *)
Definition:
HeterogeneousHGCalHEBConditions.cc:51
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition:
HistoContainer.h:51
HeterogeneousHGCalHEBConditionsWrapper::GPUData
Definition:
HeterogeneousHGCalHEBConditions.h:48
HeterogeneousHGCalHEBConditionsWrapper::params_
cp::HeterogeneousHGCalHEBParameters params_
Definition:
HeterogeneousHGCalHEBConditions.h:35
hgcal_conditions::parameters
Definition:
HGCConditions.h:86
HGCConditions.h
hgcal_conditions::parameters::HeterogeneousHGCalHEBParameters
Definition:
HGCConditions.h:127
cms::cuda::ESProduct
Definition:
ESProduct.h:20
KernelManagerHGCalRecHit.h
HeterogeneousHGCalHEBConditionsWrapper::HeterogeneousHGCalHEBConditionsWrapper
HeterogeneousHGCalHEBConditionsWrapper(const HGCalParameters *)
Definition:
HeterogeneousHGCalHEBConditions.cc:3
hgcal_conditions::HeterogeneousHEBConditionsESProduct
Definition:
HGCConditions.h:192
HeterogeneousHGCalHEBConditionsWrapper::GPUData::device
hgcal_conditions::HeterogeneousHEBConditionsESProduct * device
Definition:
HeterogeneousHGCalHEBConditions.h:54
cudaCheck.h
HGCalParameters
Definition:
HGCalParameters.h:14
HeterogeneousHGCalHEBConditionsWrapper::chunk_
size_t chunk_
Definition:
HeterogeneousHGCalHEBConditions.h:38
HeterogeneousHGCalHEBConditionsWrapper::GPUData::~GPUData
~GPUData()
Definition:
HeterogeneousHGCalHEBConditions.cc:169
HeterogeneousHGCalHEBConditionsWrapper::GPUData::host
hgcal_conditions::HeterogeneousHEBConditionsESProduct * host
Definition:
HeterogeneousHGCalHEBConditions.h:52
HGCalDDDConstants.h
HGCalParameters.h
ESProduct.h
HeterogeneousHGCalHEBConditionsWrapper
Definition:
HeterogeneousHGCalHEBConditions.h:19
Generated for CMSSW Reference Manual by
1.8.16