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) {
std::int32_t * waferTypeL_
hgcal_conditions::HeterogeneousHEFConditionsESProduct * host
size_t allocate_memory_params_(const std::vector< size_t > &)
const std::array< HeterogeneousHGCalHEFParametersType, 5 > typesHEF
std::vector< double > cellFineY_
Log< level::Error, false > LogError
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
int32_t *& select_pointer_i_(cpar::HeterogeneousHGCalHEFParameters *, const unsigned int &) const
std::vector< size_t > sizes_params_
hgcal_conditions::HeterogeneousHEFConditionsESProduct * device
std::vector< double > cellCoarseX_
cms::cuda::ESProduct< GPUData > gpuData_
parameters::HeterogeneousHGCalHEFParameters params
void transfer_data_to_heterogeneous_pointers_params_(const std::vector< size_t > &, const HGCalParameters *)
std::vector< size_t > calculate_memory_bytes_params_(const HGCalParameters *)
~HeterogeneousHGCalHEFConditionsWrapper()
hgcal_conditions::HeterogeneousHEFConditionsESProduct const * getHeterogeneousConditionsESProductAsync(cudaStream_t stream) const
std::vector< double > cellFineX_
char data[epos_bytes_allocation]
HeterogeneousHGCalHEFConditionsWrapper(const HGCalParameters *)
static unsigned int const shift
std::vector< double > cellCoarseY_
#define cudaCheck(ARG,...)
std::vector< int > waferTypeL_
cpar::HeterogeneousHGCalHEFParameters params_
double *& select_pointer_d_(cpar::HeterogeneousHGCalHEFParameters *, const unsigned int &) const