Skip to content

Commit 43256fe

Browse files
committed
Add sycl compatibility workflow
1 parent 042b66d commit 43256fe

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,6 @@ jobs:
324324
pr_no: '0'
325325
bench_script_params: '--save baseline'
326326
upload_report: true
327+
328+
SYCL:
329+
uses: ./.github/workflows/reusable_sycl.yml
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: SYCL
2+
3+
on:
4+
workflow_call:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
latest-release:
13+
# run only on upstream; forks will not have the HW
14+
if: github.repository == 'oneapi-src/unified-memory-framework' && false
15+
name: Latest release
16+
runs-on: [DSS-LEVEL_ZERO, DSS-UBUNTU]
17+
18+
steps:
19+
# - name: Install apt packages
20+
# run: |
21+
# sudo apt-get update
22+
# sudo apt-get install -y cmake libhwloc-dev ninja-build python3 wget
23+
24+
# Install UMF
25+
- name: Checkout UMF
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
path: umf_repo
29+
fetch-depth: 0
30+
31+
- name: Configure UMF
32+
working-directory: umf_repo
33+
run: >
34+
cmake
35+
-B build
36+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/umf_install
37+
-DCMAKE_BUILD_TYPE=Release
38+
-DCMAKE_C_COMPILER=gcc
39+
-DCMAKE_CXX_COMPILER=g++
40+
-DUMF_BUILD_SHARED_LIBRARY=ON
41+
-DUMF_BUILD_TESTS=OFF
42+
-DUMF_BUILD_EXAMPLES=OFF
43+
44+
- name: Build and install UMF
45+
working-directory: umf_repo
46+
run: cmake --build build --target install -j$(nproc)
47+
48+
# Build SYCL
49+
- name: Download latest SYCL release
50+
run: |
51+
latest_release=$(curl -s https://api.github.com/repos/intel/llvm/releases/latest | grep "tag_name" | cut -d '"' -f 4)
52+
download_url="https://github.com/intel/llvm/archive/refs/tags/${latest_release}.tar.gz"
53+
wget --no-verbose $download_url -O sycl_linux.tar.gz
54+
55+
- name: Extract SYCL
56+
run: |
57+
mkdir llvm
58+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
59+
60+
- name: Add sycl to environment variables
61+
run: |
62+
echo "${{ github.workspace }}/llvm/bin:$PATH" >> $GITHUB_PATH
63+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
64+
65+
- name: Build SYCL
66+
working-directory: llvm
67+
run: |
68+
python3 buildbot/configure.py
69+
python3 buildbot/compile.py -j $(nproc)
70+
71+
- name: Copy latest UMF to sycl
72+
run: echo "Copy latest UMF to sycl"
73+
74+
- name: Run sycl-ls
75+
run: echo "Run sycl-ls"
76+
77+
latest-daily:
78+
# run only on upstream; forks will not have the HW
79+
if: github.repository == 'oneapi-src/unified-memory-framework'
80+
name: Latest daily build
81+
runs-on: ["DSS-LEVEL_ZERO", "DSS-UBUNTU"]
82+
83+
steps:
84+
# - name: Install apt packages
85+
# run: |
86+
# sudo apt-get update
87+
# sudo apt-get install -y cmake libhwloc-dev ninja-build python3 wget
88+
89+
# Install SYCL
90+
- name: Clean up
91+
run: rm -rf llvm sycl_linux.tar.gz
92+
93+
- name: Download latest SYCL daily release
94+
run: |
95+
latest_tag=$(curl -s https://api.github.com/repos/intel/llvm/releases | awk -F'"' '/"tag_name":/ {print $4; exit}')
96+
download_url="https://github.com/intel/llvm/releases/download/${latest_tag}/sycl_linux.tar.gz"
97+
wget --no-verbose $download_url -O sycl_linux.tar.gz
98+
99+
- name: Extract SYCL
100+
run: |
101+
mkdir llvm
102+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
103+
104+
- name: Add sycl to environment variables
105+
run: |
106+
echo "${{ github.workspace }}/llvm/bin:$PATH" >> $GITHUB_PATH
107+
echo "export LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
108+
109+
# Install UMF
110+
- name: Checkout UMF
111+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
112+
with:
113+
path: umf_repo
114+
fetch-depth: 0
115+
116+
- name: Configure UMF
117+
working-directory: umf_repo
118+
run: >
119+
cmake
120+
-B build
121+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
122+
-DCMAKE_BUILD_TYPE=Release
123+
-DCMAKE_C_COMPILER=gcc
124+
-DCMAKE_CXX_COMPILER=g++
125+
-DUMF_BUILD_SHARED_LIBRARY=ON
126+
-DUMF_BUILD_TESTS=OFF
127+
-DUMF_BUILD_EXAMPLES=OFF
128+
129+
- name: Remove UMF installed with SYCL
130+
run: rm -f llvm/lib/libumf*
131+
132+
- name: Build and install UMF
133+
working-directory: umf_repo
134+
run: cmake --build build --target install -j$(nproc)
135+
136+
- name: Print installed lib files
137+
run: ls -l llvm/lib
138+
139+
# Test sycl-ls
140+
- name: Run sycl-ls
141+
run: |
142+
./llvm/bin/sycl-ls
143+
144+
# Test several sycl e2e test
145+
- name: Checkout sycl
146+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
147+
with:
148+
repository: intel/llvm
149+
path: sycl_repo
150+
fetch-depth: 1
151+
ref: sycl
152+
153+
- name: Build standalone tests
154+
working-directory: sycl_repo/sycl/test-e2e
155+
run: >
156+
cmake
157+
-B build
158+
-DCMAKE_CXX_COMPILER=clang++
159+
-DSYCL_TEST_E2E_TARGETS="level_zero:gpu"
160+
161+
- name: Run standalone tests
162+
working-directory: sycl_repo/sycl/test-e2e
163+
run: cmake --build build --target check-sycl-e2e
164+
165+
- name: Run sycl tests built locally
166+
working-directory: sycl_repo
167+
run: |
168+
clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o submit-kernel
169+
ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./submit-kernel
170+
171+
- name: Run llvm-lit sycl tests
172+
working-directory: sycl_repo
173+
run: |
174+
llvm-lit --param sycl_devices="level_zero:gpu" sycl/test-e2e

0 commit comments

Comments
 (0)