Skip to content

Commit

Permalink
Merge pull request #128 from niermann999/ref-CI
Browse files Browse the repository at this point in the history
ref: Update CI and allow for c++20
  • Loading branch information
krasznaa authored Nov 19, 2024
2 parents 6f777bd + ab97d2f commit 6866c1b
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 41 deletions.
9 changes: 6 additions & 3 deletions .github/ci_setup.sh
Original file line number Diff line number Diff line change
@@ -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
#
Expand All @@ -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
41 changes: 28 additions & 13 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:

Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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 }}
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 )
Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion extern/vecmem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down
30 changes: 14 additions & 16 deletions frontend/vc_aos/include/algebra/vc_aos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ using cmath::element;

/// Function extracting a slice from matrix44 - const
template <std::size_t SIZE, template <typename, std::size_t> class array_t,
typename value_t, std::size_t N,
std::enable_if_t<SIZE <= 4, bool> = true>
ALGEBRA_HOST_DEVICE inline const auto& vector(
const storage::matrix44<array_t, value_t, N>& m,
std::size_t
typename value_t, std::size_t N>
requires(SIZE <= 4) ALGEBRA_HOST_DEVICE inline const
auto& vector(const storage::matrix44<array_t, value_t, N>& 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);
Expand All @@ -82,16 +81,15 @@ ALGEBRA_HOST_DEVICE inline const auto& vector(

/// Function extracting a slice from matrix44 - non-const
template <std::size_t SIZE, template <typename, std::size_t> class array_t,
typename value_t, std::size_t N,
std::enable_if_t<SIZE <= 4, bool> = true>
ALGEBRA_HOST_DEVICE inline auto& vector(
storage::matrix44<array_t, value_t, N>& m,
std::size_t
typename value_t, std::size_t N>
requires(SIZE <= 4) ALGEBRA_HOST_DEVICE
inline auto& vector(storage::matrix44<array_t, value_t, N>& 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);
Expand Down

0 comments on commit 6866c1b

Please sign in to comment.