Skip to content

Merge branch 'AdaptiveCpp:develop' into develop-nix-patches #8

Merge branch 'AdaptiveCpp:develop' into develop-nix-patches

Merge branch 'AdaptiveCpp:develop' into develop-nix-patches #8

Workflow file for this run

name: Linux build and test
on: [push, pull_request]
jobs:
test-clang-based:
name: clang ${{ matrix.clang }}, ${{ matrix.os }}, CUDA ${{matrix.cuda}}, ROCm ${{matrix.rocm}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
clang: [15, 16]
os: [ubuntu-22.04]
cuda: [11.0.2]
rocm: [5.4.3]
include:
- clang: 11
os: ubuntu-20.04
cuda: 11.0.2
rocm: 4.0.1
- clang: 12
os: ubuntu-20.04
cuda: 11.0.2
rocm: 4.0.1
- clang: 13
os: ubuntu-20.04
cuda: 11.0.2
rocm: 4.0.1
- clang: 14
os: ubuntu-20.04
cuda: 11.0.2
rocm: 4.0.1
- clang: 17
os: ubuntu-22.04
cuda: 11.0.2
rocm: 5.6.1
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install OpenCL development files
run : |
sudo apt install ocl-icd-opencl-dev
- name: Install TBB for PSTL tests
run : |
sudo apt install libtbb-dev
- name: install Level Zero
run : |
wget https://github.com/oneapi-src/level-zero/releases/download/v1.2.3/level-zero-devel_1.2.3+u18.04_amd64.deb
wget https://github.com/oneapi-src/level-zero/releases/download/v1.2.3/level-zero_1.2.3+u18.04_amd64.deb
sudo dpkg -i ./level-zero*
- name: install CUDA
run: |
mkdir -p /opt/AdaptiveCpp/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/AdaptiveCpp/cuda || true
echo "CUDA Version ${{matrix.cuda}}" | sudo tee /opt/AdaptiveCpp/cuda/version.txt
- name: install ROCm
run: |
[[ ${{matrix.os}} == ubuntu-20.04 ]] && CODENAME=xenial
[[ ${{matrix.os}} == ubuntu-22.04 ]] && CODENAME=jammy
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}} $CODENAME main" | sudo tee /etc/apt/sources.list.d/rocm.list
printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt update
sudo apt install rocm-dev
- name: install LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{matrix.clang}}
sudo apt install libclang-${{matrix.clang}}-dev clang-tools-${{matrix.clang}} libomp-${{matrix.clang}}-dev
if [[ "${{matrix.clang}}" == "16" ]]; then
sudo rm -r /usr/lib/clang/16*
sudo ln -s /usr/lib/llvm-16/lib/clang/16 /usr/lib/clang/16
fi
- name: install boost (from apt)
run: |
sudo apt install libboost-all-dev
- name: build AdaptiveCpp
run: |
mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/AdaptiveCpp/cuda -DROCM_PATH=/opt/rocm ..
make -j2 install
cp /opt/AdaptiveCpp/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so
cp /opt/AdaptiveCpp/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1
- name: build CPU tests
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-cpu
cd ${GITHUB_WORKSPACE}/build/tests-cpu
cmake -DACPP_TARGETS="omp" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests
make -j2
- name: build generic SSCP tests
if: matrix.clang >= 14
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-sscp
cd ${GITHUB_WORKSPACE}/build/tests-sscp
cmake -DACPP_TARGETS="generic" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp -DWITH_PSTL_TESTS=ON ${GITHUB_WORKSPACE}/tests
make -j2
- name: build CUDA tests
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-cuda
cd ${GITHUB_WORKSPACE}/build/tests-cuda
cmake -DACPP_TARGETS="cuda:sm_60" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/llvm-${{matrix.clang}}/lib"
make -j2
- name: build ROCm tests
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-rocm
cd ${GITHUB_WORKSPACE}/build/tests-rocm
cmake -DACPP_TARGETS="hip:gfx906" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/llvm-${{matrix.clang}}/lib"
make -j2
- name: build explicit multipass tests
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-emp
cd ${GITHUB_WORKSPACE}/build/tests-emp
cmake -DACPP_TARGETS="omp;cuda.explicit-multipass:sm_60;hip:gfx906" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests
make -j2
- name: run CPU tests
run: |
cd ${GITHUB_WORKSPACE}/build/tests-cpu
LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./sycl_tests
test-nvcxx-based:
name: nvcxx ${{matrix.nvhpc}}, ${{matrix.os}}, CUDA ${{matrix.cuda}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
nvhpc: [23.9]
cuda: [12.2]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: install dependencies
run : |
sudo apt update
sudo apt install cmake libboost-all-dev wget gpg curl
- name: install nvcxx
run: |
MAJOR_VERSION=$(echo ${{matrix.nvhpc}} | sed 's/\..*//')
MINOR_VERSION=$(echo ${{matrix.nvhpc}} | sed 's/.*\.//')
curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list
sudo apt-get update -y
sudo apt-get install -y nvhpc-${MAJOR_VERSION}-${MINOR_VERSION}
- name: build AdaptiveCpp
run: |
mkdir build && cd build
export NV_HPC_SDK_ROOT=/opt/nvidia/hpc_sdk/Linux_x86_64/${{matrix.nvhpc}}
export NV_HPC_CUDA_ROOT=${NV_HPC_SDK_ROOT}/cuda/${{matrix.cuda}}
cmake -DNVCXX_COMPILER=${NV_HPC_SDK_ROOT}/compilers/bin/nvc++ -DWITH_CUDA_BACKEND=ON -DWITH_CUDA_NVCXX_ONLY=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=${NV_HPC_CUDA_ROOT} ..
make -j2 install
cp ${NV_HPC_CUDA_ROOT}/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so
cp ${NV_HPC_CUDA_ROOT}/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1
- name: build tests
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-nvcxx
cmake -DACPP_TARGETS="cuda-nvcxx" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-DHIPSYCL_NO_FIBERS" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests
make -j2