|
| 1 | +--- |
| 2 | +name: Build - Adapters on HW - Reusable |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + adapter_name: |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + other_adapter_name: |
| 11 | + required: false |
| 12 | + type: string |
| 13 | + default: "" |
| 14 | + runner_name: |
| 15 | + required: true |
| 16 | + type: string |
| 17 | + platform: |
| 18 | + description: "Platform string, `UR_CTS_ADAPTER_PLATFORM` will be set to this." |
| 19 | + required: false |
| 20 | + type: string |
| 21 | + default: "" |
| 22 | + static_loader: |
| 23 | + required: false |
| 24 | + type: string |
| 25 | + default: OFF |
| 26 | + static_adapter: |
| 27 | + required: false |
| 28 | + type: string |
| 29 | + default: OFF |
| 30 | + |
| 31 | +permissions: |
| 32 | + contents: read |
| 33 | + |
| 34 | +env: |
| 35 | + UR_LOG_CUDA: "level:error;flush:error" |
| 36 | + UR_LOG_HIP: "level:error;flush:error" |
| 37 | + UR_LOG_LEVEL_ZERO: "level:error;flush:error" |
| 38 | + UR_LOG_NATIVE_CPU: "level:error;flush:error" |
| 39 | + UR_LOG_OPENCL: "level:error;flush:error" |
| 40 | + |
| 41 | +jobs: |
| 42 | + adapter-build-hw: |
| 43 | + name: Build & CTS |
| 44 | + if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW |
| 45 | + strategy: |
| 46 | + matrix: |
| 47 | + adapter: [ |
| 48 | + { |
| 49 | + name: "${{inputs.adapter_name}}", |
| 50 | + other_name: "${{inputs.other_adapter_name}}", |
| 51 | + platform: "${{inputs.platform}}", |
| 52 | + static_Loader: "${{inputs.static_loader}}", |
| 53 | + static_adapter: "${{inputs.static_loader}}" |
| 54 | + } |
| 55 | + ] |
| 56 | + build_type: [Release] |
| 57 | + compiler: [{c: gcc, cxx: g++}] |
| 58 | + |
| 59 | + runs-on: CUDA_E2E |
| 60 | + |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 63 | + |
| 64 | + - name: Install pip packages |
| 65 | + run: pip install -r third_party/requirements.txt |
| 66 | + |
| 67 | + - name: Download DPC++ |
| 68 | + run: | |
| 69 | + wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz |
| 70 | + mkdir dpcpp_compiler |
| 71 | + tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler |
| 72 | +
|
| 73 | + - name: Configure CMake |
| 74 | + run: > |
| 75 | + cmake |
| 76 | + -B${{github.workspace}}/build |
| 77 | + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} |
| 78 | + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} |
| 79 | + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} |
| 80 | + -DUR_ENABLE_TRACING=ON |
| 81 | + -DUR_DEVELOPER_MODE=ON |
| 82 | + -DUR_BUILD_TESTS=ON |
| 83 | + -DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON |
| 84 | + -DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }} |
| 85 | + ${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }} |
| 86 | + -DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}} |
| 87 | + -DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}} |
| 88 | + -DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ |
| 89 | + -DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib |
| 90 | + -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install |
| 91 | + ${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }} |
| 92 | + ${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }} |
| 93 | +
|
| 94 | + - name: Build |
| 95 | + # This is so that device binaries can find the sycl runtime library |
| 96 | + run: cmake --build ${{github.workspace}}/build -j $(nproc) |
| 97 | + |
| 98 | + - name: Install |
| 99 | + # This is to check that install command does not fail |
| 100 | + run: cmake --install ${{github.workspace}}/build |
| 101 | + |
| 102 | + - name: Test adapter specific |
| 103 | + working-directory: ${{github.workspace}}/build |
| 104 | + run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 180 |
| 105 | + # Don't run adapter specific tests when building multiple adapters |
| 106 | + if: ${{ matrix.adapter.other_name == '' }} |
| 107 | + |
| 108 | + - name: Test adapters |
| 109 | + working-directory: ${{github.workspace}}/build |
| 110 | + run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 |
| 111 | + |
| 112 | + - name: Get information about platform |
| 113 | + if: ${{ always() }} |
| 114 | + run: .github/scripts/get_system_info.sh |
0 commit comments