From c340907baed7d6933616d7d7bb8ac8acd273cf98 Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Thu, 22 Jun 2023 10:20:07 +0100 Subject: [PATCH] Added simple host build of UnitCL with sccache --- .github/actions/build_ock/action.yml | 94 ++++++++++++++++++++++++++++ .github/workflows/docs.yml | 3 +- .github/workflows/merge_request.yml | 71 +++++++++++++++++++++ 3 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 .github/actions/build_ock/action.yml create mode 100644 .github/workflows/merge_request.yml diff --git a/.github/actions/build_ock/action.yml b/.github/actions/build_ock/action.yml new file mode 100644 index 000000000..0db79528a --- /dev/null +++ b/.github/actions/build_ock/action.yml @@ -0,0 +1,94 @@ +name: build-ock +description: Action to build the oneapi-construction-kit but not run + +inputs: + build_type: + description: 'build type (Release, ReleaseAssert)' + default: ReleaseAssert + mux_targets_enable: + description: 'TBD' + default: "host" + mux_compilers_enable: + default: "host" + usm: + description: 'TBD' + default: ON + command_buffer: + description: 'TBD' + default: ON + debug_support: + description: 'TBD' + default: OFF + offline_kernel_tests: + description: 'TBD' + default: ON + llvm_install_dir: + description: 'TBD' + default: ${{ github.workspace }}/llvm_install + build_targets: + description: 'TBD' + default: UnitCL muxc veczc + host_fp16: + description: 'TBD' + default: OFF + host_image: + description: 'TBD' + default: OFF + external_compiler_dirs: + description: 'External compiler directories, default is to empty string, which means no external directories' + default: "" + hal_description: + description: 'TBD - Only relevant for riscv' + default: "RV64GCV" + hal_refsi_soc: + description: 'TBD' + default: "M1" + riscv_enabled: + description: "TBD" + default: OFF + build_dir: + description: "TBD" + default: build + extra_flags: + description: "TBD" + default: + + +runs: + # We don't want a new docker just a list of steps, so mark as composite + using: "composite" + steps: + - name: cmake_ock + shell: bash + run: + cmake -GNinja + -Bbuild + -DCMAKE_C_COMPILER_LAUNCHER=sccache + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + -DCA_MUX_TARGETS_TO_ENABLE=${{ inputs.mux_targets_enable }} + -DCA_ENABLE_API=cl + -DCA_LLVM_INSTALL_DIR=${{ inputs.llvm_install_dir }} + -DCA_ENABLE_DEBUG_SUPPORT=${{ inputs.debug_support }} + -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} + -DCA_ENABLE_HOST_IMAGE_SUPPORT=${{ inputs.host_image }} + -DCA_HOST_ENABLE_BUILTIN_KERNEL=${{ inputs.debug_support }} + -DCA_HOST_ENABLE_BUILTINS_EXTENSION=ON + -DCA_HOST_ENABLE_FP16=${{ inputs.host_fp16 }} + -DCA_CL_ENABLE_OFFLINE_KERNEL_TESTS=${{ inputs.offline_kernel_tests }} + -DCA_ASSEMBLE_SPIRV_LL_LIT_TESTS_OFFLINE=OFF + -DOCL_EXTENSION_cl_intel_unified_shared_memory=${{ inputs.usm }} + -DOCL_EXTENSION_cl_khr_command_buffer=${{ inputs.command_buffer }} + -DOCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=${{ inputs.command_buffer }} + -DCA_MUX_COMPILERS_TO_ENABLE=${{ inputs.mux_compilers_enable}} + -DCA_EXTERNAL_MUX_COMPILER_DIRS=${{ inputs.external_compiler_dirs }} + -DCA_CL_ENABLE_ICD_LOADER=ON + -DHAL_REFSI_SOC=${{ inputs.hal_refsi_soc }} + -DHAL_REFSI_THREAD_MODE=${{ inputs.regs_thread_mode }} + -DCA_RISCV_ENABLED=${{ inputs.riscv_enabled }} ${{ inputs.extra_flags }} . + - name: build_ock + shell: bash + run: + ninja -C build ${{ inputs.build_targets }} + + # -DCA_CL_ENABLE_RVV_SCALABLE_VECZ_CHECK=ON + # -DCA_CL_ENABLE_RVV_SCALABLE_VP_VECZ_CHECK=ON \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 618a40a72..f4525d0dd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,8 @@ name: Build documentation # order to satisfy our current cmake configurations e.g. spirv-tools on: - pull_request: +# temporarily disable for testing purposes +# pull_request: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/merge_request.yml b/.github/workflows/merge_request.yml new file mode 100644 index 000000000..10c930876 --- /dev/null +++ b/.github/workflows/merge_request.yml @@ -0,0 +1,71 @@ +# Simple workflow for running merge request tests +name: Merge Request tester + +on: + # temporary + push: + + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build_ca_host_x86_64: + runs-on: ubuntu-22.04 + + steps: + + - name: Install prerequisites + run: | + sudo apt-get install -y spirv-tools + pip install lit + + - name: Install Ninja + uses: llvm/actions/install-ninja@main + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: codeplaysoftware/oneapi-construction-kit + + - name: load llvm + uses: actions/cache/restore@v3 + with: + path: llvm_install/** + key: llvm-ubuntu-22.04-v16-RelAssert + fail-on-cache-miss: true + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: 50M + key: sccache-build + variant: sccache + + # - name: build_mr_x86-llvm15-cl3.0-release + # uses: ./.github/actions/build_ock + # with: + # build_type: Release + # mux_targets_enable: host + + - name: build_mr-ubuntu-gcc-x86_64-riscv-3.0_m1 + uses: ./.github/actions/build_ock + with: + # Default SOC M1, external compiler dir, hal_description RV64GCV, thread mode WG + build_type: ReleaseAssert + mux_targets_enable: riscv + mux_compilers_enable: refsi_m1 + external_compiler_dirs: "${{ github.workspace }}/examples/refsi/refsi_m1/compiler/refsi_m1" + riscv_enabled: ON + extra_flags: -DCA_CL_ENABLE_RVV_SCALABLE_VECZ_CHECK=ON -DCA_CL_ENABLE_RVV_SCALABLE_VP_VECZ_CHECK=ON + + + + - name: run_it_for_demo + run: + ninja -C build check-UnitCL + - name: run_it_for_demo2 + run: + ninja -C build check-all-lit +