Fix incorrect namespace use in accessor test (#1917) #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux build and test | |
| on: [push, pull_request] | |
| jobs: | |
| prep-container: | |
| name: Prepare CI container clang ${{ matrix.clang }}, ${{ matrix.os }}, CUDA ${{matrix.cuda_major_version}}.${{matrix.cuda_minor_version}}.${{matrix.cuda_patch_version}}, ROCm ${{matrix.rocm}} | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| pull-requests: read | |
| packages: write | |
| actions: read | |
| outputs: | |
| docker_matrix: ${{ steps.matrix-output.outputs.json }} | |
| strategy: | |
| matrix: | |
| clang: [15, 16, 17, 18, 19, 20] | |
| os: [ubuntu-22.04] | |
| cuda_major_version: [11] | |
| cuda_minor_version: [0] | |
| cuda_patch_version: [2] | |
| rocm: [5.4.3] | |
| include: | |
| - clang: 17 | |
| os: ubuntu-22.04 | |
| cuda_major_version: 11 | |
| cuda_minor_version: 0 | |
| cuda_patch_version: 2 | |
| rocm: 5.6.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 20 | |
| - uses: ./.github/workflows/create-ci-docker | |
| id: docker | |
| with: | |
| LLVM_VERSION: ${{ matrix.clang }} | |
| ROCM_VERSION: ${{ matrix.rocm }} | |
| CUDA_MAJOR_VERSION: ${{ matrix.cuda_major_version }} | |
| CUDA_MINOR_VERSION: ${{ matrix.cuda_minor_version }} | |
| CUDA_PATCH_VERSION: ${{ matrix.cuda_patch_version }} | |
| BASE_TAG: ${{ matrix.os }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: beacon-biosignals/matrix-output@v1 | |
| id: matrix-output | |
| with: | |
| yaml: | | |
| name: ${{ matrix.clang }}-${{ matrix.os }} | |
| clang: ${{ matrix.clang }} | |
| os: ${{ matrix.os }} | |
| cuda: ${{matrix.cuda_major_version}}.${{matrix.cuda_minor_version}}.${{matrix.cuda_patch_version}} | |
| rocm: ${{matrix.rocm}} | |
| image: ${{ steps.docker.outputs.docker_image }} | |
| test-clang-based: | |
| name: clang ${{ matrix.docker.clang }}, ${{ matrix.test_kind }}, CUDA ${{matrix.docker.cuda}}, ROCm ${{matrix.docker.rocm}}, ${{ matrix.docker.os }} | |
| runs-on: ${{ matrix.docker.os }} | |
| needs: prep-container | |
| strategy: | |
| matrix: | |
| docker: ${{fromJson(needs.prep-container.outputs.docker_matrix)}} | |
| test_kind: [omp, sscp, smcp] | |
| container: | |
| image: ${{ matrix.docker.image }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: ccache | |
| uses: hendrikmuhs/[email protected] | |
| with: | |
| key: ${{ github.job }}-${{matrix.docker.clang}}-${{matrix.docker.os}}-${{matrix.docker.cuda}}-${{matrix.docker.rocm}}-${{ matrix.test_kind }} | |
| - name: build AdaptiveCpp | |
| run: | | |
| mkdir build && cd build | |
| cmake -GNinja -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.docker.clang}} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.docker.clang}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.docker.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/cuda -DROCM_PATH=/opt/rocm -DACPP_EXPERIMENTAL_LLVM=ON .. | |
| ninja install | |
| cp /opt/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so | |
| cp /opt/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1 | |
| - name: build CPU tests | |
| if: matrix.test_kind == 'omp' | |
| run: | | |
| mkdir ${GITHUB_WORKSPACE}/build/tests-cpu | |
| cd ${GITHUB_WORKSPACE}/build/tests-cpu | |
| cmake -GNinja -DACPP_TARGETS="omp" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests | |
| ninja | |
| - name: build generic SSCP tests | |
| if: matrix.test_kind == 'sscp' | |
| run: | | |
| mkdir ${GITHUB_WORKSPACE}/build/tests-sscp | |
| cd ${GITHUB_WORKSPACE}/build/tests-sscp | |
| cmake -GNinja -DACPP_TARGETS="generic" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp -DWITH_PSTL_TESTS=ON -DWITH_PCUDA_TESTS=ON ${GITHUB_WORKSPACE}/tests | |
| ninja | |
| - name: build CUDA tests | |
| if: matrix.test_kind == 'smcp' | |
| run: | | |
| mkdir ${GITHUB_WORKSPACE}/build/tests-cuda | |
| cd ${GITHUB_WORKSPACE}/build/tests-cuda | |
| cmake -GNinja -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.docker.clang}}/lib" | |
| ninja | |
| - name: build ROCm tests | |
| if: matrix.test_kind == 'smcp' | |
| run: | | |
| mkdir ${GITHUB_WORKSPACE}/build/tests-rocm | |
| cd ${GITHUB_WORKSPACE}/build/tests-rocm | |
| cmake -GNinja -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.docker.clang}}/lib" | |
| ninja | |
| - name: build explicit multipass tests | |
| if: matrix.test_kind == 'smcp' | |
| run: | | |
| mkdir ${GITHUB_WORKSPACE}/build/tests-emp | |
| cd ${GITHUB_WORKSPACE}/build/tests-emp | |
| cmake -GNinja -DACPP_TARGETS="omp;cuda.explicit-multipass:sm_60;hip:gfx906" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests | |
| ninja | |
| - name: run CPU tests | |
| if: matrix.test_kind == 'omp' | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/build/tests-cpu | |
| ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./sycl_tests | |
| - name: run CPU SSCP tests | |
| if: matrix.test_kind == 'sscp' | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/build/tests-sscp | |
| ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./sycl_tests | |
| - name: run PSTL tests on CPU | |
| if: matrix.test_kind == 'sscp' | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/build/tests-sscp | |
| ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./pstl_tests | |
| - name: run PCUDA tests on CPU | |
| if: matrix.test_kind == 'sscp' | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/build/tests-sscp | |
| ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./pcuda_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@v4 | |
| 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-get update | |
| sudo apt-get install -y 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 -DACPP_COMPILER_FEATURE_PROFILE=none -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 |