|
| 1 | +name: "PR Tests (aarch64)" |
| 2 | +permissions: read-all |
| 3 | + |
| 4 | +# Trigger for PR and merge to develop branch |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: develop |
| 8 | + pull_request: |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +env: |
| 12 | + CTEST_OUTPUT_ON_FAILURE: 1 |
| 13 | + LAPACK_VERSION: 3.12.0 |
| 14 | + ARMPL_VERSION: 25.04.1 |
| 15 | + POCL_VERSION: "6.0" |
| 16 | + DPCPP_VERSION: nightly-2025-04-01 |
| 17 | + |
| 18 | +jobs: |
| 19 | + # cleanup: |
| 20 | + # runs-on: ubuntu-24.04-arm |
| 21 | + # permissions: |
| 22 | + # actions: write |
| 23 | + # contents: read |
| 24 | + # steps: |
| 25 | + # - name: Cleanup |
| 26 | + # run: | |
| 27 | + # gh cache delete pocl-${{ env.POCL_VERSION }}-arm |
| 28 | + # gh cache delete dpcpp-${{ env.DPCPP_VERSION }}-arm |
| 29 | + # env: |
| 30 | + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + # GH_REPO: ${{ github.repository }} |
| 32 | + # BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge |
| 33 | + unit-tests: |
| 34 | + runs-on: ubuntu-24.04-arm |
| 35 | + # One runner for each domain |
| 36 | + strategy: |
| 37 | + fail-fast: false |
| 38 | + matrix: |
| 39 | + include: |
| 40 | + - config: oneMath BLAS |
| 41 | + domain: blas |
| 42 | + build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install |
| 43 | + # TODO: enable LAPACK when https://github.com/uxlfoundation/oneMath/issues/666 is fixed |
| 44 | + # - config: oneMath LAPACK |
| 45 | + # domain: lapack |
| 46 | + # build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install |
| 47 | + - config: oneMath RNG |
| 48 | + domain: rng |
| 49 | + test_options: -E 'Device|DEVICE' |
| 50 | + name: unit tests ${{ matrix.config }} CPU |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 |
| 53 | + - name: Check if the changes affect this domain |
| 54 | + id: domain_check |
| 55 | + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
| 56 | + with: |
| 57 | + script: | |
| 58 | + const domainCheck = require('.github/scripts/domain-check.js') |
| 59 | + return domainCheck({github, context, domain: "${{ matrix.domain }}"}) |
| 60 | + - name: Restore netlib from cache |
| 61 | + id: cache-lapack |
| 62 | + uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 |
| 63 | + with: |
| 64 | + path: lapack/install |
| 65 | + key: lapack-${{ env.LAPACK_VERSION }}-arm |
| 66 | + - name: Install netlib |
| 67 | + if: steps.domain_check.outputs.result == 'true' && steps.cache-lapack.outputs.cache-hit != 'true' |
| 68 | + run: | |
| 69 | + curl -sL https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v${LAPACK_VERSION}.tar.gz | tar zx |
| 70 | + SHARED_OPT="lapack-${LAPACK_VERSION} -DBUILD_SHARED_LIBS=on -DCBLAS=on -DLAPACKE=on -DCMAKE_INSTALL_PREFIX=${PWD}/lapack/install -G Ninja" |
| 71 | + # 32 bit int |
| 72 | + cmake ${SHARED_OPT} -B lapack/build32 |
| 73 | + cmake --build lapack/build32 --target install |
| 74 | + # 64 bit int |
| 75 | + cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64 |
| 76 | + cmake --build lapack/build64 --target install |
| 77 | + - name: APT install dependencies |
| 78 | + if: steps.domain_check.outputs.result == 'true' |
| 79 | + run: sudo apt install libclang-cpp18-dev libclang-18-dev ocl-icd-dev ocl-icd-libopencl1 ocl-icd-opencl-dev |
| 80 | + - name: Restore DPC++ from cache |
| 81 | + id: cache-dpcpp |
| 82 | + uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 |
| 83 | + with: |
| 84 | + path: dpcpp/install |
| 85 | + key: dpcpp-${{ env.DPCPP_VERSION }}-arm |
| 86 | + - name: Build DPC++ |
| 87 | + if: steps.domain_check.outputs.result == 'true' && steps.cache-dpcpp.outputs.cache-hit != 'true' |
| 88 | + run: | |
| 89 | + wget -P dpcpp https://github.com/intel/llvm/archive/refs/tags/${{ env.DPCPP_VERSION }}.tar.gz |
| 90 | + cd dpcpp |
| 91 | + tar -xzf ${{ env.DPCPP_VERSION }}.tar.gz |
| 92 | + python llvm-${{ env.DPCPP_VERSION }}/buildbot/configure.py -o build -t Release --cmake-gen Ninja --cmake-opt="-DSYCL_ENABLE_PLUGINS=opencl" --cmake-opt="-DCMAKE_INSTALL_PREFIX=$PWD/install" --llvm-external-projects=openmp |
| 93 | + cd build |
| 94 | + ninja deploy-sycl-toolchain |
| 95 | + ninja omp |
| 96 | + ninja install |
| 97 | + cd .. |
| 98 | + - name: Restore PoCL from cache |
| 99 | + id: cache-pocl |
| 100 | + uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 |
| 101 | + with: |
| 102 | + path: pocl/install |
| 103 | + key: pocl-${{ env.POCL_VERSION }}-arm |
| 104 | + - name: Build PoCL |
| 105 | + if: steps.domain_check.outputs.result == 'true' && steps.cache-pocl.outputs.cache-hit != 'true' |
| 106 | + run: | |
| 107 | + export PATH=${PWD}/dpcpp/install/bin:${PATH} |
| 108 | + export CPATH=${PWD}/dpcpp/install/include:${CPATH} |
| 109 | + export LIBRARY_PATH=${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LIBRARY_PATH} |
| 110 | + export LD_LIBRARY_PATH=${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LD_LIBRARY_PATH} |
| 111 | + wget -P pocl https://github.com/pocl/pocl/archive/refs/tags/v${{ env.POCL_VERSION }}.tar.gz |
| 112 | + cd pocl |
| 113 | + tar -xzf v${{ env.POCL_VERSION }}.tar.gz |
| 114 | + cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_COMPILER=clang-18 -DWITH_LLVM_CONFIG=$(which llvm-config-18) -DCMAKE_INSTALL_PREFIX=$PWD/install -G Ninja -DENABLE_ICD=ON -DENABLE_SPIRV=ON -DLLVM_SPIRV=$PWD/../dpcpp/install/bin/llvm-spirv pocl-${{ env.POCL_VERSION }} |
| 115 | + cmake --build build |
| 116 | + cmake --install build |
| 117 | + ls -l |
| 118 | + ls -l install/* |
| 119 | + cd .. |
| 120 | + - name: Install ArmPL |
| 121 | + if: steps.domain_check.outputs.result == 'true' |
| 122 | + run: | |
| 123 | + mkdir armpl |
| 124 | + cd armpl |
| 125 | + wget https://developer.arm.com/-/cdn-downloads/permalink/Arm-Performance-Libraries/Version_${{ env.ARMPL_VERSION }}/arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb_gcc.tar |
| 126 | + tar -xf arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb_gcc.tar |
| 127 | + ./arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb/arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb.sh -a -i $PWD/install |
| 128 | + cd .. |
| 129 | + - name: Configure/Build for a domain |
| 130 | + if: steps.domain_check.outputs.result == 'true' |
| 131 | + run: | |
| 132 | + export PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/bin:${PWD}/pocl/install/bin:${PWD}/dpcpp/install/bin:${PATH} |
| 133 | + export CPATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/include:${PWD}/pocl/install/include:${PWD}/dpcpp/install/include:${CPATH} |
| 134 | + export LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/pocl/install/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LIBRARY_PATH} |
| 135 | + export LD_LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/pocl/install/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LD_LIBRARY_PATH} |
| 136 | + export OCL_ICD_VENDORS=$PWD/pocl/install/etc/OpenCL/vendors/ |
| 137 | + sycl-ls |
| 138 | + cmake -DTARGET_DOMAINS=${{ matrix.domain }} -DENABLE_MKLCPU_BACKEND=off -DENABLE_MKLGPU_BACKEND=off -DENABLE_ARMPL_BACKEND=on -DARMPL_ROOT=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc -DCMAKE_CXX_FLAGS='-fopenmp' -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.build_options }} -B build -G Ninja |
| 139 | + cmake --build build |
| 140 | + - name: Run tests |
| 141 | + if: steps.domain_check.outputs.result == 'true' |
| 142 | + run: | |
| 143 | + export PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/bin:${PWD}/pocl/install/bin:${PWD}/dpcpp/install/bin:${PATH} |
| 144 | + export CPATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/include:${PWD}/pocl/install/include:${PWD}/dpcpp/install/include:${CPATH} |
| 145 | + export LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/pocl/install/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LIBRARY_PATH} |
| 146 | + export LD_LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/pocl/install/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LD_LIBRARY_PATH} |
| 147 | + export OCL_ICD_VENDORS=$PWD/pocl/install/etc/OpenCL/vendors/ |
| 148 | + sycl-ls |
| 149 | + ctest --test-dir build ${{ matrix.test_options }} |
| 150 | + # - name: Setup tmate session |
| 151 | + # uses: mxschmitt/action-tmate@v3 |
0 commit comments