From ab97d2fd73506b3cb884d7191375081d672a45ca 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. This PR is mainly meant to switch on c++20 for algebra-plugins. Due to a bug in the oneAPI compiler, several of the SYCL tests had to be disabled. Furthermore, the Vc test had to be disabled for MSVC due to compilation issues in Vc itself. --- .github/ci_setup.sh | 9 +++-- .github/workflows/builds.yml | 41 +++++++++++++++------- .github/workflows/checks.yml | 11 ++++-- CMakeLists.txt | 12 ++++--- CMakePresets.json | 3 +- extern/vecmem/CMakeLists.txt | 2 +- frontend/vc_aos/include/algebra/vc_aos.hpp | 30 ++++++++-------- 7 files changed, 67 insertions(+), 41 deletions(-) diff --git a/.github/ci_setup.sh b/.github/ci_setup.sh index 8ae9bd12..220aefd4 100644 --- a/.github/ci_setup.sh +++ b/.github/ci_setup.sh @@ -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 # @@ -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 -fsycl-targets=spir64" fi diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 33fca5cf..8799380e 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 @@ -13,6 +13,11 @@ on: - main - 'release/**' +# Cancel existing jobs on new pushes. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + # All the different build/test jobs. jobs: @@ -37,11 +42,13 @@ 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 -DALGEBRA_PLUGINS_INCLUDE_FASTOR=${{ (matrix.PLATFORM.OS == 'macos-latest') && 'OFF' || 'ON' }} + -DALGEBRA_PLUGINS_INCLUDE_VC=${{ (matrix.PLATFORM.OS == 'windows-latest') && 'OFF' || 'ON' }} + -DALGEBRA_PLUGINS_SETUP_VC=${{ (matrix.PLATFORM.OS == 'windows-latest') && 'OFF' || 'ON' }} -S ${{ github.workspace }} -B build -G "${{ matrix.PLATFORM.GENERATOR }}" # Perform the build. @@ -62,29 +69,37 @@ jobs: BUILD_TYPE: ["Release", "Debug"] PLATFORM: - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset eigen -DALGEBRA_PLUGINS_USE_SYSTEM_EIGEN3=TRUE + RUN_TESTS: true - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset eigen + RUN_TESTS: true - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: -DALGEBRA_PLUGINS_INCLUDE_SMATRIX=TRUE + RUN_TESTS: true - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset vc + RUN_TESTS: true - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset vecmem + RUN_TESTS: true - NAME: "HOST" - CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404:56" OPTIONS: --preset fastor + RUN_TESTS: true - NAME: "CUDA" - CONTAINER: "ghcr.io/acts-project/ubuntu2004_cuda:v43" + CONTAINER: "ghcr.io/acts-project/ubuntu2404_cuda:67" OPTIONS: --preset cuda - - NAME: "SYCL" - CONTAINER: "ghcr.io/acts-project/ubuntu2004_oneapi:v43" + RUN_TESTS: false + - NAME: "SYCL HOST" + CONTAINER: "ghcr.io/acts-project/ubuntu2404_oneapi:56" OPTIONS: --preset sycl + RUN_TESTS: false # The system to run on. runs-on: ubuntu-latest @@ -98,7 +113,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: | @@ -111,7 +126,7 @@ jobs: cmake --build build # Run the unit test(s). - name: Test - if: "matrix.PLATFORM.NAME != 'CUDA'" + if: "matrix.PLATFORM.RUN_TESTS" run: | cd build source ${GITHUB_WORKSPACE}/.github/ci_setup.sh ${{ matrix.PLATFORM.NAME }} diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ae66b7f7..179a4297 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 @@ -13,15 +13,20 @@ on: - main - 'release/**' +# Cancel existing jobs on new pushes. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: format: 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/CMakePresets.json b/CMakePresets.json index 52fce88c..7327394e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -74,7 +74,8 @@ "displayName" : "SYCL Developer Configuration", "inherits" : [ "vecmem", "eigen" ], "cacheVariables" : { - "ALGEBRA_PLUGINS_TEST_SYCL" : "TRUE" + "ALGEBRA_PLUGINS_TEST_SYCL" : "TRUE", + "VECMEM_BUILD_SYCL_LIBRARY" : "TRUE" } } ] diff --git a/extern/vecmem/CMakeLists.txt b/extern/vecmem/CMakeLists.txt index c235f696..673a8ec0 100644 --- a/extern/vecmem/CMakeLists.txt +++ b/extern/vecmem/CMakeLists.txt @@ -13,7 +13,7 @@ message( STATUS "Building VecMem as part of the Algebra Plugins project" ) # Declare where to get VecMem from. set( ALGEBRA_PLUGINS_VECMEM_SOURCE - "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.5.0.tar.gz;URL_MD5;3cc5a3bb14b93f611513535173a6be28" + "URL;https://github.com/acts-project/vecmem/archive/refs/tags/v1.8.0.tar.gz;URL_MD5;afddf52d9568964f25062e1c887246b7" CACHE STRING "Source for VecMem, when built as part of this project" ) mark_as_advanced( ALGEBRA_PLUGINS_VECMEM_SOURCE ) 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);