Skip to content

Commit 25ecef4

Browse files
committed
Add sycl compatibility workflow
1 parent 042b66d commit 25ecef4

File tree

2 files changed

+201
-0
lines changed

2 files changed

+201
-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: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: SYCL
2+
3+
on:
4+
workflow_call:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
last-release:
13+
# run only on upstream; forks will not have the HW
14+
# currently this job is disabled as sycl-ls doesn't detect devices on the last release + latest UMF
15+
if: github.repository == 'oneapi-src/unified-memory-framework' && false
16+
name: Last release
17+
runs-on: [DSS-LEVEL_ZERO, DSS-UBUNTU]
18+
19+
steps:
20+
# Install sycl
21+
- name: Download latest llvm release
22+
run: |
23+
latest_release=$(curl -s https://api.github.com/repos/intel/llvm/releases/latest | grep "tag_name" | cut -d '"' -f 4)
24+
download_url="https://github.com/intel/llvm/archive/refs/tags/${latest_release}.tar.gz"
25+
wget --no-verbose $download_url -O sycl_linux.tar.gz
26+
27+
- name: Extract llvm
28+
run: |
29+
mkdir sycl_repo
30+
tar -xzf sycl_linux.tar.gz -C sycl_repo --strip-components=1
31+
32+
- name: Build llvm
33+
working-directory: sycl_repo
34+
run: |
35+
python3 buildbot/configure.py
36+
python3 buildbot/compile.py -j $(nproc)
37+
38+
- name: Add llvm install directory to environment
39+
run: |
40+
echo "SYCL_INSTALL_DIR=${{ github.workspace }}/sycl_repo/build/install" >> $GITHUB_ENV
41+
42+
- name: Add llvm to PATH
43+
run: |
44+
echo "${{ github.workspace }}/llvm/bin:$PATH" >> $GITHUB_PATH
45+
echo "LD_LIBRARY_PATH=${{env.SYCL_INSTALL_DIR}}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
46+
47+
- name: Remove UMF installed with llvm
48+
run: rm -f ${{env.SYCL_INSTALL_DIR}}/lib/libumf*
49+
50+
- name: Print installed sycl files
51+
run: |
52+
tree -L 2 ${{env.SYCL_INSTALL_DIR}}
53+
54+
# Install UMF
55+
- name: Checkout UMF
56+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
57+
with:
58+
path: umf_repo
59+
fetch-depth: 0
60+
61+
- name: Configure UMF
62+
working-directory: umf_repo
63+
run: >
64+
cmake
65+
-B build
66+
-DCMAKE_INSTALL_PREFIX=${{ env.SYCL_INSTALL_DIR }}
67+
-DCMAKE_BUILD_TYPE=Release
68+
-DCMAKE_C_COMPILER=gcc
69+
-DCMAKE_CXX_COMPILER=g++
70+
-DUMF_BUILD_SHARED_LIBRARY=ON
71+
-DUMF_BUILD_TESTS=OFF
72+
-DUMF_BUILD_EXAMPLES=OFF
73+
74+
- name: Build and install UMF
75+
working-directory: umf_repo
76+
run: cmake --build build --target install -j$(nproc)
77+
78+
- name: Print installed lib files
79+
run: ls -l ${{env.SYCL_INSTALL_DIR}}/lib
80+
81+
# Test sycl
82+
- name: Run sycl-ls
83+
run: |
84+
${{env.SYCL_INSTALL_DIR}}/bin/sycl-ls
85+
86+
- name: Print clang++ version
87+
run: clang++ --version
88+
89+
- name: Run sycl tests built locally
90+
working-directory: sycl_repo
91+
run: |
92+
${{env.SYCL_INSTALL_DIR}}/bin/clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o submit-kernel -I${{env.SYCL_INSTALL_DIR}}/include -I${{env.SYCL_INSTALL_DIR}}/include/sycl
93+
ONEAPI_DEVICE_SELECTOR=level_zero:gpu ./submit-kernel
94+
95+
- name: Clean up
96+
if: always()
97+
run: rm -rf llvm sycl_repo sycl_linux.tar.gz
98+
99+
latest-daily:
100+
# run only on upstream; forks will not have the HW
101+
if: github.repository == 'oneapi-src/unified-memory-framework'
102+
name: Latest daily build
103+
runs-on: ["DSS-LEVEL_ZERO", "DSS-UBUNTU"]
104+
105+
steps:
106+
# Install sycl
107+
- name: Download latest llvm daily release
108+
run: |
109+
latest_tag=$(curl -s https://api.github.com/repos/intel/llvm/releases | awk -F'"' '/"tag_name":/ {print $4; exit}')
110+
download_url="https://github.com/intel/llvm/releases/download/${latest_tag}/sycl_linux.tar.gz"
111+
wget --no-verbose $download_url -O sycl_linux.tar.gz
112+
113+
- name: Extract llvm
114+
run: |
115+
mkdir llvm
116+
tar -xzf sycl_linux.tar.gz -C llvm --strip-components=1
117+
118+
- name: Add sycl to PATH
119+
run: |
120+
echo "${{ github.workspace }}/llvm/bin:$PATH" >> $GITHUB_PATH
121+
echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
122+
123+
# Install UMF
124+
- name: Checkout UMF
125+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126+
with:
127+
path: umf_repo
128+
fetch-depth: 0
129+
130+
- name: Configure UMF
131+
working-directory: umf_repo
132+
run: >
133+
cmake
134+
-B build
135+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/llvm
136+
-DCMAKE_BUILD_TYPE=Release
137+
-DCMAKE_C_COMPILER=gcc
138+
-DCMAKE_CXX_COMPILER=g++
139+
-DUMF_BUILD_SHARED_LIBRARY=ON
140+
-DUMF_BUILD_TESTS=OFF
141+
-DUMF_BUILD_EXAMPLES=OFF
142+
143+
- name: Remove UMF installed with llvm
144+
run: rm -f llvm/lib/libumf*
145+
146+
- name: Build and install UMF
147+
working-directory: umf_repo
148+
run: cmake --build build --target install -j$(nproc)
149+
150+
- name: Print installed lib files
151+
run: ls -l llvm/lib
152+
153+
# Test sycl-ls
154+
- name: Run sycl-ls
155+
run: |
156+
./llvm/bin/sycl-ls
157+
158+
# Test several sycl e2e test
159+
- name: Checkout sycl
160+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
161+
with:
162+
repository: intel/llvm
163+
path: sycl_repo
164+
fetch-depth: 1
165+
ref: sycl
166+
167+
- name: Create sycl tests build directory
168+
run: |
169+
TESTS_BUILD_DIR=${{ github.workspace }}/sycl_repo/sycl/test-e2e/build
170+
mkdir $TESTS_BUILD_DIR
171+
echo "TESTS_BUILD_DIR=$TESTS_BUILD_DIR" >> $GITHUB_ENV
172+
173+
- name: Build sycl e2e tests
174+
working-directory: sycl_repo
175+
run: |
176+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/AbiNeutral/submit-kernel.cpp -o ${{env.TESTS_BUILD_DIR}}/submit-kernel -Iinclude
177+
${{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
178+
${{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
179+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/Basic/build_log.cpp -o ${{env.TESTS_BUILD_DIR}}/build_log -Iinclude
180+
${{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
181+
${{github.workspace}}/llvm/bin/clang++ -fsycl sycl/test-e2e/USM/fill_any_size.cpp -o ${{env.TESTS_BUILD_DIR}}/fill_any_size -Iinclude
182+
183+
- name: Run sycl e2e tests
184+
env:
185+
ONEAPI_DEVICE_SELECTOR: level_zero:gpu
186+
UMF_LOG: "level:debug;flush:debug;output:stdout;pid:yes"
187+
working-directory: ${{env.TESTS_BUILD_DIR}}
188+
run: |
189+
./submit-kernel
190+
./interop-l0-direct
191+
./level_zero_interop_memcpy
192+
./build_log
193+
./parallel_for_range_roundup
194+
./fill_any_size
195+
196+
- name: Clean up
197+
if: always()
198+
run: rm -rf llvm sycl_linux.tar.gz

0 commit comments

Comments
 (0)