Skip to content

Commit 47af3ee

Browse files
Merge pull request #1072 from omarahmed1111/merge-some-main-changes-into-adapters-third-patch
Merge main into adapters branch
2 parents bd76c51 + f2ca7a9 commit 47af3ee

File tree

223 files changed

+15003
-7916
lines changed

Some content is hidden

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

223 files changed

+15003
-7916
lines changed

.github/workflows/cmake.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,18 @@ jobs:
291291
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
292292
]
293293

294-
# TODO: building level zero loader on windows-2019 and clang-cl.exe is currently broken
294+
# TODO: building level zero loader on windows-2019 and clang-cl is currently broken
295295
exclude:
296296
- os: 'windows-2019'
297297
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
298298
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
299-
compiler: {c: clang-cl.exe, cxx: clang-cl.exe}
299+
compiler: {c: clang-cl, cxx: clang-cl}
300300

301301
build_type: [Debug, Release]
302-
compiler: [{c: cl.exe, cxx: cl.exe}, {c: clang-cl.exe, cxx: clang-cl.exe}]
302+
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
303+
include:
304+
- compiler: {c: clang-cl, cxx: clang-cl}
305+
toolset: "-T ClangCL"
303306
runs-on: ${{matrix.os}}
304307

305308
steps:
@@ -312,10 +315,18 @@ jobs:
312315
- name: Install prerequisites
313316
run: python3 -m pip install -r third_party/requirements.txt
314317

318+
- name: Install doxygen
319+
run: |
320+
$WorkingDir = $PWD.Path
321+
Invoke-WebRequest -Uri https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.windows.x64.bin.zip -OutFile "$WorkingDir\doxygen.zip"
322+
Expand-Archive -Path "$WorkingDir\doxygen.zip"
323+
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
324+
315325
- name: Configure CMake
316326
run: >
317327
cmake
318328
-B${{github.workspace}}/build
329+
${{matrix.toolset}}
319330
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
320331
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
321332
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
@@ -331,7 +342,7 @@ jobs:
331342
# run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
332343

333344
- name: Build all
334-
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j 2
345+
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
335346

336347
- name: Test
337348
working-directory: ${{github.workspace}}/build

.github/workflows/coverage.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Coverage
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ubuntu-build:
7+
name: Build - Ubuntu
8+
strategy:
9+
matrix:
10+
os: ['ubuntu-22.04']
11+
build_type: [Debug]
12+
compiler: [{c: gcc, cxx: g++}]
13+
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON']
14+
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON']
15+
16+
runs-on: ${{matrix.os}}
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Install apt packages
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
25+
26+
- name: Install pip packages
27+
run: pip install -r third_party/requirements.txt
28+
29+
- name: Install libbacktrace
30+
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
31+
run: |
32+
git clone https://github.com/ianlancetaylor/libbacktrace.git
33+
cd libbacktrace
34+
./configure
35+
make
36+
sudo make install
37+
cd ..
38+
39+
- name: Download DPC++
40+
run: |
41+
sudo apt install libncurses5
42+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
43+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
44+
45+
- name: Configure CMake
46+
run: >
47+
cmake
48+
-B${{github.workspace}}/build
49+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
50+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
51+
-DUR_ENABLE_TRACING=ON
52+
-DUR_DEVELOPER_MODE=ON
53+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
54+
-DUR_BUILD_TESTS=ON
55+
-DUR_FORMAT_CPP_STYLE=ON
56+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
57+
-DCMAKE_CXX_FLAGS="--coverage -fkeep-inline-functions -fkeep-static-functions"
58+
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
59+
-DCMAKE_SHARED_LINKER_FLAGS="--coverage"
60+
${{matrix.libbacktrace}}
61+
${{matrix.pool_tracking}}
62+
63+
- name: Build
64+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
65+
66+
- name: Test
67+
working-directory: ${{github.workspace}}/build
68+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
69+
70+
- name: Quick Coverage Info
71+
working-directory: ${{github.workspace}}/build
72+
run: ctest -T Coverage
73+
74+
- name: Upload coverage to Codecov
75+
uses: codecov/codecov-action@v3
76+
with:
77+
gcov: true
78+
gcov_include: source

