diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 9a8804d674..dfeb5ac0b5 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -98,6 +98,14 @@ if(DETRAY_VC_SOA_PLUGIN) ) endif() +if(DETRAY_FASTOR_PLUGIN) + detray_add_library( detray_core_fastor core_fastor ) + target_link_libraries( + detray_core_fastor + INTERFACE detray::core detray::algebra_fastor + ) +endif() + # Test the public headers of the detray core libraries. if(BUILD_TESTING AND DETRAY_BUILD_TESTING) string( diff --git a/core/include/detray/definitions/algebra.hpp b/core/include/detray/definitions/algebra.hpp index bcc7cd2ab9..ad1eb2f946 100644 --- a/core/include/detray/definitions/algebra.hpp +++ b/core/include/detray/definitions/algebra.hpp @@ -17,6 +17,8 @@ #include "detray/plugins/algebra/vc_aos_definitions.hpp" #elif DETRAY_ALGEBRA_VC_SOA #include "detray/plugins/algebra/vc_soa_definitions.hpp" +#elif DETRAY_ALGEBRA_FASTOR +#include "detray/plugins/algebra/fastor_definitions.hpp" #else #error "No algebra plugin selected! Please link to one of the algebra plugins." #endif diff --git a/core/include/detray/navigation/navigator.hpp b/core/include/detray/navigation/navigator.hpp index f9413a0908..c32c3762b6 100644 --- a/core/include/detray/navigation/navigator.hpp +++ b/core/include/detray/navigation/navigator.hpp @@ -739,8 +739,8 @@ class navigator { init(track, navigation, cfg, ctx); is_init = true; - // Fresh initialization, reset trust and hearbeat even though we are - // on inner portal + // Fresh initialization, reset trust and heartbeat even though we + // are on inner portal navigation.m_trust_level = navigation::trust_level::e_full; navigation.m_heartbeat = true; } diff --git a/plugins/algebra/CMakeLists.txt b/plugins/algebra/CMakeLists.txt index 3a025e43e3..8eb1a057cf 100644 --- a/plugins/algebra/CMakeLists.txt +++ b/plugins/algebra/CMakeLists.txt @@ -25,3 +25,6 @@ endif() if(DETRAY_VC_SOA_PLUGIN) add_subdirectory(vc_soa) endif() +if(DETRAY_FASTOR_PLUGIN) + add_subdirectory(fastor) +endif() diff --git a/plugins/algebra/fastor/CMakeLists.txt b/plugins/algebra/fastor/CMakeLists.txt new file mode 100644 index 0000000000..0b792ca1eb --- /dev/null +++ b/plugins/algebra/fastor/CMakeLists.txt @@ -0,0 +1,36 @@ +# Detray library, part of the ACTS project (R&D line) +# +# (c) 2025 CERN for the benefit of the ACTS project +# +# Mozilla Public License Version 2.0 + +message(STATUS "Building the 'detray::algebra_fastor' plugin") + +# A sanity check. +if(NOT ALGEBRA_PLUGINS_INCLUDE_FASTOR) + message( + WARNING + "Fastor not available from Algebra Plugins. " + "The configuration will likely fail." + ) +endif() + +# Set up the library. +detray_add_library( detray_algebra_fastor algebra_fastor + "include/detray/plugins/algebra/fastor_definitions.hpp" +) +target_link_libraries( + detray_algebra_fastor + INTERFACE algebra::utils algebra::fastor_fastor vecmem::core +) +target_compile_definitions( + detray_algebra_fastor + INTERFACE + DETRAY_CUSTOM_SCALARTYPE=${DETRAY_CUSTOM_SCALARTYPE} + DETRAY_ALGEBRA_FASTOR +) + +# Set up tests for the public header(s) of detray::algebra_fastor. +detray_test_public_headers( detray_algebra_fastor + "detray/plugins/algebra/fastor_definitions.hpp" +) diff --git a/plugins/algebra/fastor/include/detray/plugins/algebra/fastor_definitions.hpp b/plugins/algebra/fastor/include/detray/plugins/algebra/fastor_definitions.hpp new file mode 100644 index 0000000000..a891707715 --- /dev/null +++ b/plugins/algebra/fastor/include/detray/plugins/algebra/fastor_definitions.hpp @@ -0,0 +1,54 @@ +/** Detray library, part of the ACTS project (R&D line) + * + * (c) 2023-2025 CERN for the benefit of the ACTS project + * + * Mozilla Public License Version 2.0 + */ + +#pragma once + +// Algebra-Plugins include +#include "algebra/fastor_fastor.hpp" + +namespace detray { + +/// The plugin definition +template +using fastor = algebra::plugin::fastor; + +namespace getter { + +using algebra::fastor::storage::block; +using algebra::fastor::storage::element; +using algebra::fastor::storage::set_block; +using algebra::fastor::storage::vector; + +} // namespace getter + +namespace vector { + +using algebra::fastor::math::cross; +using algebra::fastor::math::dot; +using algebra::fastor::math::eta; +using algebra::fastor::math::norm; +using algebra::fastor::math::normalize; + +using algebra::fastor::math::perp; +using algebra::fastor::math::phi; +using algebra::fastor::math::theta; + +} // namespace vector + +namespace matrix { + +using algebra::fastor::math::determinant; +using algebra::fastor::math::identity; +using algebra::fastor::math::inverse; +using algebra::fastor::math::set_identity; +using algebra::fastor::math::set_zero; +using algebra::fastor::math::transpose; +using algebra::fastor::math::zero; + +} // namespace matrix + +} // namespace detray diff --git a/tests/benchmarks/cpu/CMakeLists.txt b/tests/benchmarks/cpu/CMakeLists.txt index c72bb07244..7bd98ed2fc 100644 --- a/tests/benchmarks/cpu/CMakeLists.txt +++ b/tests/benchmarks/cpu/CMakeLists.txt @@ -125,3 +125,8 @@ if(DETRAY_VC_SOA_PLUGIN) # detray_add_soa_benchmark( eigen ) # detray_add_soa_benchmark( vc_aos ) endif() + +# Build the Fastor benchmark executable. +if(DETRAY_FASTOR_PLUGIN) + detray_add_cpu_benchmark( fastor ) +endif()