From 19453e29ad75e0436b201f569d2ef7a937101675 Mon Sep 17 00:00:00 2001 From: Joana Niermann Date: Tue, 12 Nov 2024 11:16:31 +0100 Subject: [PATCH] Update github actions and switch to newer containers --- .github/ci_setup.sh | 7 +++-- .github/workflows/builds.yml | 32 ++++++++++++++-------- .github/workflows/checks.yml | 6 ++-- CMakeLists.txt | 12 +++++--- frontend/vc_aos/include/algebra/vc_aos.hpp | 30 ++++++++++---------- 5 files changed, 50 insertions(+), 37 deletions(-) diff --git a/.github/ci_setup.sh b/.github/ci_setup.sh index 8ae9bd12..600a6d14 100644 --- a/.github/ci_setup.sh +++ b/.github/ci_setup.sh @@ -15,11 +15,14 @@ PLATFORM_NAME=$1 # Set up the correct environment for the SYCL tests. if [ "${PLATFORM_NAME}" = "SYCL" ]; then - source /opt/intel/oneapi/setvars.sh --include-intel-llvm + if [ -f "/opt/intel/oneapi/setvars.sh" ]; then + source /opt/intel/oneapi/setvars.sh --include-intel-llvm + fi # Use clang/clang++ instead of icx/icpx, to avoid some aggressive math # optimizations that break some tests. export CC=`which clang` export CXX=`which clang++` export SYCLCXX="${CXX} -fsycl" - export SYCL_DEVICE_FILTER=host + export ONEAPI_DEVICE_SELECTOR=opencl:cpu + export SYCLFLAGS="-fsycl" fi diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 33fca5cf..6fc85472 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -1,6 +1,6 @@ # Algebra plugins library, 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 @@ -37,7 +37,7 @@ jobs: # The build/test steps to execute. steps: # Use a standard checkout of the code. - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Run the CMake configuration. - name: Configure run: cmake --preset default-x86-64 @@ -62,28 +62,36 @@ jobs: BUILD_TYPE: ["Release", "Debug"] PLATFORM: - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset eigen -DALGEBRA_PLUGINS_USE_SYSTEM_EIGEN3=TRUE - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset eigen - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: -DALGEBRA_PLUGINS_INCLUDE_SMATRIX=TRUE - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset vc - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset vecmem - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset fastor - NAME: "CUDA" - CONTAINER: "ghcr.io/acts-project/ubuntu2004_cuda:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404_cuda:67" OPTIONS: --preset cuda - NAME: "SYCL" - CONTAINER: "ghcr.io/acts-project/ubuntu2004_oneapi:v43" + CXX_STANDARD: "20" + CONTAINER: "ghcr.io/acts-project/ubuntu2404_oneapi:56" OPTIONS: --preset sycl # The system to run on. @@ -98,12 +106,12 @@ jobs: # The build/test steps to execute. steps: # Use a standard checkout of the code. - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Run the CMake configuration. - name: Configure run: | source ${GITHUB_WORKSPACE}/.github/ci_setup.sh ${{ matrix.PLATFORM.NAME }} - cmake ${{ matrix.PLATFORM.OPTIONS }} -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -S ${GITHUB_WORKSPACE} -B build + cmake ${{ matrix.PLATFORM.OPTIONS }} -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DCMAKE_CXX_STANDARD=${{ matrix.PLATFORM.CXX_STANDARD }} -DCMAKE_CUDA_STANDARD=${{ matrix.PLATFORM.CXX_STANDARD }} -DCMAKE_SYCL_STANDARD=${{ matrix.PLATFORM.CXX_STANDARD }} -S ${GITHUB_WORKSPACE} -B build # Perform the build. - name: Build run: | diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ae66b7f7..77259ec1 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,6 +1,6 @@ # Algebra plugins library, part of the ACTS project (R&D line) # -# (c) 2021-2022 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 @@ -18,10 +18,10 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/acts-project/format10:v11 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Check run: .github/check_format.sh . - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: failure() with: name: changed diff --git a/CMakeLists.txt b/CMakeLists.txt index aec987e6..1c9c8e23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Algebra plugins library, 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 @@ -9,11 +9,15 @@ cmake_minimum_required( VERSION 3.14 ) project( algebra-plugins VERSION 0.23 LANGUAGES CXX ) # Set up the used C++ standard. -set( CMAKE_CXX_STANDARD 17 CACHE STRING "The (host) C++ standard to use" ) +set( CMAKE_CXX_STANDARD 20 CACHE STRING "The (host) C++ standard to use" ) set( CMAKE_CXX_EXTENSIONS FALSE CACHE BOOL "Disable (host) C++ extensions" ) -set( CMAKE_CUDA_STANDARD 17 CACHE STRING "The (CUDA) C++ standard to use" ) +set( CMAKE_CUDA_STANDARD 20 CACHE STRING "The (CUDA) C++ standard to use" ) set( CMAKE_CUDA_EXTENSIONS FALSE CACHE BOOL "Disable (CUDA) C++ extensions" ) -set( CMAKE_SYCL_STANDARD 17 CACHE STRING "The (SYCL) C++ standard to use" ) +set( CMAKE_SYCL_STANDARD 20 CACHE STRING "The (SYCL) C++ standard to use" ) + +if(${CMAKE_CXX_STANDARD} LESS 20) + message(SEND_ERROR "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}, but algebra-plugins requires C++>=20") +endif() # Standard CMake include(s). include( CTest ) diff --git a/frontend/vc_aos/include/algebra/vc_aos.hpp b/frontend/vc_aos/include/algebra/vc_aos.hpp index a32c3926..1687decb 100644 --- a/frontend/vc_aos/include/algebra/vc_aos.hpp +++ b/frontend/vc_aos/include/algebra/vc_aos.hpp @@ -49,16 +49,15 @@ using cmath::element; /// Function extracting a slice from matrix44 - const template class array_t, - typename value_t, std::size_t N, - std::enable_if_t = true> -ALGEBRA_HOST_DEVICE inline const auto& vector( - const storage::matrix44& m, - std::size_t + typename value_t, std::size_t N> +requires(SIZE <= 4) ALGEBRA_HOST_DEVICE inline const + auto& vector(const storage::matrix44& m, + std::size_t #ifndef NDEBUG - row + row #endif // not NDEBUG - , - std::size_t col) { + , + std::size_t col) { assert(row == 0); assert(col < 4); @@ -82,16 +81,15 @@ ALGEBRA_HOST_DEVICE inline const auto& vector( /// Function extracting a slice from matrix44 - non-const template class array_t, - typename value_t, std::size_t N, - std::enable_if_t = true> -ALGEBRA_HOST_DEVICE inline auto& vector( - storage::matrix44& m, - std::size_t + typename value_t, std::size_t N> +requires(SIZE <= 4) ALGEBRA_HOST_DEVICE + inline auto& vector(storage::matrix44& m, + std::size_t #ifndef NDEBUG - row + row #endif // not NDEBUG - , - std::size_t col) { + , + std::size_t col) { assert(row == 0); assert(col < 4);