Merge pull request #838 from PatKamin/fuzztest-l0 #2257
This file contains 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: Build and test | |
on: [push, pull_request] | |
jobs: | |
ubuntu-build: | |
name: Build - Ubuntu | |
strategy: | |
matrix: | |
os: ['ubuntu-20.04', 'ubuntu-22.04'] | |
build_type: [Debug, Release] | |
compiler: [{c: gcc, cxx: g++}] | |
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF'] | |
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON', '-DUMF_ENABLE_POOL_TRACKING=OFF'] | |
include: | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF' | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: gcc, cxx: g++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
- os: 'ubuntu-20.04' | |
build_type: Release | |
compiler: {c: gcc-7, cxx: g++-7} | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen ${{matrix.compiler.c}} | |
- name: Install g++-7 | |
if: matrix.compiler.cxx == 'g++-7' | |
run: | | |
sudo apt-get install -y ${{matrix.compiler.cxx}} | |
- name: Install pip packages | |
run: pip install -r third_party/requirements.txt | |
- name: Install libbacktrace | |
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
run: | | |
git clone https://github.com/ianlancetaylor/libbacktrace.git | |
cd libbacktrace | |
./configure | |
make | |
sudo make install | |
cd .. | |
- name: Download DPC++ | |
run: | | |
sudo apt install libncurses5 | |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz | |
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | |
${{matrix.libbacktrace}} | |
${{matrix.pool_tracking}} | |
- name: Generate source from spec, check for uncommitted diff | |
if: matrix.os == 'ubuntu-22.04' | |
run: cmake --build ${{github.workspace}}/build --target check-generated | |
- name: Verify that each source file contains a license | |
run: cmake --build ${{github.workspace}}/build --target verify-licenses | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace" | |
fuzztest-build: | |
name: Build and run quick fuzztest scenarios | |
strategy: | |
matrix: | |
build_type: [Debug, Release] | |
compiler: [{c: clang, cxx: clang++}] | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen ${{matrix.compiler.c}} | |
- name: Install pip packages | |
run: pip install -r third_party/requirements.txt | |
- name: Download DPC++ | |
run: | | |
sudo apt install libncurses5 | |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz | |
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz | |
- name: Setup DPC++ | |
run: | | |
source ${{github.workspace}}/dpcpp_compiler/startup.sh | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=OFF | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
-DUR_USE_ASAN=ON | |
-DUR_USE_UBSAN=ON | |
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | |
- name: Generate source from spec, check for uncommitted diff | |
run: cmake --build ${{github.workspace}}/build --target check-generated | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
- name: Fuzz test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" | |
adapter-build: | |
name: Build - Adapters on Ubuntu | |
strategy: | |
matrix: | |
os: ['ubuntu-22.04'] | |
adapter: [CUDA, HIP, L0] | |
build_type: [Debug, Release] | |
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen ${{matrix.compiler.c}} | |
- name: Install pip packages | |
run: pip install -r third_party/requirements.txt | |
- name: Install CUDA specific dependencies | |
if: matrix.adapter == 'CUDA' | |
run: | | |
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc | |
- name: Install HIP specific dependencies | |
if: matrix.adapter == 'HIP' | |
run: | | |
wget https://repo.radeon.com/amdgpu-install/5.6/ubuntu/jammy/amdgpu-install_5.6.50600-1_all.deb | |
sudo apt install ./amdgpu-install_5.6.50600-1_all.deb | |
sudo amdgpu-install --usecase=rocm | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DUR_DEVELOPER_MODE=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
-DUR_BUILD_ADAPTER_${{matrix.adapter}}=ON | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
adapter-build-hw: | |
name: Build - Adapters on HW | |
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW | |
strategy: | |
matrix: | |
adapter: [CUDA, HIP, L0] | |
build_type: [Debug, Release] | |
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] | |
runs-on: ${{matrix.adapter}} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install pip packages | |
run: pip install -r third_party/requirements.txt | |
- name: Download DPC++ | |
run: | | |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz | |
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_ENABLE_TRACING=ON | |
-DUR_DEVELOPER_MODE=ON | |
-DUR_BUILD_TESTS=ON | |
-DUR_BUILD_ADAPTER_${{matrix.adapter}}=ON | |
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
# Temporarily disabling platform test for L0, because of hang | |
# See issue: #824 | |
- name: Test L0 adapter | |
if: matrix.adapter == 'L0' | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "platform-adapter_level_zero" --timeout 180 | |
- name: Test adapters | |
if: matrix.adapter != 'L0' | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 | |
windows-build: | |
name: Build - Windows | |
strategy: | |
matrix: | |
os: ['windows-2019', 'windows-2022'] | |
build_type: [Debug, Release] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install prerequisites | |
run: python3 -m pip install -r third_party/requirements.txt | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW | |
-DUR_ENABLE_TRACING=ON | |
-DUR_DEVELOPER_MODE=ON | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
- name: Generate source from spec, check for uncommitted diff | |
if: matrix.os == 'windows-2022' | |
run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}} | |
- name: Build all | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j 2 | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace" | |
macos-build: | |
name: Build - MacOS | |
strategy: | |
matrix: | |
os: ['macos-12', 'macos-13'] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install prerequisites | |
run: python3 -m pip install -r third_party/requirements.txt | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DUR_ENABLE_TRACING=ON | |
-DUR_DEVELOPER_MODE=ON | |
-DCMAKE_BUILD_TYPE=Release | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
-DUMF_ENABLE_POOL_TRACKING=ON | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) |