diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2bb57e65d..f4d485787 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,17 +1,16 @@ -name: Linux build and test +name: Build tests with hipSYCL on: [push, pull_request] jobs: - test-clang-based: - name: clang ${{ matrix.clang_version }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}} - runs-on: ubuntu-20.04 + test-with-hipsycl: + name: Run tests with hipSYCL strategy: matrix: clang_version: [13] rocm_version: ['5.1.1'] - os: [ubuntu-20.04] - cuda: [11.0] + os: [ubuntu-20.04, ubuntu-18.04] + runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v2 with: @@ -22,90 +21,72 @@ jobs: 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 - - name: install CUDA 11.0 - if: matrix.cuda == 11.0 - run: | - mkdir -p /opt/hipSYCL/cuda - 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 - sudo sh ./cuda.sh --override --silent --toolkit --no-man-page --no-drm --no-opengl-libs --installpath=/opt/hipSYCL/cuda || true - echo "CUDA Version 11.0.0" | sudo tee /opt/hipSYCL/cuda/version.txt + 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 source) + - 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 - sudo ./b2 link=static,shared install -j$(nproc) || true - cd .. - - name: install boost (from apt) - if: matrix.os == 'ubuntu-20.04' - run: | - sudo apt install libboost-all-dev + ./b2 + sudo ./b2 install -j4 - name: build hipSYCL run: | + cd git clone https://github.com/illuhad/hipSYCL.git cd hipSYCL 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 -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/hipSYCL/cuda -DROCM_PATH=/opt/rocm .. - make -j2 install - cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so - cp /opt/hipSYCL/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1 - - name: build CPU tests - run: | - mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu - cmake -DHIPSYCL_TARGETS="omp" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests - make -j2 - - name: build CUDA tests - run: | - mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cuda - cmake -DHIPSYCL_TARGETS="cuda:sm_60" -DhipSYCL_DIR=/home/runner/work/hipSYCL/hipSYCL/build/install/lib/cmake/hipSYCL /home/runner/work/hipSYCL/hipSYCL/tests - make -j2 - - name: build ROCm tests - run: | - mkdir /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-rocm - 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 - make -j2 - - name: run CPU tests + 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=OFF \ + -DWITH_ROCM_BACKEND=ON \ + -DWITH_LEVEL_ZERO_BACKEND=OFF \ + -DCMAKE_INSTALL_PREFIX=/opt/hipSYCL \ + -DROCM_PATH=/opt/rocm-${{matrix.rocm_version}} .. + make -j4 install + - name: install LAPACK (for CBLAS) run: | - cd /home/runner/work/hipSYCL/hipSYCL/build/tests-cpu - LD_LIBRARY_PATH=/home/runner/work/hipSYCL/hipSYCL/build/install/lib ./sycl_tests - - test-dpcpp-based: - name: Test dpcpp based compilation - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Install dpcpp - run: | - wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18236/l_BaseKit_p_2021.4.0.3422.sh - bash l_BaseKit_p_2021.4.0.3422.sh \ - -a --action install \ - -s --eula accept \ - --components=\ - intel.oneapi.lin.tbb.devel:\ - intel.oneapi.lin.dpcpp-cpp-compiler:\ - intel.oneapi.lin.mkl.devel \ - --install-dir /opt/intel/ \ - --download-dir /opt/intel/dw/ \ - --download-cache /opt/intel/dw/ \ - --package-path /opt/intel/intel - - - name: Clone oneMKL + 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 + 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 -DENABLE_CUBLAS_BACKEND=False \ + -DENABLE_MKLGPU_BACKEND=False \ + -DENABLE_MKLCPU_BACKEND=False \ + -DENABLE_NETLIB_BACKEND=False \ + -DENABLE_ROCBLAS_BACKEND=True \ + -DTARGET_DOMAINS=blas \ + -DHIPSYCL_TARGETS=omp\;hip:gfx906 \ + -DONEMKL_SYCL_IMPLEMENTATION=hipSYCL \ + -DREF_BLAS_ROOT=/opt/lapack/ .. + make -j8 +