Skip to content

Commit 6175cee

Browse files
authored
Merge pull request #1159 from oneapi-src/adapters
Merge adapters branch into main
2 parents 26e98b5 + 9e3bb2f commit 6175cee

File tree

305 files changed

+50612
-471
lines changed

Some content is hidden

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

305 files changed

+50612
-471
lines changed

.github/CODEOWNERS

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
* @oneapi-src/unified-runtime-maintain
2+
3+
# Level Zero adapter
4+
source/adapters/level_zero @oneapi-src/unified-runtime-level-zero-write
5+
6+
# CUDA and HIP adapters
7+
source/adapters/cuda @oneapi-src/unified-runtime-cuda-write
8+
source/adapters/hip @oneapi-src/unified-runtime-hip-write
9+
10+
# OpenCL adapter
11+
source/adapters/opencl @oneapi-src/unified-runtime-opencl-write
12+
13+
# Native CPU adapter
14+
source/adapters/native_cpu @oneapi-src/unified-runtime-native-cpu-write
15+
16+
# Command-buffer experimental feature
17+
source/adapters/**/command_buffer.* @oneapi-src/unified-runtime-command-buffer-write
18+
scripts/core/EXP-COMMAND-BUFFER.rst @oneapi-src/unified-runtime-command-buffer-write
19+
scripts/core/exp-command-buffer.yml @oneapi-src/unified-runtime-command-buffer-write
20+
21+
# Bindless Images experimental feature
22+
scripts/core/EXP-BINDLESS-IMAGES.rst @oneapi-src/unified-runtime-bindless-images-write
23+
scripts/core/exp-bindless-images.yml @oneapi-src/unified-runtime-bindless-images-write
24+
source/adapters/**/image.* @oneapi-src/unified-runtime-bindless-images-write

.github/scripts/get_system_info.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2023 Intel Corporation
4+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See LICENSE.TXT
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
8+
# get_system_info.sh - Script for printing system info
9+
10+
function check_L0_version {
11+
if command -v dpkg &> /dev/null; then
12+
dpkg -l | grep level-zero && return
13+
fi
14+
15+
if command -v rpm &> /dev/null; then
16+
rpm -qa | grep level-zero && return
17+
fi
18+
19+
if command -v zypper &> /dev/null; then
20+
zypper se level-zero && return
21+
fi
22+
23+
echo "level-zero not installed"
24+
}
25+
26+
function system_info {
27+
echo "**********system_info**********"
28+
cat /etc/os-release | grep -oP "PRETTY_NAME=\K.*"
29+
cat /proc/version
30+
echo "**********SYCL-LS**********"
31+
source /opt/intel/oneapi/setvars.sh
32+
sycl-ls
33+
echo "**********VGA**********"
34+
lspci | grep VGA
35+
echo "**********CUDA Version**********"
36+
if command -v nvidia-smi &> /dev/null; then
37+
nvidia-smi
38+
else
39+
echo "CUDA not installed"
40+
fi
41+
echo "**********L0 Version**********"
42+
check_L0_version
43+
echo "**********ROCm Version**********"
44+
if command -v rocminfo &> /dev/null; then
45+
rocminfo
46+
else
47+
echo "ROCm not installed"
48+
fi
49+
echo "**********/proc/cmdline**********"
50+
cat /proc/cmdline
51+
echo "**********CPU info**********"
52+
lscpu
53+
echo "**********/proc/meminfo**********"
54+
cat /proc/meminfo
55+
echo "**********build/bin/urinfo**********"
56+
$(dirname "$(readlink -f "$0")")/../../build/bin/urinfo || true
57+
echo "******OpenCL*******"
58+
# The driver version of OpenCL Graphics is the compute-runtime version
59+
clinfo || echo "OpenCL not installed"
60+
echo "**********list-environment**********"
61+
echo "PATH=$PATH"
62+
echo
63+
echo "CPATH=$CPATH"
64+
echo
65+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
66+
echo
67+
echo "LIBRARY_PATH=$LIBRARY_PATH"
68+
echo
69+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
70+
echo
71+
echo "******list-build-system-versions*******"
72+
gcc --version 2>/dev/null || true
73+
echo
74+
clang --version 2>/dev/null || true
75+
echo
76+
make --version 2>/dev/null || true
77+
echo "**********/proc/modules**********"
78+
cat /proc/modules
79+
echo "***************installed-packages***************"
80+
# Instructions below will return some minor errors, as they are dependent on the Linux distribution.
81+
zypper se --installed-only 2>/dev/null || true
82+
apt list --installed 2>/dev/null || true
83+
yum list installed 2>/dev/null || true
84+
}
85+
86+
# Call the function above to print system info.
87+
system_info

