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
CUDADataFormats
HGCal
interface
HGCUncalibRecHitHost.h
Go to the documentation of this file.
1
#ifndef CUDADAtaFormats_HGCal_HGCUncalibRecHitHost_H
2
#define CUDADAtaFormats_HGCal_HGCUncalibRecHitHost_H
3
4
#include <cassert>
5
#include <numeric>
6
7
#include "
HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h
"
8
#include "
CUDADataFormats/HGCal/interface/HGCRecHitSoA.h
"
9
#include "
CUDADataFormats/HGCal/interface/HGCUncalibRecHitSoA.h
"
10
11
template
<
class
T>
12
class
HGCUncalibRecHitHost
{
13
public
:
14
HGCUncalibRecHitHost
() =
default
;
15
explicit
HGCUncalibRecHitHost
(uint32_t
nhits
,
const
T
&
hits
,
const
cudaStream_t &
stream
) :
nhits_
(
nhits
) {
16
size_tot_
= std::accumulate(
sizes_
.begin(),
sizes_
.end(), 0);
//this might be done at compile time
17
pad_
= ((
nhits
- 1) / 32 + 1) * 32;
//align to warp boundary (assumption: warpSize = 32)
18
ptr_
= cms::cuda::make_host_unique<std::byte[]>(
pad_
*
size_tot_
,
stream
);
19
20
defineSoAMemoryLayout_
();
21
fillSoA_
(
hits
);
22
}
23
~HGCUncalibRecHitHost
() =
default
;
24
25
HGCUncalibRecHitHost
(
const
HGCUncalibRecHitHost
&) =
delete
;
26
HGCUncalibRecHitHost
&
operator=
(
const
HGCUncalibRecHitHost
&) =
delete
;
27
HGCUncalibRecHitHost
(
HGCUncalibRecHitHost
&&) =
default
;
28
HGCUncalibRecHitHost
&
operator=
(
HGCUncalibRecHitHost
&&) =
default
;
29
30
void
defineSoAMemoryLayout_
() {
31
soa_
.
amplitude_
= reinterpret_cast<float *>(
ptr_
.get());
32
soa_
.
pedestal_
=
soa_
.
amplitude_
+
pad_
;
33
soa_
.
jitter_
=
soa_
.
pedestal_
+
pad_
;
34
soa_
.
chi2_
=
soa_
.
jitter_
+
pad_
;
35
soa_
.
OOTamplitude_
=
soa_
.
chi2_
+
pad_
;
36
soa_
.
OOTchi2_
=
soa_
.
OOTamplitude_
+
pad_
;
37
soa_
.
flags_
= reinterpret_cast<uint32_t *>(
soa_
.
OOTchi2_
+
pad_
);
38
soa_
.
aux_
=
soa_
.
flags_
+
pad_
;
39
soa_
.
id_
=
soa_
.
aux_
+
pad_
;
40
soa_
.
aux_
=
soa_
.
flags_
+
pad_
;
41
soa_
.
id_
=
soa_
.
aux_
+
pad_
;
42
43
soa_
.
nbytes_
=
size_tot_
;
44
soa_
.
nhits_
=
nhits_
;
45
soa_
.
pad_
=
pad_
;
46
}
47
48
void
fillSoA_
(
const
T
&
c
) {
49
for
(
unsigned
i
(0);
i
<
nhits_
; ++
i
) {
50
soa_
.
amplitude_
[
i
] =
c
[
i
].amplitude();
51
soa_
.
pedestal_
[
i
] =
c
[
i
].pedestal();
52
soa_
.
jitter_
[
i
] =
c
[
i
].jitter();
53
soa_
.
chi2_
[
i
] =
c
[
i
].chi2();
54
soa_
.
OOTamplitude_
[
i
] =
c
[
i
].outOfTimeEnergy();
55
soa_
.
OOTchi2_
[
i
] =
c
[
i
].outOfTimeChi2();
56
soa_
.
flags_
[
i
] =
c
[
i
].flags();
57
soa_
.
aux_
[
i
] = 0;
58
soa_
.
id_
[
i
] =
c
[
i
].id().rawId();
59
}
60
}
61
62
HGCUncalibRecHitSoA
get
()
const
{
return
soa_
; }
63
uint32_t
nHits
()
const
{
return
nhits_
; }
64
uint32_t
pad
()
const
{
return
pad_
; }
65
uint32_t
nBytes
()
const
{
return
size_tot_
; }
66
67
private
:
68
cms::cuda::host::unique_ptr<std::byte[]>
ptr_
;
69
HGCUncalibRecHitSoA
soa_
;
70
static
constexpr std::array<int, memory::npointers::ntypes_hgcuncalibrechits_soa>
sizes_
= {
71
{
memory::npointers::float_hgcuncalibrechits_soa
*
sizeof
(
float
),
72
memory::npointers::uint32_hgcuncalibrechits_soa
*
sizeof
(uint32_t)}};
73
uint32_t
size_tot_
;
74
uint32_t
pad_
;
75
uint32_t
nhits_
;
76
};
77
78
#endif //CUDADAtaFormats_HGCal_HGCUncalibRecHitHost_H
HGCUncalibRecHitHost
Definition:
HGCUncalibRecHitHost.h:12
HGCUncalibRecHitHost::nhits_
uint32_t nhits_
Definition:
HGCUncalibRecHitHost.h:75
HGCUncalibRecHitHost::operator=
HGCUncalibRecHitHost & operator=(const HGCUncalibRecHitHost &)=delete
mps_fire.i
i
Definition:
mps_fire.py:428
HGCUncalibRecHitSoA::jitter_
float * jitter_
Definition:
HGCUncalibRecHitSoA.h:10
dqmMemoryStats.float
float
Definition:
dqmMemoryStats.py:127
HGCUncalibRecHitSoA::pad_
std::uint32_t pad_
Definition:
HGCUncalibRecHitSoA.h:21
hfClusterShapes_cfi.hits
hits
Definition:
hfClusterShapes_cfi.py:5
HGCUncalibRecHitSoA::amplitude_
float * amplitude_
Definition:
HGCUncalibRecHitSoA.h:8
HGCUncalibRecHitHost::ptr_
cms::cuda::host::unique_ptr< std::byte[]> ptr_
Definition:
HGCUncalibRecHitHost.h:68
memory::npointers::uint32_hgcuncalibrechits_soa
constexpr unsigned uint32_hgcuncalibrechits_soa
Definition:
HGCUncalibRecHitSoA.h:27
HGCUncalibRecHitSoA::nhits_
std::uint32_t nhits_
Definition:
HGCUncalibRecHitSoA.h:20
HGCUncalibRecHitHost::HGCUncalibRecHitHost
HGCUncalibRecHitHost()=default
cms::cuda::stream
cudaStream_t stream
Definition:
HistoContainer.h:57
HGCUncalibRecHitSoA::pedestal_
float * pedestal_
Definition:
HGCUncalibRecHitSoA.h:9
memory::npointers::float_hgcuncalibrechits_soa
constexpr unsigned float_hgcuncalibrechits_soa
Definition:
HGCUncalibRecHitSoA.h:26
HGCUncalibRecHitHost::size_tot_
uint32_t size_tot_
Definition:
HGCUncalibRecHitHost.h:73
HGCUncalibRecHitSoA::aux_
std::uint32_t * aux_
Definition:
HGCUncalibRecHitSoA.h:16
HGCUncalibRecHitHost::pad
uint32_t pad() const
Definition:
HGCUncalibRecHitHost.h:64
HGCUncalibRecHitSoA::chi2_
float * chi2_
Definition:
HGCUncalibRecHitSoA.h:11
HGCUncalibRecHitSoA::id_
std::uint32_t * id_
Definition:
HGCUncalibRecHitSoA.h:17
host_unique_ptr.h
HGCUncalibRecHitSoA
Definition:
HGCUncalibRecHitSoA.h:6
HGCUncalibRecHitHost::nHits
uint32_t nHits() const
Definition:
HGCUncalibRecHitHost.h:63
nhits
Definition:
HIMultiTrackSelector.h:42
HGCUncalibRecHitHost::pad_
uint32_t pad_
Definition:
HGCUncalibRecHitHost.h:74
HGCUncalibRecHitHost::nBytes
uint32_t nBytes() const
Definition:
HGCUncalibRecHitHost.h:65
HGCRecHitSoA.h
HGCUncalibRecHitSoA.h
HGCUncalibRecHitSoA::nbytes_
std::uint32_t nbytes_
Definition:
HGCUncalibRecHitSoA.h:19
HGCUncalibRecHitHost::~HGCUncalibRecHitHost
~HGCUncalibRecHitHost()=default
HGCUncalibRecHitSoA::OOTchi2_
float * OOTchi2_
Definition:
HGCUncalibRecHitSoA.h:13
HGCUncalibRecHitHost::get
HGCUncalibRecHitSoA get() const
Definition:
HGCUncalibRecHitHost.h:62
HGCUncalibRecHitSoA::flags_
std::uint32_t * flags_
Definition:
HGCUncalibRecHitSoA.h:15
HGCUncalibRecHitHost::HGCUncalibRecHitHost
HGCUncalibRecHitHost(uint32_t nhits, const T &hits, const cudaStream_t &stream)
Definition:
HGCUncalibRecHitHost.h:15
HGCUncalibRecHitSoA::OOTamplitude_
float * OOTamplitude_
Definition:
HGCUncalibRecHitSoA.h:12
T
long double T
Definition:
Basic3DVectorLD.h:48
cms::cuda::host::unique_ptr
std::unique_ptr< T, impl::HostDeleter > unique_ptr
Definition:
host_unique_ptr.h:21
HGCUncalibRecHitHost::sizes_
static constexpr std::array< int, memory::npointers::ntypes_hgcuncalibrechits_soa > sizes_
Definition:
HGCUncalibRecHitHost.h:70
HGCUncalibRecHitHost::fillSoA_
void fillSoA_(const T &c)
Definition:
HGCUncalibRecHitHost.h:48
HGCUncalibRecHitHost::soa_
HGCUncalibRecHitSoA soa_
Definition:
HGCUncalibRecHitHost.h:69
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:46
HGCUncalibRecHitHost::defineSoAMemoryLayout_
void defineSoAMemoryLayout_()
Definition:
HGCUncalibRecHitHost.h:30
Generated for CMSSW Reference Manual by
1.8.16