|
| 1 | +name: Unified Runtime Pre Commit |
| 2 | +# Note: this is the very first version of UR workflow. |
| 3 | +# It was pretty much copy-pasted from UR repository. |
| 4 | +# Over time it will be most likely integrated more into existing workflows. |
| 5 | + |
| 6 | +# Note: the trigger is copy-pasted from sycl-linux-precommit.yml - probably to be fine-tuned. |
| 7 | +on: |
| 8 | + # We rely on "Fork pull request workflows from outside collaborators" - |
| 9 | + # "Require approval for all outside collaborators" at |
| 10 | + # https://github.com/intel/llvm/settings/actions for security. |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - sycl |
| 14 | + - sycl-rel-** |
| 15 | + # Do not run builds if changes are only in the following locations |
| 16 | + paths-ignore: |
| 17 | + - '.github/ISSUE_TEMPLATE/**' |
| 18 | + - '.github/CODEOWNERS' |
| 19 | + - 'sycl/doc/**' |
| 20 | + - 'sycl/gdb/**' |
| 21 | + - 'clang/docs/**' |
| 22 | + - '**.md' |
| 23 | + - '**.rst' |
| 24 | + - '.github/workflows/sycl-windows-*.yml' |
| 25 | + - '.github/workflows/sycl-macos-*.yml' |
| 26 | + - '.github/workflows/sycl-nightly.yml' |
| 27 | + - '.github/workflows/sycl-rel-nightly.yml' |
| 28 | + - 'devops/containers/**' |
| 29 | + - 'devops/actions/build_container/**' |
| 30 | + |
| 31 | +concurrency: |
| 32 | + # Cancel a currently running workflow from the same PR, branch or tag. |
| 33 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 34 | + cancel-in-progress: true |
| 35 | + |
| 36 | +permissions: read-all |
| 37 | + |
| 38 | +jobs: |
| 39 | + detect_changes: |
| 40 | + uses: ./.github/workflows/sycl-detect-changes.yml |
| 41 | + |
| 42 | + # TODO: If UR is merged into llvm it will require changes: |
| 43 | + # - 'detect_changes' should be required for all UR jobs |
| 44 | + # - 'if' condition should be used, for all UR jobs, to check if UR is affected |
| 45 | + # (see example test_job's if) |
| 46 | + # - test_job should be removed |
| 47 | + # |
| 48 | + test_job: |
| 49 | + # this is a temporary test job, to show how the 'if' should be used for all UR jobs |
| 50 | + name: UR test job |
| 51 | + needs: [detect_changes] |
| 52 | + if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }} |
| 53 | + runs-on: ubuntu-latest |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Check if UR is affected |
| 57 | + run: | |
| 58 | + echo "UR affected" |
| 59 | + echo 'Filters set: ${{needs.detect_changes.outputs.filters}}' |
| 60 | +
|
| 61 | + source_checks: |
| 62 | + name: Source Checks |
| 63 | + needs: [detect_changes] |
| 64 | + uses: ./.github/workflows/ur-source-checks.yml |
| 65 | + |
| 66 | + adapters: |
| 67 | + name: Adapters |
| 68 | + needs: [source_checks] |
| 69 | + strategy: |
| 70 | + matrix: |
| 71 | + # Extra native CPU jobs are here to force the loader to be used. |
| 72 | + # UR will not use the loader if there is only one target. |
| 73 | + adapter: [ |
| 74 | + {name: L0, runner: UR_L0}, |
| 75 | + {name: L0_V2, runner: UR_L0}, |
| 76 | + {name: L0, runner: UR_L0, static: ON}, |
| 77 | + {name: OPENCL, runner: UR_OPENCL, platform: "Intel(R) OpenCL"}, |
| 78 | + {name: CUDA, runner: UR_CUDA}, |
| 79 | + {name: HIP, runner: UR_HIP}, |
| 80 | + {name: NATIVE_CPU, runner: UR_NATIVE_CPU}, |
| 81 | + {name: OPENCL, runner: UR_OPENCL, other_adapter: NATIVE_CPU, platform: "OPENCL:Intel(R) OpenCL"}, |
| 82 | + {name: L0, runner: UR_L0, other_adapter: NATIVE_CPU}, |
| 83 | + ] |
| 84 | + uses: ./.github/workflows/ur-build-hw.yml |
| 85 | + with: |
| 86 | + adapter_name: ${{ matrix.adapter.name }} |
| 87 | + runner_name: ${{ matrix.adapter.runner }} |
| 88 | + static_loader: ${{ matrix.adapter.static || 'OFF' }} |
| 89 | + static_adapter: ${{ matrix.adapter.static || 'OFF' }} |
| 90 | + platform: ${{ matrix.adapter.platform || '' }} |
| 91 | + other_adapter_name: ${{ matrix.adapter.other_adapter || '' }} |
| 92 | + |
| 93 | + macos: |
| 94 | + name: MacOS build only |
| 95 | + needs: [source_checks] |
| 96 | + strategy: |
| 97 | + matrix: |
| 98 | + os: ['macos-13'] |
| 99 | + runs-on: ${{matrix.os}} |
| 100 | + |
| 101 | + steps: |
| 102 | + # TODO: If UR is merged into llvm it will require changes: |
| 103 | + # - checkout only llvm repo |
| 104 | + # - configure UR project from local tree |
| 105 | + # |
| 106 | + - name: Checkout LLVM |
| 107 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 108 | + |
| 109 | + - name: Checkout UR |
| 110 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 111 | + with: |
| 112 | + repository: 'oneapi-src/unified-runtime' |
| 113 | + path: unified-runtime |
| 114 | + ref: main |
| 115 | + fetch-depth: 1 |
| 116 | + |
| 117 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 118 | + with: |
| 119 | + python-version: 3.9 |
| 120 | + |
| 121 | + - name: Install prerequisites |
| 122 | + working-directory: ${{github.workspace}}/unified-runtime |
| 123 | + run: python3 -m pip install -r third_party/requirements.txt |
| 124 | + |
| 125 | + - name: Install hwloc |
| 126 | + run: brew install hwloc |
| 127 | + |
| 128 | + - name: Configure CMake |
| 129 | + working-directory: ${{github.workspace}}/unified-runtime |
| 130 | + run: > |
| 131 | + cmake |
| 132 | + -B${{github.workspace}}/build |
| 133 | + -DUR_ENABLE_TRACING=ON |
| 134 | + -DUR_DEVELOPER_MODE=ON |
| 135 | + -DCMAKE_BUILD_TYPE=Release |
| 136 | + -DUR_BUILD_TESTS=ON |
| 137 | + -DUR_FORMAT_CPP_STYLE=ON |
| 138 | + -DUMF_ENABLE_POOL_TRACKING=ON |
| 139 | +
|
| 140 | + - name: Build |
| 141 | + run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) |
0 commit comments