Skip to content

Commit b96c319

Browse files
committed
Add sycl compatibility workflow
1 parent a7bb7dc commit b96c319

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,6 @@ jobs:
323323
pr_no: '0'
324324
bench_script_params: '--save baseline'
325325
upload_report: true
326+
327+
SYCL:
328+
uses: ./.github/workflows/reusable_sycl.yml
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: SYCL
2+
3+
on: workflow_call
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
sycl-compatibility:
10+
# run only on upstream; forks will not have the HW
11+
if: github.repository == 'oneapi-src/unified-memory-framework'
12+
name: ${{matrix.llvm_tag}} llvm build
13+
runs-on: ["DSS-LEVEL_ZERO", "DSS-UBUNTU"]
14+
15+
strategy:
16+
matrix:
17+
llvm_tag: ["latest", "nightly-2025-02-08"] # "latest" or llvm with UMF v0.11.0-dev2
18+
19+
steps:
20+
# Install sycl
21+
- name: Download llvm daily release
22+
run: |
23+
if [ "${{ matrix.llvm_tag }}" == "latest" ]; then
24+
llvm_tag=$(curl -s https://api.github.com/repos/intel/llvm/releases | awk -F'"' '/"tag_name":/ {print $4; exit}')
25+
else
26+
llvm_tag="${{ matrix.llvm_tag }}"
27+
fi
28+
download_url="https://github.com/intel/llvm/releases/download/${llvm_tag}/sycl_linux.tar.gz"
29+
wget --no-verbose $download_url -O sycl_linux.tar.gz
30+
31+
- name: Extract llvm
32+
run: |
33+
mkdir llvm
34+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
35+
36+
- name: Add sycl to PATH
37+
run: |
38+
echo "${{ github.workspace }}/llvm/bin:$PATH" >> $GITHUB_PATH
39+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
40+
41+
# Install UMF
42+
- name: Checkout UMF
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
with:
45+
path: umf_repo
46+
fetch-depth: 0
47+
48+
- name: Configure UMF
49+
working-directory: umf_repo
50+
run: >
51+
cmake
52+
-B build
53+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
54+
-DCMAKE_BUILD_TYPE=Release
55+
-DCMAKE_C_COMPILER=gcc
56+
-DCMAKE_CXX_COMPILER=g++
57+
-DUMF_BUILD_SHARED_LIBRARY=ON
58+
-DUMF_BUILD_TESTS=OFF
59+
-DUMF_BUILD_EXAMPLES=OFF
60+
61+
- name: Remove UMF installed with llvm
62+
run: rm -f llvm/lib/libumf*
63+
64+
- name: Build and install UMF
65+
working-directory: umf_repo
66+
run: cmake --build build --target install -j$(nproc)
67+
68+
- name: Print installed lib files
69+
run: ls -l llvm/lib
70+
71+
# Test sycl-ls
72+
- name: Run sycl-ls
73+
run: |
74+
./llvm/bin/sycl-ls
75+
76+
# Test several sycl e2e test
77+
- name: Checkout sycl
78+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
79+
with:
80+
repository: intel/llvm
81+
path: sycl_repo
82+
fetch-depth: 1
83+
ref: sycl
84+
85+
- name: Create sycl tests build directory
86+
run: |
87+
TESTS_BUILD_DIR=${{ github.workspace }}/sycl_repo/sycl/test-e2e/build
88+
mkdir $TESTS_BUILD_DIR
89+
echo "TESTS_BUILD_DIR=$TESTS_BUILD_DIR" >> $GITHUB_ENV
90+
91+
- name: Build sycl e2e tests
92+
working-directory: sycl_repo
93+
run: |
94+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o ${{env.TESTS_BUILD_DIR}}/submit-kernel -Iinclude
95+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/Adapters/interop-l0-direct.cpp -o ${{env.TESTS_BUILD_DIR}}/interop-l0-direct -lze_loader -Iinclude
96+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/Adapters/level_zero_interop_memcpy.cpp -o ${{env.TESTS_BUILD_DIR}}/level_zero_interop_memcpy -Iinclude
97+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/Basic/build_log.cpp -o ${{env.TESTS_BUILD_DIR}}/build_log -Iinclude
98+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/PerformanceTests/ParallelFor/parallel_for_range_roundup.cpp -fsycl-range-rounding=force -o ${{env.TESTS_BUILD_DIR}}/parallel_for_range_roundup -Iinclude
99+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/USM/fill_any_size.cpp -o ${{env.TESTS_BUILD_DIR}}/fill_any_size -Iinclude
100+
101+
- name: Run sycl e2e tests
102+
env:
103+
ONEAPI_DEVICE_SELECTOR: level_zero:gpu
104+
UMF_LOG: "level:debug;flush:debug;output:stdout;pid:yes"
105+
working-directory: ${{env.TESTS_BUILD_DIR}}
106+
run: |
107+
echo "---Run submit-kernel test" && ./submit-kernel
108+
echo "---Run interop-l0-direct test" && ./interop-l0-direct
109+
echo "---Run level_zero_interop_memcpy test" && ./level_zero_interop_memcpy
110+
echo "---Run build_log test" && ./build_log
111+
echo "---Run parallel_for_range_roundup test" && ./parallel_for_range_roundup
112+
echo "---Run fill_any_size test" && ./fill_any_size
113+
114+
- name: Clean up
115+
if: always()
116+
run: rm -rf llvm sycl_linux.tar.gz

0 commit comments

Comments
 (0)