Skip to content

Commit d52e7bc

Browse files
sbalint98nilsfriess
authored andcommitted
Initial CI for hipSYCL
1 parent 722f6c5 commit d52e7bc

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/linux.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Linux build and test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test-clang-based:
7+
name: clang ${{ matrix.clang_version }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
clang_version: [13]
12+
rocm_version: ['5.1.1']
13+
os: [ubuntu-20.04, ubuntu-18.04]
14+
cuda: [11.0]
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
submodules: 'recursive'
19+
- name: install CUDA 11.0
20+
if: matrix.cuda == 11.0
21+
run: |
22+
mkdir -p /opt/hipSYCL/cuda
23+
wget -q -O cuda.sh http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda_11.0.2_450.51.05_linux.run
24+
sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/hipSYCL/cuda || true
25+
echo "CUDA Version 11.0.0" | sudo tee /opt/hipSYCL/cuda/version.txt
26+
- name: install ROCm
27+
run: |
28+
sudo apt install libnuma-dev cmake unzip
29+
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
30+
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}} xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list
31+
sudo apt update
32+
sudo apt install rocm-dev
33+
- name: install LLVM
34+
run: |
35+
wget https://apt.llvm.org/llvm.sh
36+
chmod +x llvm.sh
37+
sudo ./llvm.sh ${{matrix.clang_version}}
38+
sudo apt install libclang-${{matrix.clang_version}}-dev clang-tools-${{matrix.clang_version}} libomp-${{matrix.clang_version}}-dev
39+
- name: install boost (from source)
40+
if: matrix.os == 'ubuntu-18.04'
41+
run: |
42+
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.zip
43+
unzip boost_1_70_0.zip
44+
cd boost_1_70_0
45+
./bootstrap.sh --prefix=/usr
46+
sudo ./b2 link=static,shared install -j$(nproc) || true
47+
cd ..
48+
- name: install boost (from apt)
49+
if: matrix.os == 'ubuntu-20.04'
50+
run: |
51+
sudo apt install libboost-all-dev
52+
- name: build hipSYCL
53+
run: |
54+
git clone https://github.com/illuhad/hipSYCL.git
55+
cd hipSYCL
56+
mkdir build && cd build
57+
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang_version}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang_version}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/hipSYCL/cuda -DROCM_PATH=/opt/rocm ..
58+
make -j2 install
59+
cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so
60+
cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1
61+
- name: build CPU tests
62+
run: |
63+
mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu
64+
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu
65+
cmake -DHIPSYCL_TARGETS="omp" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests
66+
make -j2
67+
- name: build CUDA tests
68+
run: |
69+
mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda
70+
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda
71+
cmake -DHIPSYCL_TARGETS="cuda:sm_60" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests
72+
make -j2
73+
- name: build ROCm tests
74+
run: |
75+
mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm
76+
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm
77+
cmake -DHIPSYCL_PLATFORM=rocm -DHIPSYCL_GPU_ARCH=gfx906 -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests
78+
make -j2
79+
- name: run CPU tests
80+
run: |
81+
cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu
82+
LD_LIBRARY_PATH=/home/runner/work/hipSYCL/hipSYCL/build/install/lib ./sycl_tests

0 commit comments

Comments
 (0)