TEST PR add liboffload tests #40
Workflow file for this run
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: UR - Build offload adapter | |
| permissions: read-all | |
| on: [ workflow_call, workflow_dispatch, pull_request ] | |
| jobs: | |
| offload_build: | |
| name: Build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build_type: [Release] | |
| compiler: [{c: gcc, cxx: g++}] | |
| runs-on: ["Linux", "bmg"] | |
| container: | |
| image: 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers' | |
| steps: | |
| - name: Checkout LLVM-project | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| repository: llvm/llvm-project | |
| persist-credentials: false | |
| path: llvm-project | |
| - name: Checkout LLVM | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| path: llvm | |
| persist-credentials: false | |
| - name: Configure llvm-project | |
| run: > | |
| cmake -S llvm-project/llvm -B llvm-project/build -G Ninja | |
| -DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
| -DLLVM_TARGETS_TO_BUILD='host;SPIRV;NVPTX' | |
| -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lldb;lld' | |
| -DLLVM_ENABLE_RUNTIMES='offload;openmp;libc' | |
| -DLIBOMPTARGET_PLUGINS_TO_BUILD="level_zero;cuda" | |
| -DLLVM_PARALLEL_LINK_JOBS=20 | |
| -DLLVM_BUILD_TESTS=ON | |
| -DLLVM_INCLUDE_TESTS=on | |
| '-DLLVM_LIT_ARGS=-v -vv' | |
| -DCMAKE_INSTALL_PREFIX=./llvm-project-install | |
| - name: Build and install llvm-project | |
| run: ninja -C llvm-project/build -j $(($(nproc)/3)) install | |
| - name: Configure intel/llvm | |
| # ">" is used to avoid adding "\" at the end of each line; this command is quite long | |
| run: > | |
| python3 llvm/buildbot/configure.py | |
| --offload | |
| -t ${{matrix.build_type}} | |
| --liboffload-path=./llvm-project-install | |
| - name: Build intel/llvm | |
| # This is so that device binaries can find the sycl runtime library | |
| run: python3 llvm/buildbot/compile.py | |
| - name: Compile test file | |
| run: llvm/build/bin/clang++ -fsycl llvm/sycl/test-e2e/Basic/liboffload_test.cpp -o test_liboffload | |
| - name: Run sycl-ls | |
| run: > | |
| LD_LIBRARY_PATH=./llvm-project-install/lib | |
| UR_ADAPTERS_FORCE_LOAD=./llvm/build/lib/libur_adapter_offload.so | |
| ./llvm/build/bin/sycl-ls | |
| - name: Run test | |
| run: LD_LIBRARY_PATH=llvm/build/lib UR_ADAPTERS_FORCE_LOAD=llvm/build/lib/libur_adapter_offload.so ZE_AFFINITY_MASK=1 ./test_liboffload | |
| - name: Get information about platform | |
| if: ${{ always() }} | |
| run: ./llvm/devops/scripts/get_system_info.sh |