11 std::vector<size_t> cumsum_sizes(this->
sizes_.size() + 1, 0);
12 std::partial_sum(this->
sizes_.begin(), this->
sizes_.end(), cumsum_sizes.begin() + 1);
13 for (
unsigned int i = 1;
i < cumsum_sizes.size(); ++
i)
15 unsigned int typesHEBize = 0;
17 typesHEBize =
sizeof(double);
18 else if (
cp::typesHEB[
i - 1] == cp::HeterogeneousHGCalHEBParametersType::Int32_t)
19 typesHEBize =
sizeof(int32_t);
21 throw cms::Exception(
"HeterogeneousHGCalHEBConditionsWrapper") <<
"Wrong HeterogeneousHGCalParameters type";
22 cumsum_sizes[
i] /= typesHEBize;
25 for (
unsigned int j = 0;
j < this->
sizes_.size(); ++
j) {
28 const unsigned int jm1 =
j - 1;
33 cp::typesHEB[
j] == cp::HeterogeneousHGCalHEBParametersType::Int32_t)
39 for (
unsigned int i = cumsum_sizes[
j];
i < cumsum_sizes[
j + 1]; ++
i) {
40 unsigned int index =
i - cumsum_sizes[
j];
43 }
else if (
cp::typesHEB[
j] == cp::HeterogeneousHGCalHEBParametersType::Int32_t)
46 throw cms::Exception(
"HeterogeneousHGCalHEBConditionsWrapper") <<
"Wrong HeterogeneousHGCalParameters type";
53 std::vector<size_t> sizes(npointers);
54 for (
unsigned int i = 0;
i < npointers; ++
i) {
61 std::vector<size_t> sizes_units(npointers);
62 for (
unsigned int i = 0;
i < npointers; ++
i) {
64 sizes_units[
i] =
sizeof(double);
65 else if (
cp::typesHEB[
i] == cp::HeterogeneousHGCalHEBParametersType::Int32_t)
66 sizes_units[
i] =
sizeof(int32_t);
70 this->
sizes_.resize(npointers);
71 std::transform(sizes.begin(), sizes.end(), sizes_units.begin(), this->
sizes_.begin(), std::multiplies<size_t>());
81 const unsigned int&
item)
const {
86 throw cms::Exception(
"HeterogeneousHGCalHEBConditionsWrapper") <<
"select_pointer_d(heterogeneous): no item.";
92 const unsigned int&
item)
const {
97 throw cms::Exception(
"HeterogeneousHGCalHEBConditionsWrapper") <<
"select_pointer_d(non-heterogeneous): no item.";
103 const unsigned int&
item)
const {
108 throw cms::Exception(
"HeterogeneousHGCalHEBConditionsWrapper") <<
"select_pointer_i(heterogeneous): no item.";
114 const unsigned int&
item)
const {
119 throw cms::Exception(
"HeterogeneousHGCalHEBConditionsWrapper") <<
"select_pointer_i(non-heterogeneous): no item.";
143 for (
unsigned int j = 0;
j < this->
sizes_.size() - 1; ++
j) {
148 cp::typesHEB[
j + 1] == cp::HeterogeneousHGCalHEBParametersType::Int32_t)
153 <<
"compare this functions' logic with hgcal_conditions::parameters::typesHEB";
160 cudaMemcpyHostToDevice,
170 if (
host !=
nullptr) {
HeterogeneousHGCalHEBConditionsWrapper(const HGCalParameters *)
hgcal_conditions::HeterogeneousHEBConditionsESProduct * host
~HeterogeneousHGCalHEBConditionsWrapper()
parameters::HeterogeneousHGCalHEBParameters params
std::vector< size_t > sizes_
int32_t *& select_pointer_i(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const
hgcal_conditions::HeterogeneousHEBConditionsESProduct const * getHeterogeneousConditionsESProductAsync(cudaStream_t stream) const
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
double *& select_pointer_d(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const
hgcal_conditions::HeterogeneousHEBConditionsESProduct * device
void calculate_memory_bytes(const HGCalParameters *)
const std::array< HeterogeneousHGCalHEBParametersType, 2 > typesHEB
cms::cuda::ESProduct< GPUData > gpuData_
std::vector< double > cellFineX_
cp::HeterogeneousHGCalHEBParameters params_
char data[epos_bytes_allocation]
#define cudaCheck(ARG,...)
std::vector< int > waferTypeL_