#
# Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber, Jan Stephan
#
# This file is part of alpaka.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

name: Continuous Integration

on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
  cancel-in-progress: true

################################################################################
# NOTE: Testing the full matrix is not practical.
# Therefore we aim to have each value been set in at lest one job.
# CXX                                           : {g++, clang++}
#   [g++] ALPAKA_CI_GCC_VER                     : {9, 10, 11, 12}
#   [clang++] ALPAKA_CI_CLANG_VER               : {9, 10, 11, 12, 13, 14}
#   [cl.exe] ALPAKA_CI_CL_VER                   : {2022}
#   ALPAKA_CI_STDLIB                            : {libstdc++, [CXX==clang++]:libc++}
# CMAKE_BUILD_TYPE                              : {Debug, Release}
# alpaka_CI                                     : {GITHUB}
# ALPAKA_CI_DOCKER_BASE_IMAGE_NAME              : {ubuntu:20.04, ubuntu:22.04}
# ALPAKA_BOOST_VERSION                          : {1.74.0, 1.75.0, 1.76.0, 1.77.0, 1.78.0, 1.79.0}
# ALPAKA_CI_CMAKE_VER                           : {3.18.6, 3.19.8, 3.20.6, 3.21.7, 3.22.6, 3.23.5, 3.24.3, 3.25.1}
# ALPAKA_CI_XCODE_VER                           : {13.2.1, 14.2}
# ALPAKA_CI_SANITIZERS                          : {ASan, UBsan, TSan}
#    TSan is not currently used because it produces many unexpected errors
# ALPAKA_CI_ANALYSIS                            : {ON, OFF}
# alpaka_DEBUG                                  : {0, 1, 2}
# alpaka_ACC_GPU_CUDA_ONLY_MODE                 : {ON, OFF}
# alpaka_ACC_GPU_HIP_ONLY_MODE                  : {ON, OFF}
# alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE             : {ON, OFF}
# alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE         : {ON, OFF}
# alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE            : {ON, OFF}
#   [ON] OMP_NUM_THREADS                        : {1, 2, 3, 4}
# alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE            : {ON, OFF}
#   [ON] OMP_NUM_THREADS                        : {1, 2, 3, 4}
# alpaka_ACC_ANY_BT_OMP5_ENABLE                 : {ON, OFF}
#   [ON] OMP_NUM_THREADS                        : {1, 2, 3, 4}
# alpaka_ACC_GPU_CUDA_ENABLE                    : {ON, OFF}
#   [ON] ALPAKA_CI_CUDA_VERSION                 : {11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6}
#   [ON] CMAKE_CUDA_COMPILER                    : {nvcc, [CXX==clang++]:clang++}
# alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE             : {ON, OFF}
# alpaka_ACC_GPU_HIP_ENABLE                     : {ON, OFF}
#   [ON] ALPAKA_CI_HIP_BRANCH                   : {rocm-4.2}
# alpaka_USE_MDSPAN                             : {OFF, FETCH, SYSTEM}

# if you add/remove any CI variable, also update docker_ci.sh
env:
  alpaka_CI: GITHUB
  ALPAKA_CI_BUILD_JOBS: 2
  TBB_ROOT: ${{ github.workspace }}/tbb
  BOOST_ROOT: ${{ github.workspace }}/boost
  ALPAKA_CI_BOOST_LIB_DIR: ${{ github.workspace }}/boost_libs
  ALPAKA_CI_CMAKE_DIR: ${{ github.workspace }}/CMake
  ALPAKA_CI_CUDA_DIR: ${{ github.workspace }}/CUDA
  ALPAKA_CI_HIP_ROOT_DIR: ${{ github.workspace }}/hip
  ALPAKA_CI_SANITIZERS: ""
  ALPAKA_CI_ANALYSIS: OFF
  ALPAKA_CI_TBB_VERSION: 2021.4.0
  ALPAKA_CI_RUN_TESTS: ON
  alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE: ON
  alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE: ON
  alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: ON
  alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: ON
  alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: ON
  alpaka_ACC_ANY_BT_OMP5_ENABLE: OFF
  alpaka_ACC_ANY_BT_OACC_ENABLE: OFF
  alpaka_ACC_GPU_CUDA_ENABLE: OFF
  alpaka_ACC_GPU_CUDA_ONLY_MODE: OFF
  alpaka_ACC_GPU_HIP_ENABLE: OFF
  alpaka_ACC_GPU_HIP_ONLY_MODE: OFF
  alpaka_USE_MDSPAN: OFF
  CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/_install

