This repository was archived by the owner on Jul 22, 2026. It is now read-only.
Add SYCL support #125
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
| name: SYCL CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| ADAPTIVECPP_TAG: v25.10.0 | |
| ADAPTIVECPP_CACHE_VERSION: v4 | |
| ACPP_TARGETS: omp.library-only | |
| jobs: | |
| prepare-sycl-toolchain: | |
| name: prepare ${{ matrix.platform }} | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 180 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| platform: | |
| - linux-x86_64 | |
| - linux-arm64 | |
| - windows-x86_64 | |
| include: | |
| - platform: linux-x86_64 | |
| runner: ubuntu-latest | |
| - platform: linux-arm64 | |
| runner: ubuntu-24.04-arm | |
| - platform: windows-x86_64 | |
| runner: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ccache-${{ github.job }}-${{ matrix.platform }} | |
| max-size: 4G | |
| - name: Restore or save AdaptiveCpp toolchain cache | |
| id: sycl-toolchain-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ runner.temp }}/AdaptiveCpp | |
| ${{ runner.temp }}/AdaptiveCpp-build | |
| ${{ runner.temp }}/adaptivecpp-install | |
| ${{ runner.temp }}/archives | |
| key: sycl-toolchain-${{ matrix.platform }}-${{ env.ADAPTIVECPP_TAG }}-${{ env.ADAPTIVECPP_CACHE_VERSION }} | |
| - name: Prepare SYCL toolchain | |
| uses: ./.github/actions/setup-sycl-toolchain | |
| with: | |
| phase: prepare | |
| cache-hit: ${{ steps.sycl-toolchain-cache.outputs.cache-hit }} | |
| build-sycl: | |
| name: ${{ matrix.platform }} ${{ matrix.build_type }} | |
| needs: prepare-sycl-toolchain | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 180 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| platform: | |
| - linux-x86_64 | |
| - linux-arm64 | |
| - macos-arm64 | |
| - windows-x86_64 | |
| build_type: | |
| - Debug | |
| - Release | |
| include: | |
| - platform: linux-x86_64 | |
| runner: ubuntu-latest | |
| - platform: linux-arm64 | |
| runner: ubuntu-24.04-arm | |
| - platform: macos-arm64 | |
| runner: macos-15 | |
| - platform: windows-x86_64 | |
| runner: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ccache-${{ github.job }}-${{ matrix.platform }}-${{ matrix.build_type }} | |
| max-size: 4G | |
| - name: Restore AdaptiveCpp toolchain cache | |
| if: runner.os != 'macOS' | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ${{ runner.temp }}/AdaptiveCpp | |
| ${{ runner.temp }}/AdaptiveCpp-build | |
| ${{ runner.temp }}/adaptivecpp-install | |
| ${{ runner.temp }}/archives | |
| key: sycl-toolchain-${{ matrix.platform }}-${{ env.ADAPTIVECPP_TAG }}-${{ env.ADAPTIVECPP_CACHE_VERSION }} | |
| fail-on-cache-miss: true | |
| - name: Setup SYCL toolchain | |
| uses: ./.github/actions/setup-sycl-toolchain | |
| with: | |
| phase: build | |
| - name: Configure | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| cmake -S . -B "build/${{ matrix.build_type }}" -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DCMAKE_C_COMPILER="${ITLABAI_CC}" \ | |
| -DCMAKE_CXX_COMPILER="${ITLABAI_CXX}" \ | |
| -DCMAKE_PREFIX_PATH="${ITLABAI_CMAKE_PREFIX_PATH}" \ | |
| -DOpenMP_ROOT="${ITLABAI_OPENMP_ROOT}" \ | |
| -DITLABAI_ENABLE_SYCL=ON \ | |
| -DACPP_TARGETS="${ACPP_TARGETS}" \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| - name: Configure | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| cmake -S . -B "build/${{ matrix.build_type }}" -G Ninja ` | |
| "-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}" ` | |
| "-DCMAKE_C_COMPILER=$env:ITLABAI_CC" ` | |
| "-DCMAKE_CXX_COMPILER=$env:ITLABAI_CXX" ` | |
| "-DCMAKE_PREFIX_PATH=$env:ITLABAI_CMAKE_PREFIX_PATH" ` | |
| "-DITLABAI_ENABLE_SYCL=ON" ` | |
| "-DACPP_TARGETS=$env:ACPP_TARGETS" ` | |
| "-DACPP_CPU_CXX=$env:ITLABAI_ACPP_CPU_CXX" ` | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache ` | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Build | |
| run: cmake --build "build/${{ matrix.build_type }}" --target SYCL_Example run_test --parallel | |
| - name: Test | |
| run: ctest --test-dir "build/${{ matrix.build_type }}" --output-on-failure -R '^(UnitTests|SYCL\.Example)$' |