.github/workflows/e2e_nightly.yml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: E2E Nightly
2+
3+
on:
4+
schedule:
5+
# Run every day at 23:00 UTC
6+
- cron: '0 23 * * *'
7+
8+
jobs:
9+
e2e-build-hw:
10+
name: Build SYCL, UR, run E2E
11+
strategy:
12+
matrix:
13+
adapter: [
14+
{name: CUDA}
15+
]
16+
build_type: [Release]
17+
compiler: [{c: clang, cxx: clang++}]
18+
19+
runs-on: ${{matrix.adapter.name}}
20+
21+
steps:
22+
# Workspace on self-hosted runners is not cleaned automatically.
23+
# We have to delete the files created outside of using actions.
24+
- name: Cleanup self-hosted workspace
25+
if: always()
26+
run: |
27+
ls -la ./
28+
rm -rf ./* || true
29+
30+
- name: Checkout UR
31+
uses: actions/checkout@v4
32+
with:
33+
ref: adapters
34+
path: ur-repo
35+
36+
- name: Checkout SYCL
37+
uses: actions/checkout@v4
38+
with:
39+
repository: intel/llvm
40+
ref: sycl
41+
path: sycl-repo
42+
43+
- name: Install pip packages
44+
working-directory: ${{github.workspace}}/ur-repo
45+
run: pip install -r third_party/requirements.txt
46+
47+
- name: Configure CMake UR
48+
working-directory: ${{github.workspace}}/ur-repo
49+
run: >
50+
cmake
51+
-B build
52+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
53+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
54+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
55+
-DUR_ENABLE_TRACING=ON
56+
-DUR_DEVELOPER_MODE=ON
57+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
58+
59+
- name: Build UR
60+
run: LD_LIBRARY_PATH=${{github.workspace}}/dpcpp_compiler/lib
61+
cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)
62+
63+
- name: Set env vars & pre setup
64+
run: |
65+
echo "SYCL_PREFER_UR=1" >> $GITHUB_ENV
66+
echo "CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs" >> $GITHUB_ENV
67+
echo "LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
68+
source /opt/intel/oneapi/setvars.sh
69+
sycl-ls
70+
71+
- name: Configure SYCL
72+
run: >
73+
python3 sycl-repo/buildbot/configure.py
74+
-t ${{matrix.build_type}}
75+
-o ${{github.workspace}}/sycl_build
76+
--cmake-gen "Unix Makefiles"
77+
--ci-defaults --cuda --hip
78+
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
79+
--cmake-opt="-DSYCL_PI_TESTS=OFF"
80+
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
81+
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
82+
83+
- name: Build SYCL
84+
run: cmake --build ${{github.workspace}}/sycl_build
85+
86+
- name: Run check-sycl
87+
# Remove after fixing SYCL test :: abi/layout_handler.cpp
88+
# This issue does not affect further execution of e2e with UR.
89+
continue-on-error: true
90+
run: cmake --build ${{github.workspace}}/sycl_build --target check-sycl
91+
92+
- name: Swap UR loader and adapters
93+
run: |
94+
cp ${{github.workspace}}/ur-repo/build/lib/libur_loader.so* ${{github.workspace}}/sycl_build/lib/
95+
cp ${{github.workspace}}/ur-repo/build/lib/libur_adapter_cuda.so* ${{github.workspace}}/sycl_build/lib/
96+
97+
- name: Set additional env. vars
98+
run: |
99+
echo "${{github.workspace}}/sycl_build/bin" >> $GITHUB_PATH
100+
echo "LD_LIBRARY_PATH=${{github.workspace}}/sycl_build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
101+
102+
# Running (newly built) sycl-ls sets up some extra variables
103+
- name: Setup SYCL variables
104+
run: |
105+
which clang++ sycl-ls
106+
SYCL_PI_TRACE=-1 sycl-ls
107+
108+
- name: Build e2e tests
109+
run: >
110+
cmake
111+
-GNinja
112+
-B ${{github.workspace}}/build-e2e/
113+
-S ${{github.workspace}}/sycl-repo/sycl/test-e2e/
114+
-DSYCL_TEST_E2E_TARGETS="ext_oneapi_cuda:gpu"
115+
-DCMAKE_CXX_COMPILER="$(which clang++)"
116+
-DLLVM_LIT="${{github.workspace}}/sycl-repo/llvm/utils/lit/lit.py"
117+
118+
- name: Run e2e tests
119+
run: ninja -C build-e2e check-sycl-e2e

.github/workflows/nightly.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Nightly
2+
3+
on:
4+
schedule:
5+
# Run every day at 23:00 UTC
6+
- cron: '0 23 * * *'
7+
8+
jobs:
9+
long-fuzz-test:
10+
name: Run long fuzz tests
11+
strategy:
12+
matrix:
13+
build_type: [Debug, Release]
14+
compiler: [{c: clang, cxx: clang++}]
15+
16+
runs-on: 'ubuntu-22.04'
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
# with-ref part to be removed after merging 'adapters' branch with 'main'
21+
with:
22+
ref: adapters
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-2023-08-31/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"

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1515
include(helpers)
1616

1717
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
18-
set(CMAKE_FIND_FRAMEWORK NEVER)
18+
set(Python3_FIND_FRAMEWORK NEVER)
19+
set(Python3_FIND_STRATEGY LOCATION)
1920
endif()
2021

2122
find_package(Python3 COMPONENTS Interpreter REQUIRED)

README.md

+35-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![CodeQL](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/codeql.yml)
55
[![Bandit](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml/badge.svg)](https://github.com/oneapi-src/unified-runtime/actions/workflows/bandit.yml)
66
[![Coverity](https://scan.coverity.com/projects/28213/badge.svg)](https://scan.coverity.com/projects/oneapi-src-unified-runtime)
7+
[![codecov.io](https://codecov.io/github/oneapi-src/unified-runtime/coverage.svg?branch=main)](https://codecov.io/github/oneapi-src/unified-runtime?branch=master)
78

89
## Adapters
910
Adapter implementations for Unified Runtime currently reside in the [SYCL repository](https://github.com/intel/llvm/tree/sycl/sycl/plugins/unified_runtime/ur). This branch contains scripts to automatically
@@ -31,7 +32,7 @@ see cmake options for details.
3132
- [Adapter naming convention](#adapter-naming-convention)
3233
- [Source code generation](#source-code-generation)
3334
- [Documentation](#documentation)
34-
35+
6. [Release Process](#release-process)
3536

3637
## Contents of the repo
3738

@@ -80,16 +81,19 @@ Tools can be acquired via instructions in [third_party](/third_party/README.md).
8081

8182
## Building
8283

84+
The requirements and instructions below are for building the project from source
85+
without any modifications. To make modifications to the specification, please
86+
see the
87+
[Contribution Guide](https://oneapi-src.github.io/unified-runtime/core/CONTRIB.html)
88+
for more detailed instructions on the correct setup.
89+
8390
### Requirements
8491

8592
Required packages:
8693
- C++ compiler with C++17 support
8794
- [CMake](https://cmake.org/) >= 3.14.0
8895
- Python v3.6.6 or later
8996

90-
For development and contributions:
91-
- clang-format-15.0 (can be installed with `python -m pip install clang-format==15.0.7`)
92-
9397
### Windows
9498

9599
Generating Visual Studio Project. EXE and binaries will be in **build/bin/{build_config}**
@@ -154,6 +158,10 @@ It will generate the source code **and** run automated code formatting:
154158
$ make generate
155159
```
156160

161+
This target has additional dependencies which are described in the *Build
162+
Environment* section of the
163+
[Contribution Guide](https://oneapi-src.github.io/unified-runtime/core/CONTRIB.html).
164+
157165
## Contributions
158166

159167
For those who intend to make a contribution to the project please read our
@@ -176,3 +184,26 @@ Code is generated using included [Python scripts](/scripts/README.md).
176184

177185
Documentation is generated from source code using Sphinx -
178186
see [scripts dir](/scripts/README.md) for details.
187+
188+
## Release Process
189+
190+
Unified Runtime releases are aligned with oneAPI releases. Once all changes
191+
planned for a release have been accepted, the release process is defined as:
192+
193+
1. Create a new release branch based on the [main][main-branch] branch taking
194+
the form `v<major>.<minor>.x` where `x` is a placeholder for the patch
195+
version. This branch will always contain the latest patch version for a given
196+
release.
197+
2. Create a PR to increment the CMake project version on the [main][main-branch]
198+
and merge before accepting any other changes.
199+
3. Create a new tag based on the latest commit on the release branch taking the
200+
form `v<major>.<minor>.<patch>`.
201+
4. Create a [new GitHub release][new-github-release] using the tag created in
202+
the previous step.
203+
* Prior to version 1.0, check the *Set as a pre-release* tick box.
204+
5. Update downstream projects to utilize the release tag. If any issues arise
205+
from integration, apply any necessary hot fixes to `v<major>.<minor>.x`
206+
branch and go back to step 3.
207+
208+
[main-branch]: https://github.com/oneapi-src/unified-runtime/tree/main
209+
[new-github-release]: https://github.com/oneapi-src/unified-runtime/releases/new

0 commit comments

Comments
 (0)