jobs:
  clang-format:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v3
    - uses: DoozyX/clang-format-lint-action@v0.14
      with:
        clangFormatVersion: 14
        exclude: './thirdParty'
        inplace: True
    - run: |
        git diff --exit-code > format.patch
    - uses: actions/upload-artifact@v3
      if: failure()
      with:
        name: format.patch
        path: format.patch

  ci:
    needs: clang-format
    name: ${{ matrix.name }}
    runs-on: ${{ matrix.os }}
    env: ${{ matrix.env }}

    strategy:
      fail-fast: false
      matrix:
        include:
        ### Analysis builds
        - name: linux_clang-14_cuda-11.2_debug_analysis
          os: ubuntu-20.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 14,     ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.79.0, ALPAKA_CI_CMAKE_VER: 3.23.5, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", ALPAKA_CI_ANALYSIS: ON, ALPAKA_CI_RUN_TESTS: OFF, alpaka_DEBUG: 1, alpaka_ACC_GPU_CUDA_ENABLE: ON, ALPAKA_CI_CUDA_VERSION: "11.2", CMAKE_CUDA_COMPILER: clang++,   alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF}
        - name: windows_cl-2022_debug_analysis
          os: windows-2022
          env: {CXX: cl.exe,  CC: cl.exe, ALPAKA_CI_CL_VER: 2022,                                   CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.78.0, ALPAKA_CI_CMAKE_VER: 3.23.5,                     ALPAKA_CI_ANALYSIS: ON, alpaka_DEBUG: 2}
        - name: macos_xcode-14.2_debug_analysis
          os: macos-12
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_XCODE_VER: 14.2,                                CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.81.0,                                                  ALPAKA_CI_ANALYSIS: ON, alpaka_DEBUG: 2,                                                                                                                                                                             alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE: ON, ALPAKA_CI_BUILD_JOBS: 3}
        - name: linux_gcc-12_debug_analysis
          os: ubuntu-22.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 12,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.80.0, ALPAKA_CI_CMAKE_VER: 3.23.5, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:22.04", ALPAKA_CI_ANALYSIS: ON, alpaka_DEBUG: 2}

        ### macOS
        - name: macos_xcode-13.2.1_debug
          os: macos-11
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_XCODE_VER: 13.2.1,                              CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.76.0,                                                                                                                                                                                                                                                                       alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE: ON, ALPAKA_CI_BUILD_JOBS: 3}
        - name: macos_xcode-14.2_release
          os: macos-12
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_XCODE_VER: 14.2,                                CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.81.0,                                                                                                                                                                                                                                                                       alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE: ON, ALPAKA_CI_BUILD_JOBS: 3}

        ### Windows
        - name: windows_cl-2022_release
          os: windows-2022
          env: {CXX: cl.exe,  CC: cl.exe, ALPAKA_CI_CL_VER: 2022,                                   CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.79.0, ALPAKA_CI_CMAKE_VER: 3.24.3, OMP_NUM_THREADS: 1}
        - name: windows_cl-2022_debug
          os: windows-2022
          env: {CXX: cl.exe,  CC: cl.exe, ALPAKA_CI_CL_VER: 2022,                                   CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.80.0, ALPAKA_CI_CMAKE_VER: 3.25.1, OMP_NUM_THREADS: 4,                                                                                                                                                                                           alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF}

        ## CUDA 12.0
        # nvcc + MSVC
        - name: windows_nvcc-12.0_cl-2022_release_cuda-only
          os: windows-2022
          env: {CXX: cl.exe,  CC: cl.exe, ALPAKA_CI_CL_VER: 2022,                                   CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.81.0, ALPAKA_CI_CMAKE_VER: 3.24.3, ALPAKA_CI_RUN_TESTS: OFF,                     alpaka_ACC_GPU_CUDA_ENABLE: ON, ALPAKA_CI_CUDA_VERSION: "12.0", CMAKE_CUDA_ARCHITECTURES: "50;90", alpaka_ACC_GPU_CUDA_ONLY_MODE: ON,                                                     alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE: OFF, alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF}
        - name: windows_nvcc-12.0_cl-2022_debug
          os: windows-2022
          env: {CXX: cl.exe,  CC: cl.exe, ALPAKA_CI_CL_VER: 2022,                                   CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.78.0, ALPAKA_CI_CMAKE_VER: 3.25.1, ALPAKA_CI_RUN_TESTS: OFF,                     alpaka_ACC_GPU_CUDA_ENABLE: ON, ALPAKA_CI_CUDA_VERSION: "12.0",                                                                                                                           alpaka_ACC_CPU_BT_OMP5_ENABLE: OFF, alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF}

        ### Ubuntu
        ## native
        # g++
        # We can not enable UBSan when using gcc because it does not have a -fsanitize-blacklist option to suppress errors in boost etc.
        # gcc 7 ASan introduced 'stack-use-after-scope' which is triggered by GOMP_parallel
        - name: linux_gcc-9_debug
          os: ubuntu-20.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 9,        ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.74.0, ALPAKA_CI_CMAKE_VER: 3.18.6, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_EXTENSIONS: OFF}
        - name: linux_gcc-10_release
          os: ubuntu-20.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 10,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.75.0, ALPAKA_CI_CMAKE_VER: 3.19.8, OMP_NUM_THREADS: 2, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04"}
        - name: linux_gcc-11_release_oacc
          os: ubuntu-20.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 11,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.77.0, ALPAKA_CI_CMAKE_VER: 3.21.7, OMP_NUM_THREADS: 2, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_FLAGS: "-foffload=disable", alpaka_ACC_ANY_BT_OACC_ENABLE: ON, alpaka_OFFLOAD_MAX_BLOCK_SIZE: 1, ACC_DEVICE_TYPE: "host", alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE: OFF, alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF, alpaka_CHECK_HEADERS: ON}
        - name: linux_gcc-11_debug
          os: ubuntu-20.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 11,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.78.0, ALPAKA_CI_CMAKE_VER: 3.22.6, OMP_NUM_THREADS: 2, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04"}
        - name: linux_gcc-11_debug_omp5
          os: ubuntu-20.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 11,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.79.0, ALPAKA_CI_CMAKE_VER: 3.23.5, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", alpaka_DEBUG: 2, alpaka_ACC_ANY_BT_OMP5_ENABLE: ON, CMAKE_CXX_FLAGS: "-foffload=disable", OMP_TARGET_OFFLOAD: "DISABLED", alpaka_OFFLOAD_MAX_BLOCK_SIZE: 2, alpaka_CHECK_HEADERS: ON}
        - name: linux_gcc-12_release_c++20
          os: ubuntu-22.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 12,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.80.0, ALPAKA_CI_CMAKE_VER: 3.24.3, OMP_NUM_THREADS: 2, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:22.04", alpaka_CXX_STANDARD: 20, alpaka_USE_MDSPAN: "FETCH"}
        - name: linux_gcc-12_release_oacc_c++20
          os: ubuntu-22.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 12,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.81.0, ALPAKA_CI_CMAKE_VER: 3.25.1, OMP_NUM_THREADS: 2, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:22.04", CMAKE_CXX_FLAGS: "-foffload=disable", alpaka_ACC_ANY_BT_OACC_ENABLE: ON, alpaka_OFFLOAD_MAX_BLOCK_SIZE: 1, ACC_DEVICE_TYPE: "host", alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_FIBERS_ENABLE: OFF, alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF, alpaka_CHECK_HEADERS: ON, alpaka_CXX_STANDARD: 20}
        - name: linux_gcc-12_debug_omp5
          os: ubuntu-22.04
          env: {CXX: g++,     CC: gcc,    ALPAKA_CI_GCC_VER: 12,       ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.80.0, ALPAKA_CI_CMAKE_VER: 3.24.3, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:22.04", alpaka_DEBUG: 2, alpaka_ACC_ANY_BT_OMP5_ENABLE: ON, CMAKE_CXX_FLAGS: "-foffload=disable", OMP_TARGET_OFFLOAD: "DISABLED", alpaka_OFFLOAD_MAX_BLOCK_SIZE: 2, alpaka_CHECK_HEADERS: ON}

        # clang++
        - name: linux_clang-9_debug
          os: ubuntu-20.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 9,      ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.74.0, ALPAKA_CI_CMAKE_VER: 3.18.6, OMP_NUM_THREADS: 1, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04"}
        - name: linux_clang-10_release
          os: ubuntu-20.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 10,     ALPAKA_CI_STDLIB: libc++,    CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.75.0, ALPAKA_CI_CMAKE_VER: 3.19.8, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, CMAKE_CXX_EXTENSIONS: OFF}
        # clang-11 tested in GitLab CI
        - name: linux_clang-12_release
          os: ubuntu-20.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 12,     ALPAKA_CI_STDLIB: libc++,    CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.77.0, ALPAKA_CI_CMAKE_VER: 3.21.7, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, CMAKE_CXX_EXTENSIONS: OFF}
        - name: linux_clang-13_debug_omp5
          os: ubuntu-22.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 13,     ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.78.0, ALPAKA_CI_CMAKE_VER: 3.22.6, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_FLAGS: "-fopenmp=libomp -fopenmp-targets=x86_64-pc-linux-gnu -Wno-openmp-mapping", alpaka_ACC_ANY_BT_OMP5_ENABLE: ON, alpaka_OFFLOAD_MAX_BLOCK_SIZE: 1, CMAKE_EXE_LINKER_FLAGS: "-fopenmp", alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF}
        - name: linux_clang-13_debug
          os: ubuntu-22.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 13,     ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.79.0, ALPAKA_CI_CMAKE_VER: 3.23.5, OMP_NUM_THREADS: 3, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_EXTENSIONS: OFF}
        - name: linux_clang-14_debug_omp5
          os: ubuntu-20.04
          env: {CXX: clang++, CC: clang,  ALPAKA_CI_CLANG_VER: 14,     ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Debug,   ALPAKA_BOOST_VERSION: 1.80.0, ALPAKA_CI_CMAKE_VER: 3.24.3, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_FLAGS: "-fopenmp=libomp -fopenmp-targets=x86_64-pc-linux-gnu -Wno-openmp-mapping", alpaka_ACC_ANY_BT_OMP5_ENABLE: ON, alpaka_OFFLOAD_MAX_BLOCK_SIZE: 1, CMAKE_EXE_LINKER_FLAGS: "-fopenmp", alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF}

        # icpx
        - name: linux_icpx_release
          os: ubuntu-20.04
          env: {CXX: icpx,    CC: icx,                                 ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.75.0, ALPAKA_CI_CMAKE_VER: 3.22.3, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04"}
        - name: linux_icpx_release_omp5
          os: ubuntu-20.04
          env: {CXX: icpx,    CC: icx,                                 ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: Release, ALPAKA_BOOST_VERSION: 1.75.0, ALPAKA_CI_CMAKE_VER: 3.22.3, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "ubuntu:20.04", CMAKE_CXX_FLAGS: "-fiopenmp -fopenmp-targets=spir64 -Wno-source-uses-openmp", alpaka_ACC_ANY_BT_OMP5_ENABLE: ON, alpaka_OFFLOAD_MAX_BLOCK_SIZE: 1, OMP_TARGET_OFFLOAD: "DISABLED", alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF}

        ## NVHPC
        - name: linux_nvhpc-22.9_release_oacc_multicore
        # # gcc is used to compile the dependencies, NVHPC will be used to compile alpaka
        # have to build with -O2 (hence CMAKE_BUILD_TYPE=RelWithDebInfo) at
        # most since at least 22.3: Loop in Vec::operator+(..) is wrongly
        # eliminated by optimizer at -O3 in matMulTest
          os: ubuntu-20.04
          env: {CXX: g++,   CC: gcc,    ALPAKA_CI_GCC_VER: 9, CMAKE_CXX_COMPILER: nvc++,     CMAKE_C_COMPILER: nvc,    ALPAKA_CI_STDLIB: libstdc++, CMAKE_BUILD_TYPE: RelWithDebInfo,   ALPAKA_BOOST_VERSION: 1.74.0, ALPAKA_CI_CMAKE_VER: 3.18.6, OMP_NUM_THREADS: 4, ALPAKA_CI_DOCKER_BASE_IMAGE_NAME: "nvcr.io/nvidia/nvhpc:22.9-devel-cuda11.7-ubuntu20.04", ALPAKA_CI_ANALYSIS: OFF, alpaka_DEBUG: 0, alpaka_ACC_ANY_BT_OACC_ENABLE: ON, alpaka_OFFLOAD_MAX_BLOCK_SIZE: 1, alpaka_DEBUG_OFFLOAD_ASSUME_HOST: ON, CMAKE_CXX_FLAGS: "-acc -ta=multicore --diag_suppress=186", alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE: OFF, alpaka_ACC_CPU_B_TBB_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE: OFF, alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE: OFF, alpaka_CHECK_HEADERS: ON}

    steps:
    - name: check filter
      if: (contains(github.event.head_commit.message, 'ci_filter') && !contains(github.event.head_commit.message, matrix.name ))
      run: exit 1
    - uses: actions/checkout@v3
    - name: build + test
      if: (runner.os == 'Windows')
      env:
        ALPAKA_CI_OS_NAME: ${{runner.os}}
      shell: bash
      run: cd ${GITHUB_WORKSPACE} && ./script/ci.sh
    - name: build + test
      if: (runner.os == 'Linux' || runner.os == 'macOS')
      env:
        ALPAKA_CI_OS_NAME: ${{runner.os}}
      run: cd ${GITHUB_WORKSPACE} && ./script/ci.sh
