SIMD backends for math functions #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 CExA-project | |
| # SPDX-License-Identifier: MIT or Apache-2.0 with LLVM-exception | |
| name: SIMD Backends Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/simd-backends.yml' | |
| - 'simd-backends/**' | |
| - '!simd-backends/README.md' | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| simd-backends-ci: | |
| continue-on-error: true | |
| runs-on: ubuntu-latest | |
| env: | |
| CMAKE_GENERATOR: Ninja | |
| Kokkos_ROOT: ${{ github.workspace }}/opt/kokkos | |
| sleef_ROOT: ${{ github.workspace }}/opt/sleef | |
| CexaSimdBackends_ROOT: ${{ github.workspace }}/simd-backends/install | |
| steps: | |
| - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| id: cache-sleef | |
| with: | |
| path: opt/sleef | |
| key: simd-backends-sleef-ubuntu-latest | |
| - name: Checkout Code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Checkout Sleef | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| if: steps.cache-sleef.outputs.cache-hit != 'true' | |
| with: | |
| repository: shibatch/sleef | |
| ref: 3.9.0 | |
| path: sleef | |
| - name: Install Sleef | |
| if: steps.cache-sleef.outputs.cache-hit != 'true' | |
| run: | | |
| cmake -S sleef -B sleef/build \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_C_COMPILER=gcc \ | |
| -DCMAKE_CXX_COMPILER=g++ \ | |
| -DCMAKE_INSTALL_PREFIX="$sleef_ROOT" \ | |
| -DSLEEF_BUILD_GNUABI_LIBS=OFF \ | |
| -DSLEEF_BUILD_TESTS=OFF \ | |
| -DSLEEF_ENABLE_TLFLOAT=OFF \ | |
| -DSLEEF_ENABLE_FFTW=OFF \ | |
| -DSLEEF_ENABLE_MPFR=OFF | |
| cmake --build sleef/build -j --target install | |
| - name: Checkout Kokkos | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: kokkos/kokkos | |
| ref: 5.0.2 | |
| path: kokkos | |
| - name: Install kokkos | |
| run: | | |
| cmake -S kokkos -B kokkos/build \ | |
| -DCMAKE_CXX_COMPILER=g++ \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DCMAKE_INSTALL_PREFIX="$Kokkos_ROOT" \ | |
| -DKokkos_ARCH_NATIVE=ON | |
| cmake --build kokkos/build -j --target install | |
| - name: Configure | |
| working-directory: ${{ github.workspace }}/simd-backends | |
| run: | |
| cmake -S . -B build | |
| -DCMAKE_CXX_COMPILER=g++ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
| -DCMAKE_INSTALL_PREFIX="$CexaSimdBackends_ROOT" | |
| -DCEXA_SIMD_ENABLE_SLEEF=ON | |
| -DCEXA_SIMD_ENABLE_TESTS=ON | |
| - name: Build | |
| working-directory: ${{ github.workspace }}/simd-backends | |
| run: cmake --build build -j | |
| - name: Install | |
| working-directory: ${{ github.workspace }}/simd-backends | |
| run: cmake --install build | |
| - name: Test install | |
| working-directory: ${{ github.workspace }}/simd-backends/test/install_test | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_CXX_COMPILER=g++ \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
| cmake --build build -j | |
| ./build/main | |
| - name: Patch Kokkos | |
| working-directory: ${{ github.workspace }}/kokkos/simd/unit_tests | |
| run: | | |
| cp "$CexaSimdBackends_ROOT/include/CEXA_SIMD_SLEEF.hpp" include | |
| sed -i '/kokkos_add_executable_and_test/a find_package(sleef REQUIRED)\ntarget_link_libraries(Kokkos_UnitTest_SIMD PRIVATE sleef::sleef)' CMakeLists.txt | |
| sed -i '/include <Kokkos_SIMD.hpp>/a #include <CEXA_SIMD_SLEEF.hpp>' include/TestSIMD_MathOps.hpp | |
| - name: Build and run Kokkos SIMD unit test | |
| working-directory: ${{ github.workspace }}/kokkos | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_CXX_COMPILER=g++ \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DKokkos_ARCH_NATIVE=ON \ | |
| -DKokkos_ENABLE_TESTS=ON | |
| cmake --build build -j --target Kokkos_UnitTest_SIMD | |
| ctest --test-dir build --output-on-failure -R SIMD |