Skip to content

Merge branch 'oneapi-src:develop' into linux-ci #36

Merge branch 'oneapi-src:develop' into linux-ci

Merge branch 'oneapi-src:develop' into linux-ci #36

Workflow file for this run

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