@@ -40,20 +40,7 @@ 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- [&]() {
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- }(),
43+ vecmem::edm::get_capacities (vecmem::get_data(m_det_descr.get())),
5744 m_cached_device_mr, &m_cached_pinned_host_mr,
5845 vecmem::data::buffer_type::resizable),
5946 m_det_cond(det_cond),
@@ -118,21 +105,7 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
118105 m_field(parent.m_field),
119106 m_det_descr(parent.m_det_descr),
120107 m_device_det_descr(
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- }(),
108+ vecmem::edm::get_capacities (vecmem::get_data(m_det_descr.get())),
136109 m_cached_device_mr, &m_cached_pinned_host_mr,
137110 vecmem::data::buffer_type::resizable),
138111 m_det_cond(parent.m_det_cond),
0 commit comments