Skip to content

Commit b65f9d7

Browse files
authored
Merge branch 'adapters' into ext_oneapi_queue_priority-hip
2 parents b4a7c8c + fe5bc76 commit b65f9d7

File tree

252 files changed

+15724
-8128
lines changed

Some content is hidden

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

252 files changed

+15724
-8128
lines changed

.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/cmake.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ jobs:
163163
strategy:
164164
matrix:
165165
adapter: [
166-
{name: CUDA, triplet: nvptx64-nvidia-cuda},
167-
{name: HIP, triplet: amdgcn-amd-amdhsa},
168-
{name: L0, triplet: spir64}
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"}
169170
]
170171
build_type: [Debug, Release]
171172
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
@@ -219,7 +220,11 @@ jobs:
219220
- name: Test adapters
220221
if: matrix.adapter.name != 'L0'
221222
working-directory: ${{github.workspace}}/build
222-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
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
223228

224229
examples-build-hw:
225230
name: Build - examples on HW
@@ -273,6 +278,10 @@ jobs:
273278
cat ${HOME}/.profile || true
274279
rm ${HOME}/.profile || true
275280
281+
- name: Get information about platform
282+
if: ${{ always() }}
283+
run: .github/scripts/get_system_info.sh
284+
276285
windows-build:
277286
name: Build - Windows
278287
strategy:
@@ -282,12 +291,18 @@ jobs:
282291
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
283292
]
284293

285-
# TODO: building level zero loader on windows-2019 is currently broken
294+
# TODO: building level zero loader on windows-2019 and clang-cl is currently broken
286295
exclude:
287296
- os: 'windows-2019'
288297
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+
289301
build_type: [Debug, Release]
290-
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"
291306
runs-on: ${{matrix.os}}
292307

293308
steps:
@@ -300,10 +315,18 @@ jobs:
300315
- name: Install prerequisites
301316
run: python3 -m pip install -r third_party/requirements.txt
302317

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+
303325
- name: Configure CMake
304326
run: >
305327
cmake
306328
-B${{github.workspace}}/build
329+
${{matrix.toolset}}
307330
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
308331
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
309332
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
@@ -319,7 +342,7 @@ jobs:
319342
# run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
320343

321344
- name: Build all
322-
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
323346

324347
- name: Test
325348
working-directory: ${{github.workspace}}/build

.github/workflows/coverage.yml

Lines changed: 78 additions & 0 deletions
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

Lines changed: 119 additions & 0 deletions
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

0 commit comments

Comments
 (0)