Skip to content

Commit ccbe350

Browse files
committed
Add sycl compatibility workflow
1 parent 4c54366 commit ccbe350

File tree

2 files changed

+198
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)