Skip to content

Commit 37d97ab

Browse files
Add a workflow to install nightly intel/llvm + drivers
Build dpctl with that Use OCL_ICD_FILENAMES to inform plugin of CPU driver location
1 parent d469c84 commit 37d97ab

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build with Open Source LLVM-Sycl compiler
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
install-compiler:
9+
name: Install Nightly build of DPC++ toolchain
10+
runs-on: ubuntu-20.04
11+
12+
env:
13+
OCLCPUEXP_FN: oclcpuexp-2021.12.6.0.19_rel.tar.gz
14+
FPGAEMU_FN: fpgaemu-2021.12.6.0.19_rel.tar.gz
15+
TBB_FN: oneapi-tbb-2021.4.0-lin.tgz
16+
17+
steps:
18+
- name: Cancel Previous Runs
19+
uses: styfle/cancel-workflow-action@0.6.0
20+
with:
21+
access_token: ${{ github.token }}
22+
23+
- name: Cache sycl bundle
24+
id: cache-sycl-bundle
25+
uses: actions/cache@v2
26+
with:
27+
path: |
28+
/home/runner/work/sycl_bundle
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/sycl_bundle/*') }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-
32+
${{ runner.os }}-build-
33+
${{ runner.os }}-
34+
35+
- name: Download nightly and components
36+
shell: bash -l {0}
37+
run: |
38+
cd /home/runner/work
39+
mkdir -p sycl_bundle
40+
cd sycl_bundle
41+
git clone http://github.com/intel/llvm.git llvm_src
42+
cd llvm_src
43+
export NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.argv[1]))" $(git tag | sort -V | tail -1))
44+
cd ..
45+
export DOWNLOAD_URL_PREFIX=https://github.com/intel/llvm/releases/download
46+
wget ${DOWNLOAD_URL_PREFIX}/${NIGHTLY_TAG}/dpcpp-compiler.tar.gz
47+
wget ${DOWNLOAD_URL_PREFIX}/2021-07/${OCLCPUEXP_FN}
48+
wget ${DOWNLOAD_URL_PREFIX}/2021-07/${FPGAEMU_FN}
49+
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.4.0/${TBB_FN}
50+
51+
- name: Install system components
52+
shell: bash -l {0}
53+
run: |
54+
sudo apt-get install cmake libtinfo5
55+
56+
- name: Setup Python
57+
uses: actions/setup-python@v2
58+
with:
59+
python-version: '3.9'
60+
architecture: x64
61+
62+
- name: Install dpctl dependencies
63+
shell: bash -l {0}
64+
run: |
65+
pip install numpy cython setuptools pytest
66+
67+
- name: install nightly
68+
shell: bash -l {0}
69+
run: |
70+
cd /home/runner/work/sycl_bundle
71+
tar xf dpcpp-compiler.tar.gz
72+
mkdir -p oclcpuexp
73+
mkdir -p fpgaemu
74+
mkdir -p tbb
75+
tar xf ${OCLCPUEXP_FN} -C oclcpuexp
76+
tar xf ${FPGAEMU_FN} -C fpgaemu
77+
tar xf ${TBB_FN}
78+
mkdir -p dpcpp_compiler/lib
79+
mkdir -p dpcpp_compiler/lib/oclfpga
80+
touch dpcpp_compiler/lib/oclfpga/fpgavars.sh
81+
82+
- name: Checkout repo
83+
uses: actions/checkout@v2
84+
with:
85+
fetch-depth: 0
86+
87+
- name: build dpctl
88+
shell: bash -l {0}
89+
run: |
90+
export SYCL_BUNDLE_FOLDER=/home/runner/work/sycl_bundle
91+
source ${SYCL_BUNDLE_FOLDER}/dpcpp_compiler/startup.sh
92+
export LD_LIBRARY_PATH=${SYCL_BUNDLE_FOLDER}/oclcpuexp/x64:${LD_LIBRARY_PATH}
93+
export LD_LIBRARY_PATH=${SYCL_BUNDLE_FOLDER}/fpgaemu/x64:${LD_LIBRARY_PATH}
94+
export LD_LIBRARY_PATH=${SYCL_BUNDLE_FOLDER}/oneapi-tbb-2021.4.0/lib/intel64/gcc4.8:${LD_LIBRARY_PATH}
95+
export OCL_ICD_FILENAMES=libintelocl.so:libintelocl_emu.so
96+
clang++ --version
97+
sycl-ls
98+
python setup.py develop --sycl-compiler-prefix=$(dirname $(dirname `which clang++`))
99+
python -m pytest -v dpctl/tests

0 commit comments

Comments
 (0)