CUDADataFormats
HGCal
src
HGCUncalibRecHitDevice.cc
Go to the documentation of this file.
1
#include "
CUDADataFormats/HGCal/interface/HGCUncalibRecHitDevice.h
"
2
3
HGCUncalibRecHitDevice::HGCUncalibRecHitDevice
(uint32_t
nhits
,
const
cudaStream_t&
stream
) : nhits_(
nhits
) {
4
size_tot_
= std::accumulate(
sizes_
.begin(),
sizes_
.end(), 0);
//this might be done at compile time
5
pad_
= ((
nhits
- 1) / 32 + 1) * 32;
//align to warp boundary (assumption: warpSize = 32)
6
ptr_
= cms::cuda::make_device_unique<std::byte[]>(
pad_
*
size_tot_
,
stream
);
7
8
defineSoAMemoryLayout_
();
9
}
10
11
void
HGCUncalibRecHitDevice::defineSoAMemoryLayout_
() {
12
soa_
.
amplitude_
= reinterpret_cast<float*>(
ptr_
.get());
13
soa_
.
pedestal_
=
soa_
.
amplitude_
+
pad_
;
14
soa_
.
jitter_
=
soa_
.
pedestal_
+
pad_
;
15
soa_
.
chi2_
=
soa_
.
jitter_
+
pad_
;
16
soa_
.
OOTamplitude_
=
soa_
.
chi2_
+
pad_
;
17
soa_
.
OOTchi2_
=
soa_
.
OOTamplitude_
+
pad_
;
18
soa_
.
flags_
= reinterpret_cast<uint32_t*>(
soa_
.
OOTchi2_
+
pad_
);
19
soa_
.
aux_
=
soa_
.
flags_
+
pad_
;
20
soa_
.
id_
=
soa_
.
aux_
+
pad_
;
21
22
soa_
.
nbytes_
=
size_tot_
;
23
soa_
.
nhits_
=
nhits_
;
24
soa_
.
pad_
=
pad_
;
25
}
HGCUncalibRecHitDevice::size_tot_
uint32_t size_tot_
Definition:
HGCUncalibRecHitDevice.h:37
HGCUncalibRecHitSoA::jitter_
float * jitter_
Definition:
HGCUncalibRecHitSoA.h:10
HGCUncalibRecHitSoA::pad_
std::uint32_t pad_
Definition:
HGCUncalibRecHitSoA.h:21
HGCUncalibRecHitSoA::amplitude_
float * amplitude_
Definition:
HGCUncalibRecHitSoA.h:8
HGCUncalibRecHitDevice::ptr_
cms::cuda::device::unique_ptr< std::byte[]> ptr_
Definition:
HGCUncalibRecHitDevice.h:29
HGCUncalibRecHitSoA::nhits_
std::uint32_t nhits_
Definition:
HGCUncalibRecHitSoA.h:20
HGCUncalibRecHitSoA::pedestal_
float * pedestal_
Definition:
HGCUncalibRecHitSoA.h:9
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
HGCUncalibRecHitDevice::soa_
HGCUncalibRecHitSoA soa_
Definition:
HGCUncalibRecHitDevice.h:30
HGCUncalibRecHitSoA::aux_
std::uint32_t * aux_
Definition:
HGCUncalibRecHitSoA.h:16
HGCUncalibRecHitSoA::chi2_
float * chi2_
Definition:
HGCUncalibRecHitSoA.h:11
HGCUncalibRecHitDevice::HGCUncalibRecHitDevice
HGCUncalibRecHitDevice()=default
HGCUncalibRecHitSoA::id_
std::uint32_t * id_
Definition:
HGCUncalibRecHitSoA.h:17
HGCUncalibRecHitDevice::sizes_
static constexpr std::array< int, memory::npointers::ntypes_hgcuncalibrechits_soa > sizes_
Definition:
HGCUncalibRecHitDevice.h:31
HGCUncalibRecHitDevice::nhits_
uint32_t nhits_
Definition:
HGCUncalibRecHitDevice.h:36
nhits
Definition:
HIMultiTrackSelector.h:42
HGCUncalibRecHitSoA::nbytes_
std::uint32_t nbytes_
Definition:
HGCUncalibRecHitSoA.h:19
HGCUncalibRecHitSoA::OOTchi2_
float * OOTchi2_
Definition:
HGCUncalibRecHitSoA.h:13
HGCUncalibRecHitDevice::pad_
uint32_t pad_
Definition:
HGCUncalibRecHitDevice.h:35
HGCUncalibRecHitSoA::flags_
std::uint32_t * flags_
Definition:
HGCUncalibRecHitSoA.h:15
HGCUncalibRecHitSoA::OOTamplitude_
float * OOTamplitude_
Definition:
HGCUncalibRecHitSoA.h:12
HGCUncalibRecHitDevice.h
HGCUncalibRecHitDevice::defineSoAMemoryLayout_
void defineSoAMemoryLayout_()
Definition:
HGCUncalibRecHitDevice.cc:11
Generated for CMSSW Reference Manual by
1.8.16