Skip to content

Commit

Permalink
Rename to vc_aos
Browse files Browse the repository at this point in the history
  • Loading branch information
niermann999 committed Apr 12, 2024
1 parent d4e78a6 commit 3719c7d
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 77 deletions.
8 changes: 4 additions & 4 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ if( ALGEBRA_PLUGINS_INCLUDE_VC )
target_include_directories( algebra_bench_vc_aos INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vc_aos/include>" )
target_link_libraries(algebra_bench_vc_aos INTERFACE
algebra::vc_vc
algebra::vc_aos
algebra::common_storage)
add_library( algebra::bench_vc_aos ALIAS algebra_bench_vc_aos )

algebra_add_benchmark( vc_aos_getter
"vc_aos/vc_aos_getter.cpp"
LINK_LIBRARIES benchmark::benchmark algebra::bench_common
algebra::bench_vc_aos algebra::vc_vc )
algebra::bench_vc_aos algebra::vc_aos )
algebra_add_benchmark( vc_aos_vector
"vc_aos/vc_aos_vector.cpp"
LINK_LIBRARIES benchmark::benchmark algebra::bench_common
algebra::bench_vc_aos algebra::vc_vc )
algebra::bench_vc_aos algebra::vc_aos )
algebra_add_benchmark( vc_aos_transform3
"vc_aos/vc_aos_transform3.cpp"
LINK_LIBRARIES benchmark::benchmark algebra::bench_common
algebra::bench_vc_aos algebra::vc_vc )
algebra::bench_vc_aos algebra::vc_aos )

if( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" )
add_library( algebra_bench_vc_soa INTERFACE )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

// Project include(s)
#include "algebra/vc_vc.hpp"
#include "algebra/vc_aos.hpp"

// System include(s)
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/vc_aos/vc_aos_getter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Project include(s)
#include "algebra/vc_vc.hpp"
#include "algebra/vc_aos.hpp"
#include "benchmark/common/benchmark_getter.hpp"
#include "benchmark/vc_aos/data_generator.hpp"

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/vc_aos/vc_aos_transform3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Project include(s)
#include "algebra/vc_vc.hpp"
#include "algebra/vc_aos.hpp"
#include "benchmark/common/benchmark_transform3.hpp"
#include "benchmark/vc_aos/data_generator.hpp"

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/vc_aos/vc_aos_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Project include(s)
#include "algebra/vc_vc.hpp"
#include "algebra/vc_aos.hpp"
#include "benchmark/common/benchmark_vector.hpp"
#include "benchmark/vc_aos/data_generator.hpp"

Expand Down
2 changes: 1 addition & 1 deletion frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ if( ALGEBRA_PLUGINS_INCLUDE_SMATRIX )
endif()

if( ALGEBRA_PLUGINS_INCLUDE_VC )
add_subdirectory( vc_aos )
add_subdirectory( vc_cmath )
add_subdirectory( vc_vc )
if( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" )
add_subdirectory( vc_soa )
endif()
Expand Down
12 changes: 6 additions & 6 deletions frontend/vc_vc/CMakeLists.txt → frontend/vc_aos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# Mozilla Public License Version 2.0

# Set up the library.
algebra_add_library( algebra_vc_vc vc_vc
"include/algebra/vc_vc.hpp" )
target_link_libraries( algebra_vc_vc
algebra_add_library( algebra_vc_aos vc_aos
"include/algebra/vc_aos.hpp" )
target_link_libraries( algebra_vc_aos
INTERFACE algebra::common algebra::vc_storage algebra::cmath_math
algebra::vc_math )
algebra_test_public_headers( algebra_vc_vc
"algebra/vc_vc.hpp" )
algebra::vc_aos_math )
algebra_test_public_headers( algebra_vc_aos
"algebra/vc_aos.hpp" )
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

// Project include(s).
#include "algebra/math/cmath.hpp"
#include "algebra/math/vc.hpp"
#include "algebra/storage/vc.hpp"
#include "algebra/math/vc_aos.hpp"
#include "algebra/storage/vc_aos.hpp"

// System include(s).
#include <cassert>
Expand Down Expand Up @@ -120,15 +120,4 @@ using vc::math::normalize;

} // namespace vector

namespace matrix {

using size_type = vc::size_type;

template <typename T, size_type N>
using array_type = vc::storage_type<T, N>;

template <typename T, size_type ROWS, size_type COLS>
using matrix_type = vc::matrix_type<T, ROWS, COLS>;

} // namespace matrix
} // namespace algebra
2 changes: 1 addition & 1 deletion frontend/vc_cmath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ algebra_add_library( algebra_vc_cmath vc_cmath
"include/algebra/vc_cmath.hpp" )
target_link_libraries( algebra_vc_cmath
INTERFACE algebra::common algebra::vc_storage algebra::cmath_math
algebra::vc_math )
algebra::vc_aos_math )
algebra_test_public_headers( algebra_vc_cmath
"algebra/vc_cmath.hpp" )
4 changes: 2 additions & 2 deletions frontend/vc_cmath/include/algebra/vc_cmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

