Skip to content

Commit 740c375

Browse files
committed
Merge branch 'main' into review/yang/dg2
2 parents 5dd9047 + f404f4d commit 740c375

File tree

125 files changed

+3452
-1568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+3452
-1568
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: Build - Fuzztests on L0 HW - Reusable
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
test_label:
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
fuzztest-build-hw:
16+
name: Build and run fuzz tests on L0 HW
17+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
18+
strategy:
19+
matrix:
20+
build_type: [Debug, Release]
21+
compiler: [{c: clang, cxx: clang++}]
22+
23+
runs-on: 'FUZZTESTS'
24+
# In order to use sanitizers, vm.mmap_rnd_bits=28 must be set in the system,
25+
# otherwise random SEGV at the start of the test occurs.
26+
# Alternatively, clang 18.1.0 onwards with fixed sanitizers behavior can be used,
27+
# if available.
28+
# TODO: Remove this advice once clang 18.1.0 is available in the system (like ie. as an apt package).
29+
30+
steps:
31+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
32+
33+
- name: Install pip packages
34+
run: pip install -r third_party/requirements.txt
35+
36+
- name: Download DPC++
37+
run: |
38+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
39+
mkdir dpcpp_compiler
40+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
41+
42+
- name: Build level zero with gcc
43+
run: |
44+
git clone -b v1.17.6 --depth=1 https://github.com/oneapi-src/level-zero.git ${{github.workspace}}/level-zero
45+
cd ${{github.workspace}}/level-zero
46+
cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
47+
cmake --build build -j $(nproc)
48+
49+
- name: Configure CMake
50+
run: >
51+
cmake
52+
-B${{github.workspace}}/build
53+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
54+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
55+
-DUR_ENABLE_TRACING=ON
56+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
57+
-DUR_BUILD_TESTS=ON
58+
-DUR_USE_ASAN=ON
59+
-DUR_USE_UBSAN=ON
60+
-DUR_BUILD_ADAPTER_L0=ON
61+
-DUR_LEVEL_ZERO_LOADER_LIBRARY=${{github.workspace}}/level-zero/build/lib/libze_loader.so
62+
-DUR_LEVEL_ZERO_INCLUDE_DIR=${{github.workspace}}/level-zero/include/
63+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
64+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
65+
66+
- name: Build
67+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
68+
69+
- name: Fuzz test
70+
working-directory: ${{github.workspace}}/build
71+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "${{inputs.test_label}}" --verbose
72+
73+
- name: Get information about platform
74+
if: ${{ always() }}
75+
run: .github/scripts/get_system_info.sh

.github/workflows/cmake.yml

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -116,51 +116,12 @@ jobs:
116116
working-directory: ${{github.workspace}}/build
117117
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
118118

119-
fuzztest-build:
120-
name: Build and run quick fuzztest scenarios
121-
strategy:
122-
matrix:
123-
build_type: [Debug, Release]
124-
compiler: [{c: clang, cxx: clang++}]
125-
126-
runs-on: 'ubuntu-22.04'
127-
128-
steps:
129-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
130-
131-
- name: Install pip packages
132-
run: pip install -r third_party/requirements.txt
133-
134-
- name: Download DPC++
135-
run: |
136-
sudo apt install libncurses5
137-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
138-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
139-
140-
- name: Setup DPC++
141-
run: |
142-
source ${{github.workspace}}/dpcpp_compiler/startup.sh
143-
144-
- name: Configure CMake
145-
run: >
146-
cmake
147-
-B${{github.workspace}}/build
148-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
149-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
150-
-DUR_ENABLE_TRACING=ON
151-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
152-
-DUR_BUILD_TESTS=ON
153-
-DUR_USE_ASAN=ON
154-
-DUR_USE_UBSAN=ON
155-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
156-
157-
- name: Build
158-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
159-
160-
- name: Fuzz test
161-
working-directory: ${{github.workspace}}/build
162-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" --verbose
163-
119+
fuzztest:
120+
name: Fuzz tests short
121+
uses: ./.github/workflows/build-fuzz-reusable.yml
122+
with:
123+
test_label: "fuzz-short"
124+
164125
level-zero:
165126
name: Level Zero
166127
uses: ./.github/workflows/build-hw-reusable.yml
@@ -231,9 +192,6 @@ jobs:
231192
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
232193
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
233194
compiler: {c: clang-cl, cxx: clang-cl}
234-
# TODO: testing is flaky on windows-2022 in Release mode
235-
- os: 'windows-2022'
236-
build_type: Release
237195

238196
build_type: [Debug, Release]
239197
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]

.github/workflows/nightly.yml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,8 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
long-fuzz-test:
13-
name: Run long fuzz tests
14-
strategy:
15-
matrix:
16-
build_type: [Debug, Release]
17-
compiler: [{c: clang, cxx: clang++}]
18-
19-
runs-on: 'ubuntu-22.04'
20-
21-
steps:
22-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23-
24-
- name: Install pip packages
25-
run: pip install -r third_party/requirements.txt
26-
27-
- name: Download DPC++
28-
run: |
29-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
30-
mkdir dpcpp_compiler
31-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
32-
33-
- name: Configure CMake
34-
run: >
35-
cmake
36-
-B${{github.workspace}}/build
37-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
38-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
39-
-DUR_ENABLE_TRACING=ON
40-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
41-
-DUR_BUILD_TESTS=ON
42-
-DUR_USE_ASAN=ON
43-
-DUR_USE_UBSAN=ON
44-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
45-
46-
- name: Build
47-
run: >
48-
LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
49-
cmake --build ${{github.workspace}}/build -j $(nproc)
50-
51-
- name: Fuzz long test
52-
working-directory: ${{github.workspace}}/build
53-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-long"
12+
fuzztest:
13+
name: Fuzz tests long
14+
uses: ./.github/workflows/build-fuzz-reusable.yml
15+
with:
16+
test_label: "fuzz-long"

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,13 @@ include(Assertions)
7676
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
7777
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
7878
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
79-
if(MSVC)
80-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>)
81-
endif()
8279

8380
# Define rpath for libraries so that adapters can be found automatically
8481
set(CMAKE_BUILD_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
8582

8683
# Define a path for custom commands to work around MSVC
8784
set(CUSTOM_COMMAND_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
88-
if(MSVC)
85+
if(CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_GENERATOR STREQUAL Ninja)
8986
# MSVC implicitly adds $<CONFIG> to the output path
9087
set(CUSTOM_COMMAND_BINARY_DIR ${CUSTOM_COMMAND_BINARY_DIR}/$<CONFIG>)
9188
endif()

0 commit comments

Comments
 (0)