Skip to content

Commit 0c1b5fa

Browse files
Revert "VecMem Update, main branch (2026.04.10.) (#1291)"
This reverts commit da9ed40.
1 parent da9ed40 commit 0c1b5fa

10 files changed

Lines changed: 170 additions & 14 deletions

File tree

examples/run/alpaka/full_chain_algorithm.cpp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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),

examples/run/alpaka/seq_example_alpaka.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,18 @@ int seq_run(const traccc::opts::detector& detector_opts,
9191
traccc::detector_conditions_description::data host_det_cond_data{
9292
vecmem::get_data(host_det_cond)};
9393
traccc::detector_design_description::buffer device_det_descr{
94-
vecmem::edm::get_capacities(vecmem::get_data(host_det_descr)),
94+
[&]() {
95+
std::vector<unsigned int> sizes(host_det_descr.size());
96+
for (std::size_t i = 0; i < host_det_descr.size(); ++i) {
97+
auto this_design = host_det_descr.at(i);
98+
99+
sizes[i] = std::max(static_cast<unsigned int>(
100+
((this_design.bin_edges_x()).size())),
101+
static_cast<unsigned int>(
102+
((this_design.bin_edges_y()).size())));
103+
}
104+
return sizes;
105+
}(),
95106
device_mr, &host_mr, vecmem::data::buffer_type::resizable};
96107
copy.setup(device_det_descr)->wait();
97108
copy(vecmem::get_data(host_det_descr), device_det_descr)->wait();

examples/run/cuda/full_chain_algorithm.cpp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,20 @@ full_chain_algorithm::full_chain_algorithm(
5757
m_det_descr(det_descr),
5858
m_det_cond(det_cond),
5959
m_device_det_descr(
60-
vecmem::edm::get_capacities(vecmem::get_data(m_det_descr.get())),
60+
[&]() {
61+
// number of elements in the detector design description
62+
std::vector<unsigned int> sizes(det_descr.size());
63+
for (std::size_t i = 0; i < det_descr.size(); ++i) {
64+
auto this_design = det_descr.at(i);
65+
// now for each element, set the size to the largest size of
66+
// that element across all modules
67+
sizes[i] = std::max(static_cast<unsigned int>(
68+
((this_design.bin_edges_x()).size())),
69+
static_cast<unsigned int>((
70+
(this_design.bin_edges_y()).size())));
71+
}
72+
return sizes;
73+
}(),
6174
m_device_mr, &m_host_mr, vecmem::data::buffer_type::resizable),
6275
m_device_det_cond(
6376
static_cast<detector_conditions_description::buffer::size_type>(
@@ -124,7 +137,21 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
124137
m_det_descr(parent.m_det_descr),
125138
m_det_cond(parent.m_det_cond),
126139
m_device_det_descr(
127-
vecmem::edm::get_capacities(vecmem::get_data(m_det_descr.get())),
140+
[&]() {
141+
// number of elements in the detector design description
142+
std::vector<unsigned int> sizes(parent.m_det_descr.get().size());
143+
for (std::size_t i = 0; i < parent.m_det_descr.get().size();
144+
++i) {
145+
auto this_design = parent.m_det_descr.get().at(i);
146+
// now for each element, set the size to the largest size of
147+
// that element across all modules
148+
sizes[i] = std::max(static_cast<unsigned int>(
149+
((this_design.bin_edges_x()).size())),
150+
static_cast<unsigned int>((
151+
(this_design.bin_edges_y()).size())));
152+
}
153+
return sizes;
154+
}(),
128155
m_device_mr, &m_host_mr, vecmem::data::buffer_type::resizable),
129156
m_device_det_cond(
130157
static_cast<detector_conditions_description::buffer::size_type>(

examples/run/cuda/seq_example_cuda.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,20 @@ int seq_run(const traccc::opts::detector& detector_opts,
102102
traccc::detector_conditions_description::data host_det_cond_data{
103103
vecmem::get_data(host_det_cond)};
104104
traccc::detector_design_description::buffer device_det_descr{
105-
vecmem::edm::get_capacities(vecmem::get_data(host_det_descr)),
105+
[&]() {
106+
// number of elements in the detector design description
107+
std::vector<unsigned int> sizes(host_det_descr.size());
108+
for (std::size_t i = 0; i < host_det_descr.size(); ++i) {
109+
auto this_design = host_det_descr.at(i);
110+
// now for each element, set the size to the largest size of
111+
// that element across all modules
112+
sizes[i] = std::max(static_cast<unsigned int>(
113+
((this_design.bin_edges_x()).size())),
114+
static_cast<unsigned int>(
115+
((this_design.bin_edges_y()).size())));
116+
}
117+
return sizes;
118+
}(),
106119
device_mr, &host_mr, vecmem::data::buffer_type::resizable};
107120
copy.setup(device_det_descr)->wait();
108121
copy(host_det_descr_data, device_det_descr)->wait();

examples/run/sycl/full_chain_algorithm.cpp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,20 @@ full_chain_algorithm::full_chain_algorithm(
4949
m_det_descr(det_descr),
5050
m_det_cond(det_cond),
5151
m_device_det_descr(
52-
vecmem::edm::get_capacities(vecmem::get_data(m_det_descr.get())),
52+
[&]() {
53+
// number of elements in the detector design description
54+
std::vector<unsigned int> sizes(det_descr.size());
55+
for (std::size_t i = 0; i < det_descr.size(); ++i) {
56+
auto this_design = det_descr.at(i);
57+
// now for each element, set the size to the largest size of
58+
// that element across all modules
59+
sizes[i] = std::max(static_cast<unsigned int>(
60+
((this_design.bin_edges_x()).size())),
61+
static_cast<unsigned int>((
62+
(this_design.bin_edges_y()).size())));
63+
}
64+
return sizes;
65+
}(),
5366
m_cached_device_mr, &m_cached_pinned_host_mr,
5467
vecmem::data::buffer_type::resizable),
5568
m_device_det_cond(
@@ -126,7 +139,21 @@ full_chain_algorithm::full_chain_algorithm(const full_chain_algorithm& parent)
126139
m_det_descr(parent.m_det_descr),
127140
m_det_cond(parent.m_det_cond),
128141
m_device_det_descr(
129-
vecmem::edm::get_capacities(vecmem::get_data(m_det_descr.get())),
142+
[&]() {
143+
// number of elements in the detector design description
144+
std::vector<unsigned int> sizes(parent.m_det_descr.get().size());
145+
for (std::size_t i = 0; i < parent.m_det_descr.get().size();
146+
++i) {
147+
auto this_design = parent.m_det_descr.get().at(i);
148+
// now for each element, set the size to the largest size of
149+
// that element across all modules
150+
sizes[i] = std::max(static_cast<unsigned int>(
151+
((this_design.bin_edges_x()).size())),
152+
static_cast<unsigned int>((
153+
(this_design.bin_edges_y()).size())));
154+
}
155+
return sizes;
156+
}(),
130157
m_cached_device_mr, &m_cached_pinned_host_mr,
131158
vecmem::data::buffer_type::resizable),
132159
m_device_det_cond(

examples/run/sycl/seq_example_sycl.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,20 @@ int seq_run(const traccc::opts::detector& detector_opts,
106106
traccc::detector_conditions_description::data host_det_cond_data{
107107
vecmem::get_data(host_det_cond)};
108108
traccc::detector_design_description::buffer device_det_descr{
109-
vecmem::edm::get_capacities(vecmem::get_data(host_det_descr)),
109+
[&]() {
110+
// number of elements in the detector design description
111+
std::vector<unsigned int> sizes(host_det_descr.size());
112+
for (std::size_t i = 0; i < host_det_descr.size(); ++i) {
113+
auto this_design = host_det_descr.at(i);
114+
// now for each element, set the size to the largest size of
115+
// that element across all modules
116+
sizes[i] = std::max(static_cast<unsigned int>(
117+
((this_design.bin_edges_x()).size())),
118+
static_cast<unsigned int>(
119+
((this_design.bin_edges_y()).size())));
120+
}
121+
return sizes;
122+
}(),
110123
device_mr, &host_mr, vecmem::data::buffer_type::resizable};
111124
copy.setup(device_det_descr)->wait();
112125
copy(host_det_descr_data, device_det_descr)->wait();

extern/vecmem/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ message( STATUS "Building VecMem as part of the TRACCC project" )
1313

1414
# Declare where to get VecMem from.
1515
set( TRACCC_VECMEM_SOURCE
16-
"URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.24.0.tar.gz;URL_MD5;4ca66bf822528e0880581ad107efa911"
16+
"URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.23.0.tar.gz;URL_MD5;c4b87f88856b5273b89373d880bdc0fd"
1717
CACHE STRING "Source for VecMem, when built as part of this project" )
1818
mark_as_advanced( TRACCC_VECMEM_SOURCE )
1919
FetchContent_Declare( VecMem SYSTEM ${TRACCC_VECMEM_SOURCE} )

tests/alpaka/test_cca.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,19 @@ cca_function_t get_f_with(traccc::clustering_config cfg) {
5555
{device_mr, &pinned_host_mr}, copy, queue, cfg);
5656

5757
traccc::detector_design_description::buffer det_desc_buffer{
58-
vecmem::edm::get_capacities(vecmem::get_data(det_desc)),
58+
[&]() {
59+
std::vector<unsigned int> sizes(det_desc.size());
60+
for (std::size_t i = 0; i < det_desc.size(); ++i) {
61+
auto this_design = det_desc.at(i);
62+
63+
sizes[i] =
64+
std::max(static_cast<unsigned int>(
65+
((this_design.bin_edges_x()).size())),
66+
static_cast<unsigned int>(
67+
((this_design.bin_edges_y()).size())));
68+
}
69+
return sizes;
70+
}(),
5971
device_mr, &host_mr, vecmem::data::buffer_type::resizable};
6072
copy.setup(det_desc_buffer)->wait();
6173
copy(vecmem::get_data(det_desc), det_desc_buffer)->wait();

tests/cuda/test_cca.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,21 @@ cca_function_t get_f_with(traccc::clustering_config cfg) {
4040
stream, cfg);
4141

4242
traccc::detector_design_description::buffer det_descr_buffer{
43-
vecmem::edm::get_capacities(vecmem::get_data(det_desc)), device_mr,
44-
&host_mr, vecmem::data::buffer_type::fixed_size};
43+
[&]() {
44+
std::vector<unsigned int> sizes(det_desc.size());
45+
for (std::size_t i = 0; i < det_desc.size(); ++i) {
46+
auto this_design = det_desc.at(i);
47+
// now for each element, set the size to the largest size of
48+
// that element across all modules
49+
sizes[i] =
50+
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+
}(),
57+
device_mr, &host_mr, vecmem::data::buffer_type::fixed_size};
4558
copy.setup(det_descr_buffer)->wait();
4659
copy(vecmem::get_data(det_desc), det_descr_buffer)->wait();
4760
traccc::detector_conditions_description::buffer det_cond_buffer{

tests/sycl/test_cca.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,20 @@ cca_function_t get_f_with(traccc::clustering_config cfg) {
4949
copy, traccc_queue, cfg);
5050

5151
traccc::detector_design_description::buffer det_descr_buffer{
52-
vecmem::edm::get_capacities(vecmem::get_data(det_desc)),
52+
[&]() {
53+
std::vector<unsigned int> sizes(det_desc.size());
54+
for (std::size_t i = 0; i < det_desc.size(); ++i) {
55+
auto this_design = det_desc.at(i);
56+
// now for each element, set the size to the largest
57+
// size of that element across all modules
58+
sizes[i] =
59+
std::max(static_cast<unsigned int>(
60+
((this_design.bin_edges_x()).size())),
61+
static_cast<unsigned int>(
62+
((this_design.bin_edges_y()).size())));
63+
}
64+
return sizes;
65+
}(),
5366
device_mr, &host_mr, vecmem::data::buffer_type::fixed_size};
5467
copy.setup(det_descr_buffer)->wait();
5568
copy(vecmem::get_data(det_desc), det_descr_buffer)->wait();

0 commit comments

Comments
 (0)