12 size_t chunk_ = std::accumulate(sz.begin(), sz.end(), 0);
20 std::vector<size_t> cumsum_sizes(sz.size() + 1, 0);
21 std::partial_sum(sz.begin(), sz.end(), cumsum_sizes.begin() + 1);
22 for (
unsigned int i = 1;
i < cumsum_sizes.size(); ++
i)
24 size_t typesHEFsize = 0;
26 typesHEFsize =
sizeof(double);
27 else if (
cpar::typesHEF[
i - 1] == cpar::HeterogeneousHGCalHEFParametersType::Int32_t)
28 typesHEFsize =
sizeof(int32_t);
30 throw cms::Exception(
"HeterogeneousHGCalHEFConditionsWrapper") <<
"Wrong HeterogeneousHGCalParameters type";
31 cumsum_sizes[
i] /= typesHEFsize;
34 for (
unsigned int j = 0;
j < sz.size(); ++
j) {
37 const unsigned int jm1 =
j - 1;
38 const size_t shift = cumsum_sizes[
j] - cumsum_sizes[jm1];
43 cpar::typesHEF[
j] == cpar::HeterogeneousHGCalHEFParametersType::Int32_t)
49 for (
unsigned int i = cumsum_sizes[
j];
i < cumsum_sizes[
j + 1]; ++
i) {
50 unsigned int index =
i - cumsum_sizes[
j];
53 }
else if (
cpar::typesHEF[
j] == cpar::HeterogeneousHGCalHEFParametersType::Int32_t) {
56 throw cms::Exception(
"HeterogeneousHGCalHEFConditionsWrapper") <<
"Wrong HeterogeneousHGCalParameters type";
64 std::vector<size_t> sizes(npointers);
65 for (
unsigned int i = 0;
i < npointers; ++
i) {
72 std::vector<size_t> sizes_units(npointers);
73 for (
unsigned int i = 0;
i < npointers; ++
i) {
75 sizes_units[
i] =
sizeof(double);
76 else if (
cpar::typesHEF[
i] == cpar::HeterogeneousHGCalHEFParametersType::Int32_t)
77 sizes_units[
i] =
sizeof(int32_t);
83 sizes.begin(), sizes.end(), sizes_units.begin(), this->
sizes_params_.begin(), std::multiplies<size_t>());
94 const unsigned int&
item)
const {
105 edm::LogError(
"HeterogeneousHGCalHEFConditionsWrapper") <<
"select_pointer_d(heterogeneous): no item.";
111 const unsigned int&
item)
const {
122 edm::LogError(
"HeterogeneousHGCalHEFConditionsWrapper") <<
"select_pointer_d(non-heterogeneous): no item.";
128 const unsigned int&
item)
const {
133 edm::LogError(
"HeterogeneousHGCalHEFConditionsWrapper") <<
"select_pointer_i(heterogeneous): no item.";
139 const unsigned int&
item)
const {
144 edm::LogError(
"HeterogeneousHGCalHEFConditionsWrapper") <<
"select_pointer_i(non-heterogeneous): no item.";
166 size_t sdouble =
sizeof(double);
173 cpar::typesHEF[
j + 1] == cpar::HeterogeneousHGCalHEFParametersType::Int32_t)
178 <<
"compare this functions' logic with hgcal_conditions::parameters::typesHEF";
191 cudaMemcpyHostToDevice,
201 if (
host !=
nullptr) {