@@ -40,7 +40,20 @@ full_chain_algorithm::full_chain_algorithm(
4040 m_field (make_magnetic_field(field, m_queue)),
4141 m_det_descr(det_descr),
4242 m_device_det_descr(
43- vecmem::edm::get_capacities (vecmem::get_data(m_det_descr.get())),
43+ [&]() {
44+ // number of elements in the detector design description
45+ std::vector<unsigned int > sizes (det_descr.size ());
46+ for (std::size_t i = 0 ; i < det_descr.size (); ++i) {
47+ auto this_design = det_descr.at (i);
48+ // now for each element, set the size to the largest size of
49+ // that element across all modules
50+ sizes[i] = std::max (static_cast <unsigned int >(
51+ ((this_design.bin_edges_x ()).size ())),
52+ static_cast <unsigned int >((
53+ (this_design.bin_edges_y ()).size ())));
54+ }
55+ return sizes;
56+ }(),
4457 m_cached_device_mr, &m_cached_pinned_host_mr,
4558 vecmem::data::buffer_type::resizable),
4659 m_det_cond (det_cond),
@@ -105,7 +118,21 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
105118 m_field(parent.m_field),
106119 m_det_descr(parent.m_det_descr),
107120 m_device_det_descr(
108- vecmem::edm::get_capacities (vecmem::get_data(m_det_descr.get())),
121+ [&]() {
122+ // number of elements in the detector design description
123+ std::vector<unsigned int > sizes (parent.m_det_descr .get ().size ());
124+ for (std::size_t i = 0 ; i < parent.m_det_descr .get ().size ();
125+ ++i) {
126+ auto this_design = parent.m_det_descr .get ().at (i);
127+ // now for each element, set the size to the largest size of
128+ // that element across all modules
129+ sizes[i] = std::max (static_cast <unsigned int >(
130+ ((this_design.bin_edges_x ()).size ())),
131+ static_cast <unsigned int >((
132+ (this_design.bin_edges_y ()).size ())));
133+ }
134+ return sizes;
135+ }(),
109136 m_cached_device_mr, &m_cached_pinned_host_mr,
110137 vecmem::data::buffer_type::resizable),
111138 m_det_cond (parent.m_det_cond),
0 commit comments