diff --git a/.github/workflows/sycl-detect-changes.yml b/.github/workflows/sycl-detect-changes.yml index 00891018cc319..f4b17052ccfdc 100644 --- a/.github/workflows/sycl-detect-changes.yml +++ b/.github/workflows/sycl-detect-changes.yml @@ -84,6 +84,10 @@ jobs: - .github/workflows/ur-* ur_cuda_adapter: - 'unified-runtime/source/adapters/cuda/**' + ur_offload_adapter: + - 'unified-runtime/include/**' + - 'unified-runtime/source/adapters/offload/**' + - '.github/workflows/ur-build-offload.yml' - name: Set output id: result @@ -94,7 +98,7 @@ jobs: return '${{ steps.changes.outputs.changes }}'; } // Treat everything as changed for huge PRs. - return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd", "ur", "ur_cuda_adapter"]; + return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd", "ur", "ur_cuda_adapter", "ur_offload_adapter"]; - run: echo '${{ steps.result.outputs.result }}' diff --git a/.github/workflows/ur-build-offload.yml b/.github/workflows/ur-build-offload.yml new file mode 100644 index 0000000000000..85e62cc9fb57f --- /dev/null +++ b/.github/workflows/ur-build-offload.yml @@ -0,0 +1,54 @@ +name: UR - Build offload adapter + +permissions: read-all + +on: [ workflow_call, workflow_dispatch ] + +jobs: + offload_build: + name: Build + strategy: + fail-fast: false + matrix: + build_type: [Release] + compiler: [{c: gcc, cxx: g++}] + + runs-on: [ "self-hosted", "Linux", "build" ] + container: + image: 'ghcr.io/intel/llvm/ubuntu2404_base' + + steps: + - name: Checkout LLVM + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Install liboffload + run: sudo apt-get update -qq && sudo apt-get install --no-install-recommends -yqq liboffload-21 liboffload-21-dev + + - name: Configure Unified Runtime project + # ">" is used to avoid adding "\" at the end of each line; this command is quite long + run: > + cmake + -S unified-runtime + -B build + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} + -DUR_ENABLE_TRACING=ON + -DUR_DEVELOPER_MODE=ON + -DUR_BUILD_TESTS=OFF + -DUR_BUILD_ADAPTER_OFFLOAD=ON + -DUR_OFFLOAD_INSTALL_DIR="/usr/lib/llvm-21" + -DUR_OFFLOAD_INCLUDE_DIR="/usr/lib/llvm-21/include" + -DCMAKE_INSTALL_PREFIX=./install + + - name: Build + # This is so that device binaries can find the sycl runtime library + run: cmake --build build -j $(nproc) + + - name: Install + # This is to check that install command does not fail + run: cmake --install build + + - name: Get information about platform + if: ${{ always() }} + run: ./unified-runtime/.github/scripts/get_system_info.sh diff --git a/.github/workflows/ur-precommit.yml b/.github/workflows/ur-precommit.yml index 574460ccadfd3..7b02ac16b5f05 100644 --- a/.github/workflows/ur-precommit.yml +++ b/.github/workflows/ur-precommit.yml @@ -98,6 +98,12 @@ jobs: docker_image: ${{ matrix.docker_image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'}} image_options: ${{ matrix.image_options || '' }} + offload_build: + name: Adapters (Offload) + needs: [detect_changes, source_checks] + if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur_offload_adapter') }} + uses: ./.github/workflows/ur-build-offload.yml + macos: name: MacOS build only needs: [detect_changes, source_checks]