// Project include(s).
#include "algebra/math/cmath.hpp"
#include "algebra/math/vc.hpp"
#include "algebra/storage/vc.hpp"
#include "algebra/math/vc_aos.hpp"
#include "algebra/storage/vc_aos.hpp"

/// @name Operators on @c algebra::vc types
/// @{
Expand Down
2 changes: 1 addition & 1 deletion math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if( ALGEBRA_PLUGINS_INCLUDE_SMATRIX )
add_subdirectory( smatrix )
endif()
if( ALGEBRA_PLUGINS_INCLUDE_VC )
add_subdirectory( vc )
add_subdirectory( vc_aos )
if( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" )
add_subdirectory( vc_soa )
endif()
Expand Down
17 changes: 0 additions & 17 deletions math/vc/CMakeLists.txt

This file was deleted.

17 changes: 17 additions & 0 deletions math/vc_aos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Algebra plugins library, part of the ACTS project (R&D line)
#
# (c) 2021-2023 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

# Set up the library.
algebra_add_library( algebra_vc_aos_math vc_aos_math
"include/algebra/math/vc_aos.hpp"
"include/algebra/math/impl/vc_aos_getter.hpp"
"include/algebra/math/impl/vc_aos_transform3.hpp"
"include/algebra/math/impl/vc_aos_vector.hpp" )
target_link_libraries( algebra_vc_aos_math
INTERFACE Vc::Vc algebra::common algebra::common_math algebra::vc_storage
algebra::cmath_math )
algebra_test_public_headers( algebra_vc_aos_math
"algebra/math/vc_aos.hpp" )
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Project include(s).
#include "algebra/math/common.hpp"
#include "algebra/math/impl/vc_vector.hpp"
#include "algebra/math/impl/vc_aos_vector.hpp"
#include "algebra/qualifiers.hpp"
#include "algebra/storage/vector.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Project include(s).
#include "algebra/math/cmath.hpp"
#include "algebra/math/impl/vc_vector.hpp"
#include "algebra/math/impl/vc_aos_vector.hpp"
#include "algebra/qualifiers.hpp"

// Vc include(s).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#pragma once

// Project include(s).
#include "algebra/math/impl/vc_getter.hpp"
#include "algebra/math/impl/vc_transform3.hpp"
#include "algebra/math/impl/vc_vector.hpp"
#include "algebra/math/impl/vc_aos_getter.hpp"
#include "algebra/math/impl/vc_aos_transform3.hpp"
#include "algebra/math/impl/vc_aos_vector.hpp"
2 changes: 1 addition & 1 deletion storage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if( ALGEBRA_PLUGINS_INCLUDE_SMATRIX )
add_subdirectory( smatrix )
endif()
if( ALGEBRA_PLUGINS_INCLUDE_VC )
add_subdirectory( vc )
add_subdirectory( vc_aos )
if( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" )
add_subdirectory( vc_soa )
endif()
Expand Down
5 changes: 2 additions & 3 deletions storage/vc/CMakeLists.txt → storage/vc_aos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

# Set up the library.
algebra_add_library( algebra_vc_storage vc_storage
"include/algebra/storage/vc.hpp"
"include/algebra/storage/impl/vc_array4_wrapper.hpp" )
"include/algebra/storage/vc_aos.hpp" )
target_link_libraries( algebra_vc_storage
INTERFACE algebra::common algebra::common_storage Vc::Vc )
algebra_test_public_headers( algebra_vc_storage
"algebra/storage/vc.hpp" )
"algebra/storage/vc_aos.hpp" )
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ if( ALGEBRA_PLUGINS_INCLUDE_SMATRIX )
endif()

if( ALGEBRA_PLUGINS_INCLUDE_VC )
algebra_add_test( vc
"vc/vc_cmath.cpp" "vc/vc_vc.cpp"
algebra_add_test( vc_aos
"vc_aos/vc_cmath.cpp" "vc_aos/vc_aos.cpp"
LINK_LIBRARIES GTest::gtest_main algebra::tests_common
algebra::vc_cmath algebra::vc_vc )
algebra::vc_cmath algebra::vc_aos )

if( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang" )
algebra_add_test( vc_soa
Expand Down
20 changes: 10 additions & 10 deletions tests/common/test_host_basics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ TYPED_TEST_P(test_host_basics_vector, local_vectors) {
ASSERT_NEAR(phi, M_PI_4, this->m_epsilon);

typename TypeParam::scalar perp = algebra::getter::perp(vD);
ASSERT_NEAR(perp, std::sqrt(2.f), this->m_epsilon);
ASSERT_NEAR(perp, std::sqrt(2.), this->m_epsilon);

typename TypeParam::scalar norm = algebra::getter::norm(vD);
ASSERT_NEAR(norm, std::sqrt(2.f), this->m_epsilon);
ASSERT_NEAR(norm, std::sqrt(2.), this->m_epsilon);

typename TypeParam::vector2 vDnorm = algebra::vector::normalize(vD);
ASSERT_NEAR(vDnorm[0], 1.f / std::sqrt(2.f), this->m_epsilon);
ASSERT_NEAR(vDnorm[1], 1.f / std::sqrt(2.f), this->m_epsilon);
ASSERT_NEAR(vDnorm[0], 1. / std::sqrt(2.), this->m_epsilon);
ASSERT_NEAR(vDnorm[1], 1. / std::sqrt(2.), this->m_epsilon);
}

// This defines the vector3 test suite
Expand Down Expand Up @@ -105,16 +105,16 @@ TYPED_TEST_P(test_host_basics_vector, vector3) {
ASSERT_NEAR(phi, M_PI_4, this->m_epsilon);

typename TypeParam::scalar theta = algebra::getter::theta(vD);
ASSERT_NEAR(theta, std::atan2(std::sqrt(2.f), 1.f), this->m_epsilon);
ASSERT_NEAR(theta, std::atan2(std::sqrt(2.), 1.), this->m_epsilon);

typename TypeParam::scalar eta = algebra::getter::eta(vD);
ASSERT_NEAR(eta, 0.65847891569137573, this->m_isclose);

typename TypeParam::scalar perp = algebra::getter::perp(vD);
ASSERT_NEAR(perp, std::sqrt(2.f), this->m_epsilon);
ASSERT_NEAR(perp, std::sqrt(2.), this->m_epsilon);

typename TypeParam::scalar norm = algebra::getter::norm(vD);
ASSERT_NEAR(norm, std::sqrt(3.f), this->m_epsilon);
ASSERT_NEAR(norm, std::sqrt(3.), this->m_epsilon);
}

// This defines the vector operation test suite
Expand All @@ -124,9 +124,9 @@ TYPED_TEST_P(test_host_basics_vector, getter) {

// Normalization
typename TypeParam::vector3 v3n = algebra::vector::normalize(v3);
ASSERT_NEAR(v3n[0], 1.f / std::sqrt(3.f), this->m_epsilon);
ASSERT_NEAR(v3n[1], 1.f / std::sqrt(3.f), this->m_epsilon);
ASSERT_NEAR(v3n[2], 1.f / std::sqrt(3.f), this->m_epsilon);
ASSERT_NEAR(v3n[0], 1. / std::sqrt(3.), this->m_epsilon);
ASSERT_NEAR(v3n[1], 1. / std::sqrt(3.), this->m_epsilon);
ASSERT_NEAR(v3n[2], 1. / std::sqrt(3.), this->m_epsilon);

// Cross product
typename TypeParam::vector3 z =
Expand Down
12 changes: 6 additions & 6 deletions tests/vc/vc_vc.cpp → tests/vc_aos/vc_aos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Project include(s).
#include "algebra/vc_vc.hpp"
#include "algebra/vc_aos.hpp"

// Test include(s).
#include "test_host_basics.hpp"
Expand All @@ -23,9 +23,9 @@ struct test_specialisation_name {
static std::string GetName(int i) {
switch (i) {
case 0:
return "vc_vc<float>";
return "vc_aos<float>";
case 1:
return "vc_vc<double>";
return "vc_aos<double>";
default:
return "unknown";
}
Expand All @@ -50,11 +50,11 @@ typedef testing::Types<
algebra::vc::vector2<double>, algebra::vc::vector3<double>,
algebra::vc::transform3<double>, std::size_t,
algebra::vc::matrix_type, double>>
vc_vc_types;
vc_aos_types;
INSTANTIATE_TYPED_TEST_SUITE_P(algebra_plugins, test_host_basics_vector,
vc_vc_types, test_specialisation_name);
vc_aos_types, test_specialisation_name);
// @TODO: Implement
/*INSTANTIATE_TYPED_TEST_SUITE_P(algebra_plugins, test_host_basics_matrix,
array_cmath_types, test_specialisation_name);*/
INSTANTIATE_TYPED_TEST_SUITE_P(algebra_plugins, test_host_basics_transform,
vc_vc_types, test_specialisation_name);
vc_aos_types, test_specialisation_name);
File renamed without changes.

0 comments on commit 3719c7d

Please sign in to comment.