forked from uxlfoundation/oneMath
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (157 loc) · 6.77 KB
/
linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build tests with Open SYCL
on: [push, pull_request]
jobs:
test-with-hipsycl:
name: Run tests with Open SYCL
strategy:
matrix:
clang_version: [13]
rocm_version: ['5.1.1']
cuda_version: ['11.6']
os: [ubuntu-20.04, ubuntu-18.04]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: install ROCm
run: |
sudo apt install libnuma-dev cmake unzip
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/${{matrix.rocm_version}}/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
sudo apt update
sudo apt install rocm-dev rocblas
- name: install LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{matrix.clang_version}}
sudo apt install libclang-${{matrix.clang_version}}-dev clang-tools-${{matrix.clang_version}} libomp-${{matrix.clang_version}}-dev
- name: install boost from apt
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt update
sudo apt install libboost-all-dev
- name: install boost from source
if: matrix.os == 'ubuntu-18.04'
run: |
cd
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.zip
unzip boost_1_70_0.zip
cd boost_1_70_0
./bootstrap.sh --prefix=/usr
./b2
sudo ./b2 install -j4
- name: install CUDA
run: |
cd
wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run
sudo sh cuda_11.6.0_510.39.01_linux.run --override --silent --toolkit
cd
- name: test CUDA and cuBLAS version and fix path by symlink
run: |
/usr/local/cuda/bin/nvcc --version
echo $(ls /usr/local/cuda-11.6/targets/x86_64-linux/lib/stubs/libcuda*)
echo $LD_LIBRARY_PATH
sudo ln -s /usr/local/cuda-11.6/targets/x86_64-linux/lib/stubs/libcuda.so /usr/local/cuda-11.6/targets/x86_64-linux/lib/stubs/libcuda.so.1
- name: build Open SYCL
run: |
cd
git clone https://github.com/OpenSYCL/OpenSYCL.git
cd OpenSYCL
mkdir build && cd build
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 \
-DCUDA_CUDA_LIBRARY=/usr/local/cuda-${{matrix.cuda_version}}/lib64/stubs/libcuda.so \
-DWITH_CUDA_BACKEND=ON \
-DWITH_ROCM_BACKEND=OFF \
-DWITH_LEVEL_ZERO_BACKEND=OFF \
-DCMAKE_INSTALL_PREFIX=/opt/OpenSYCL \
-DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} \
-DCUDA_PATH=/usr/local/cuda-${{matrix.cuda_version}} ..
make -j2 install
- name: Build Open SYCL CPU Tests
run: |
cd $HOME/OpenSYCL/build
mkdir tests-omp && cd tests-omp
cmake \
-DOPENSYCL_TARGETS="omp" \
-DOpenSYCL_DIR=/opt/OpenSYCL/lib/cmake/OpenSYCL ../../tests
make -j 2 VERBOSE=ON
- name: Open SYCL tests for CPU
run: |
cd $HOME/OpenSYCL/build/tests-omp
LD_LIBRARY_PATH=$HOME/OpenSYCL/build/install/lib ./sycl_tests
- name: install LAPACK (for CBLAS)
run: |
cd
git clone https://github.com/Reference-LAPACK/lapack.git
cd lapack
mkdir build && cd build
cmake -DCMAKE_INSTALL_LIBDIR=/opt/lapack -DBUILD_SHARED_LIBS=ON -DCBLAS=ON ..
sudo cmake --build . -j --target install
- name: clone and build oneMKL with cuBLAS backend
env:
rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/
hip_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hip/
AMDDeviceLibs_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/AMDDeviceLibs/
amd_comgr_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/amd_comgr/
hsa-runtime64_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hsa-runtime64/
run: |
cd
git clone https://github.com/oneapi-src/oneMKL.git
cd oneMKL
mkdir build
cd build
cmake \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \
-DCMAKE_C_COMPILER=/usr/bin/clang-${{matrix.clang_version}} \
-DCUDA_CUDA_LIBRARY=/usr/local/cuda-${{matrix.cuda_version}}/lib64/stubs/libcuda.so \
-DENABLE_CUBLAS_BACKEND=True \
-DENABLE_CURAND_BACKEND=False \
-DENABLE_CUSOLVER_BACKEND=False \
-DENABLE_MKLGPU_BACKEND=False \
-DENABLE_MKLCPU_BACKEND=False \
-DENABLE_NETLIB_BACKEND=False \
-DENABLE_ROCBLAS_BACKEND=False \
-DBUILD_SHARED_LIBS=ON \
-DTARGET_DOMAINS=blas \
-DREF_BLAS_ROOT=/opt/lapack/ \
-DhipSYCL_DIR=/opt/OpenSYCL/lib/cmake/hipSYCL \
-DHIPSYCL_TARGETS="omp;cuda:sm_60" \
-DONEMKL_SYCL_IMPLEMENTATION=hipsycl ..
cmake --build . -j2
cmake --install . --prefix /opt/oneMKL
- name: clone and build oneMKL with rocBLAS backend
env:
rocblas_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/
hip_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hip/
AMDDeviceLibs_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/AMDDeviceLibs/
amd_comgr_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/amd_comgr/
hsa-runtime64_DIR: /opt/rocm-${{matrix.rocm_version}}/lib/cmake/hsa-runtime64/
run: |
cd
git clone https://github.com/oneapi-src/oneMKL.git oneMKL-rocBLAS
cd oneMKL-rocBLAS
mkdir build
cd build
cmake \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang_version}} \
-DCMAKE_C_COMPILER=/usr/bin/clang-${{matrix.clang_version}} \
-DROCBLAS_LIBRARIES=/opt/rocm-${{matrix.rocm_version}}/lib/cmake/rocblas/ \
-DENABLE_CUBLAS_BACKEND=False \
-DENABLE_CURAND_BACKEND=False \
-DENABLE_CUSOLVER_BACKEND=False \
-DENABLE_MKLGPU_BACKEND=False \
-DENABLE_MKLCPU_BACKEND=False \
-DENABLE_NETLIB_BACKEND=False \
-DENABLE_ROCBLAS_BACKEND=True \
-DBUILD_SHARED_LIBS=ON \
-DTARGET_DOMAINS=blas \
-DREF_BLAS_ROOT=/opt/lapack/ \
-DhipSYCL_DIR=/opt/OpenSYCL/lib/cmake/hipSYCL \
-DHIPSYCL_TARGETS="omp;hip:gfx906" \
-DONEMKL_SYCL_IMPLEMENTATION=hipsycl ..
cmake --build . -j2
cmake --install . --prefix /opt/oneMKL-rocBLAS