.github/workflows/bandit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Bandit
33

44
on: [push, pull_request, workflow_dispatch]
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
610
jobs:
711
linux:
812
name: Bandit

.github/workflows/cmake.yml

Lines changed: 209 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Build and test
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
59
jobs:
610
ubuntu-build:
711
name: Build - Ubuntu
@@ -58,26 +62,42 @@ jobs:
5862
cd ..
5963
6064
- name: Download DPC++
65+
if: matrix.os == 'ubuntu-22.04'
6166
run: |
6267
sudo apt install libncurses5
63-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
64-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
68+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
69+
mkdir -p ${{github.workspace}}/dpcpp_compiler
70+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
6571
6672
- name: Configure CMake
73+
if: matrix.os == 'ubuntu-22.04'
6774
run: >
6875
cmake
6976
-B${{github.workspace}}/build
7077
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
7178
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
7279
-DUR_ENABLE_TRACING=ON
73-
-DUR_DEVELOPER_MODE=ON
7480
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
7581
-DUR_BUILD_TESTS=ON
7682
-DUR_FORMAT_CPP_STYLE=ON
7783
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
7884
${{matrix.libbacktrace}}
7985
${{matrix.pool_tracking}}
8086
87+
- name: Configure CMake
88+
if: matrix.os == 'ubuntu-20.04'
89+
run: >
90+
cmake
91+
-B${{github.workspace}}/build
92+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
93+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
94+
-DUR_ENABLE_TRACING=ON
95+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
96+
-DUR_BUILD_TESTS=ON
97+
-DUR_FORMAT_CPP_STYLE=ON
98+
${{matrix.libbacktrace}}
99+
${{matrix.pool_tracking}}
100+
81101
- name: Generate source from spec, check for uncommitted diff
82102
if: matrix.os == 'ubuntu-22.04'
83103
run: cmake --build ${{github.workspace}}/build --target check-generated
@@ -92,11 +112,192 @@ jobs:
92112
working-directory: ${{github.workspace}}/build
93113
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
94114

