Skip to content

Commit

Permalink
Remove Deprecated Types, main branch (2024.11.08.) (#304)
Browse files Browse the repository at this point in the history
* Removed the deprecated const_device_array and const_device_vector types.

* Removed const_device_array and const_device_vector from the tests.
  • Loading branch information
krasznaa authored Nov 19, 2024
1 parent 444703b commit 4dd69d3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 65 deletions.
2 changes: 0 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ vecmem_add_library( vecmem_core core
# STL mimicking containers.
"include/vecmem/containers/array.hpp"
"include/vecmem/containers/impl/array.ipp"
"include/vecmem/containers/const_device_array.hpp"
"include/vecmem/containers/const_device_vector.hpp"
"include/vecmem/containers/device_array.hpp"
"include/vecmem/containers/impl/device_array.ipp"
"include/vecmem/containers/device_vector.hpp"
Expand Down
18 changes: 0 additions & 18 deletions core/include/vecmem/containers/const_device_array.hpp

This file was deleted.

18 changes: 0 additions & 18 deletions core/include/vecmem/containers/const_device_vector.hpp

This file was deleted.

16 changes: 7 additions & 9 deletions tests/core/test_core_containers.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/* VecMem project, part of the ACTS project (R&D line)
*
* (c) 2021-2023 CERN for the benefit of the ACTS project
* (c) 2021-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/

// Local include(s).
#include "vecmem/containers/array.hpp"
#include "vecmem/containers/const_device_array.hpp"
#include "vecmem/containers/const_device_vector.hpp"
#include "vecmem/containers/device_array.hpp"
#include "vecmem/containers/device_vector.hpp"
#include "vecmem/containers/static_array.hpp"
Expand Down Expand Up @@ -38,7 +36,7 @@ class core_container_test : public testing::Test {
/// Test(s) for @c vecmem::const_device_vector
TEST_F(core_container_test, const_device_vector) {

const vecmem::const_device_vector<int> test_vector(
const vecmem::device_vector<const int> test_vector(
vecmem::get_data(m_reference_vector));
EXPECT_EQ(test_vector.size(), m_reference_vector.size());
EXPECT_EQ(test_vector.empty(), m_reference_vector.empty());
Expand All @@ -47,8 +45,8 @@ TEST_F(core_container_test, const_device_vector) {
EXPECT_EQ(std::accumulate(test_vector.begin(), test_vector.end(), 0),
std::accumulate(test_vector.rbegin(), test_vector.rend(), 0));
for (std::size_t i = 0; i < m_reference_vector.size(); ++i) {
const vecmem::const_device_vector<int>::size_type ii =
static_cast<vecmem::const_device_vector<int>::size_type>(i);
const vecmem::device_vector<const int>::size_type ii =
static_cast<vecmem::device_vector<const int>::size_type>(i);
EXPECT_EQ(test_vector.at(ii), m_reference_vector.at(i));
EXPECT_EQ(test_vector[ii], m_reference_vector[i]);
}
Expand All @@ -66,8 +64,8 @@ TEST_F(core_container_test, device_vector) {
EXPECT_EQ(std::accumulate(test_vector.begin(), test_vector.end(), 0),
std::accumulate(test_vector.rbegin(), test_vector.rend(), 0));
for (std::size_t i = 0; i < m_reference_vector.size(); ++i) {
const vecmem::const_device_vector<int>::size_type ii =
static_cast<vecmem::const_device_vector<int>::size_type>(i);
const vecmem::device_vector<int>::size_type ii =
static_cast<vecmem::device_vector<int>::size_type>(i);
EXPECT_EQ(test_vector.at(ii), m_reference_vector.at(i));
EXPECT_EQ(test_vector[ii], m_reference_vector[i]);
}
Expand Down Expand Up @@ -97,7 +95,7 @@ TEST_F(core_container_test, array) {
/// Test(s) for @c vecmem::const_device_array
TEST_F(core_container_test, const_device_array) {

const vecmem::const_device_array<int, 9> test_array(
const vecmem::device_array<const int, 9> test_array(
vecmem::get_data(m_reference_vector));
EXPECT_EQ(test_array.size(), m_reference_vector.size());
EXPECT_EQ(test_array.empty(), m_reference_vector.empty());
Expand Down
11 changes: 5 additions & 6 deletions tests/cuda/test_cuda_containers_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* VecMem project, part of the ACTS project (R&D line)
*
* (c) 2021-2023 CERN for the benefit of the ACTS project
* (c) 2021-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand All @@ -9,8 +9,7 @@
#include "../../cuda/src/utils/cuda_error_handling.hpp"
#include "../../cuda/src/utils/cuda_wrappers.hpp"
#include "test_cuda_containers_kernels.cuh"
#include "vecmem/containers/const_device_array.hpp"
#include "vecmem/containers/const_device_vector.hpp"
#include "vecmem/containers/device_array.hpp"
#include "vecmem/containers/device_vector.hpp"
#include "vecmem/containers/jagged_device_vector.hpp"
#include "vecmem/containers/static_array.hpp"
Expand All @@ -34,12 +33,12 @@ __global__ void linearTransformKernel(
}

// Create the helper containers.
const vecmem::const_device_array<int, 2> constantarray1(constants);
const vecmem::device_array<const int, 2> constantarray1(constants);
const vecmem::static_array<int, 2> constantarray2 = {constantarray1[0],
constantarray1[1]};
auto tuple1 = vecmem::make_tuple(constantarray1[0], constantarray1[1]);
auto tuple2 = vecmem::tie(constantarray1, constantarray2);
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);

// Perform the linear transformation.
Expand Down Expand Up @@ -166,7 +165,7 @@ __global__ void filterTransformKernel(
}
// Set up the vector objects.
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);
// Add this thread's element, if it passes the selection.
Expand Down
9 changes: 4 additions & 5 deletions tests/hip/test_hip_containers_kernels.hip
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// Local include(s).
#include "../../hip/src/utils/hip_error_handling.hpp"
#include "test_hip_containers_kernels.hpp"
#include "vecmem/containers/const_device_array.hpp"
#include "vecmem/containers/const_device_vector.hpp"
#include "vecmem/containers/device_array.hpp"
#include "vecmem/containers/device_vector.hpp"
#include "vecmem/containers/jagged_device_vector.hpp"
#include "vecmem/containers/static_array.hpp"
Expand All @@ -33,12 +32,12 @@ __global__ void linearTransformKernel(
}

// Create the helper containers.
const vecmem::const_device_array<int, 2> constantarray1(constants);
const vecmem::device_array<const int, 2> constantarray1(constants);
const vecmem::static_array<int, 2> constantarray2 = {constantarray1[0],
constantarray1[1]};
auto tuple1 = vecmem::make_tuple(constantarray1[0], constantarray1[1]);
auto tuple2 = vecmem::tie(constantarray1, constantarray2);
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);

// Perform the linear transformation.
Expand Down Expand Up @@ -211,7 +210,7 @@ __global__ void filterTransformKernel(
}

// Set up the vector objects.
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);

// Add this thread's element, if it passes the selection.
Expand Down
13 changes: 6 additions & 7 deletions tests/sycl/test_sycl_containers.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

// Local include(s).
#include "vecmem/containers/array.hpp"
#include "vecmem/containers/const_device_array.hpp"
#include "vecmem/containers/const_device_vector.hpp"
#include "vecmem/containers/data/jagged_vector_buffer.hpp"
#include "vecmem/containers/device_array.hpp"
#include "vecmem/containers/device_vector.hpp"
#include "vecmem/containers/jagged_device_vector.hpp"
#include "vecmem/containers/static_array.hpp"
Expand Down Expand Up @@ -70,14 +69,14 @@ TEST_F(sycl_containers_test, shared_memory) {
}

// Create the helper containers.
const vecmem::const_device_array<int, 2> constantarray1(
const vecmem::device_array<const int, 2> constantarray1(
constants);
const vecmem::static_array<int, 2> constantarray2 = {
constantarray1[0], constantarray1[1]};
auto tuple1 = vecmem::make_tuple(constantarray1[0],
constantarray1[1]);
auto tuple2 = vecmem::tie(constantarray1, constantarray2);
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);

// Perform the linear transformation.
Expand Down Expand Up @@ -155,9 +154,9 @@ TEST_F(sycl_containers_test, device_memory) {
}

// Create the helper containers.
const vecmem::const_device_array<int, 2> constantarray(
const vecmem::device_array<const int, 2> constantarray(
constants);
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);

// Perform the linear transformation.
Expand Down Expand Up @@ -423,7 +422,7 @@ TEST_F(sycl_containers_test, extendable_memory) {
}

// Set up the vector objects.
const vecmem::const_device_vector<int> inputvec(input);
const vecmem::device_vector<const int> inputvec(input);
vecmem::device_vector<int> outputvec(output);

// Add this thread's element, if it passes the selection.
Expand Down

0 comments on commit 4dd69d3

Please sign in to comment.