115+
fuzztest-build:
116+
name: Build and run quick fuzztest scenarios
117+
strategy:
118+
matrix:
119+
build_type: [Debug, Release]
120+
compiler: [{c: clang, cxx: clang++}]
121+
122+
runs-on: 'ubuntu-22.04'
123+
124+
steps:
125+
- uses: actions/checkout@v3
126+
127+
- name: Install pip packages
128+
run: pip install -r third_party/requirements.txt
129+
130+
- name: Download DPC++
131+
run: |
132+
sudo apt install libncurses5
133+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
134+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
135+
136+
- name: Setup DPC++
137+
run: |
138+
source ${{github.workspace}}/dpcpp_compiler/startup.sh
139+
140+
- name: Configure CMake
141+
run: >
142+
cmake
143+
-B${{github.workspace}}/build
144+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
145+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
146+
-DUR_ENABLE_TRACING=ON
147+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
148+
-DUR_BUILD_TESTS=ON
149+
-DUR_USE_ASAN=ON
150+
-DUR_USE_UBSAN=ON
151+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
152+
153+
- name: Build
154+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
155+
156+
- name: Fuzz test
157+
working-directory: ${{github.workspace}}/build
158+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short"
159+
160+
adapter-build-hw:
161+
name: Build - Adapters on HW
162+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
163+
strategy:
164+
matrix:
165+
adapter: [
166+
{name: CUDA, triplet: nvptx64-nvidia-cuda, platform: ""},
167+
{name: HIP, triplet: amdgcn-amd-amdhsa, platform: ""},
168+
{name: L0, triplet: spir64, platform: ""},
169+
{name: OPENCL, triplet: spir64, platform: "Intel(R) OpenCL"}
170+
]
171+
build_type: [Debug, Release]
172+
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
173+
174+
runs-on: ${{matrix.adapter.name}}
175+
176+
steps:
177+
- uses: actions/checkout@v3
178+
179+
- name: Install pip packages
180+
run: pip install -r third_party/requirements.txt
181+
182+
- name: Download DPC++
183+
run: |
184+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
185+
mkdir dpcpp_compiler
186+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
187+
188+
- name: Configure CMake
189+
run: >
190+
cmake
191+
-B${{github.workspace}}/build
192+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
193+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
194+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
195+
-DUR_ENABLE_TRACING=ON
196+
-DUR_DEVELOPER_MODE=ON
197+
-DUR_BUILD_TESTS=ON
198+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
199+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
200+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
201+
-DUR_CONFORMANCE_TARGET_TRIPLES=${{matrix.adapter.triplet}}
202+
${{ matrix.adapter.name == 'HIP' && '-DAMD_ARCH=gfx1030' || '' }}
203+
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
204+
205+
- name: Build
206+
# This is so that device binaries can find the sycl runtime library
207+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
208+
209+
- name: Test adapter specific
210+
working-directory: ${{github.workspace}}/build
211+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
212+
213+
# Temporarily disabling platform test for L0, because of hang
214+
# See issue: #824
215+
- name: Test L0 adapter
216+
if: matrix.adapter.name == 'L0'
217+
working-directory: ${{github.workspace}}/build
218+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "platform-adapter_level_zero" --timeout 180
219+
220+
- name: Test adapters
221+
if: matrix.adapter.name != 'L0'
222+
working-directory: ${{github.workspace}}/build
223+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
224+
225+
- name: Get information about platform
226+
if: ${{ always() }}
227+
run: .github/scripts/get_system_info.sh
228+
229+
examples-build-hw:
230+
name: Build - examples on HW
231+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
232+
strategy:
233+
matrix:
234+
adapter: [
235+
{name: L0}
236+
]
237+
build_type: [Debug, Release]
238+
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
239+
240+
runs-on: ${{matrix.adapter.name}}
241+
242+
steps:
243+
- uses: actions/checkout@v3
244+
245+
- name: Install pip packages
246+
run: pip install -r third_party/requirements.txt
247+
248+
- name: Init conda env
249+
uses: conda-incubator/setup-miniconda@v2
250+
with:
251+
miniconda-version: "latest"
252+
activate-environment: examples
253+
environment-file: third_party/deps.yml
254+
auto-activate-base: false
255+
256+
- name: Configure CMake
257+
shell: bash -el {0}
258+
run: >
259+
cmake
260+
-B${{github.workspace}}/build
261+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
262+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
263+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
264+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
265+
-DUR_BUILD_EXAMPLE_CODEGEN=ON
266+
-DUR_DEVELOPER_MODE=ON
267+
268+
- name: Build
269+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
270+
271+
- name: Test codegen example
272+
working-directory: ${{github.workspace}}/build
273+
run: bin/codegen
274+
275+
# conda init adds content to user's profile making it failing (if conda is gone)
276+
- name: Cleanup after conda init
277+
run: |
278+
cat ${HOME}/.profile || true
279+
rm ${HOME}/.profile || true
280+
281+
- name: Get information about platform
282+
if: ${{ always() }}
283+
run: .github/scripts/get_system_info.sh
284+
95285
windows-build:
96286
name: Build - Windows
97287
strategy:
98288
matrix:
99289
os: ['windows-2019', 'windows-2022']
290+
adapter: [
291+
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
292+
]
293+
294+
# TODO: building level zero loader on windows-2019 and clang-cl is currently broken
295+
exclude:
296+
- os: 'windows-2019'
297+
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
298+
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
299+
compiler: {c: clang-cl, cxx: clang-cl}
300+
100301
build_type: [Debug, Release]
101302
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
102303
include:
@@ -133,10 +334,12 @@ jobs:
133334
-DUR_DEVELOPER_MODE=ON
134335
-DUR_BUILD_TESTS=ON
135336
-DUR_FORMAT_CPP_STYLE=ON
337+
${{matrix.adapter.var}}
136338
137-
- name: Generate source from spec, check for uncommitted diff
138-
if: matrix.os == 'windows-2022'
139-
run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
339+
# TODO: re-enable when check-generated is fixed for windows runners see #888
340+
# - name: Generate source from spec, check for uncommitted diff
341+
# if: matrix.os == 'windows-2022'
342+
# run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
140343

141344
- name: Build all
142345
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS

0 commit comments

Comments
 (0)