diff --git a/.github/actions/build_ock/action.yml b/.github/actions/do_build_ock/action.yml similarity index 66% rename from .github/actions/build_ock/action.yml rename to .github/actions/do_build_ock/action.yml index db4d9da11..88cc33942 100644 --- a/.github/actions/build_ock/action.yml +++ b/.github/actions/do_build_ock/action.yml @@ -1,69 +1,75 @@ name: build-ock description: Action to build the oneapi-construction-kit but not run +# Some of these are riscv or host target specific, but it does not harm at present to +# overset cmake values inputs: build_type: - description: 'build type (Release, ReleaseAssert)' + description: 'build type e.g Release, ReleaseAssert (ReleaseAssert default)' default: ReleaseAssert mux_targets_enable: - description: 'TBD' + description: 'mux targets to enable e.g. riscv,host (host default)' default: "host" mux_compilers_enable: - default: "host" + description: 'mux compiler target to enable e.g. riscv, host (host default)' + default: "host" usm: - description: 'TBD' + description: 'Enable usm (ON default)' default: ON command_buffer: - description: 'TBD' + description: 'Enable command buffers (ON default)' default: ON debug_support: - description: 'TBD' + description: 'Enable debug support (OFF default)' default: OFF offline_kernel_tests: - description: 'TBD' + description: 'Enable offline kernel testing (ON default)' default: ON llvm_install_dir: - description: 'TBD' + description: 'Directory for llvm install' default: ${{ github.workspace }}/llvm_install build_targets: - description: 'TBD' - default: UnitCL muxc veczc + description: 'cmake targets to build (default UnitCL muxc veczc clc)' + default: UnitCL muxc veczc clc host_fp16: - description: 'TBD' + description: 'Enable host fp16 (default OFF)' default: OFF host_image: - description: 'TBD' + description: 'Enable host images (default OFF)' default: OFF host_enable_builtins: + description: 'Enable host builtins (default ON)' default: ON 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' + description: 'Description to be used for HAL, typically risc-v ISA (default RV64GCV)' default: "RV64GCV" hal_refsi_soc: - description: 'TBD' + description: 'HAL Refsi SOC e.g. M1 or G1 default M1' default: "M1" riscv_enabled: - description: "TBD" + description: "Enable riscv target (default OFF)" default: OFF build_dir: - description: "TBD" + description: "Directory to be used for building" default: build extra_flags: - description: "TBD" + description: "Any additional cmake flags to be passed (default '')" default: assemble_spirv_ll_lit_test_offline: - description: "TBD" - default: + description: "Enable Spir-V LL tests offline (Default on)" + default: ON enable_api: - description: "TBD" + description: "APIs to enable (default CL)" default: cl enable_rvv_scalable_vecz_check: - default: ON - enable_rvv_scalable_vp_vecz_check: - default: ON + description: "Enable RVV scalable vecz check (default OFF)" + default: OFF + enable_rvv_scalable_VP_vecz_check: + description: "Enable RVV scalable vecz VP check (default OFF)" + default: OFF runs: # We don't want a new docker just a list of steps, so mark as composite @@ -96,7 +102,7 @@ runs: -DHAL_REFSI_SOC=${{ inputs.hal_refsi_soc }} -DHAL_REFSI_THREAD_MODE=${{ inputs.regs_thread_mode }} -DCA_RISCV_ENABLED=${{ inputs.riscv_enabled }} - -DCA_CL_ENABLE_RVV_SCALABLE_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vecz_check }} + -DCA_CL_ENABLE_RVV_SCALABLE_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vecz_check }} -DCA_CL_ENABLE_RVV_SCALABLE_VP_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vp_vecz_check }} ${{ inputs.extra_flags }} . @@ -104,6 +110,3 @@ runs: shell: bash run: ninja -C ${{ inputs.build_dir }} ${{ 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/actions/do_build_ock/do_build_m1/action.yml b/.github/actions/do_build_ock/do_build_m1/action.yml new file mode 100644 index 000000000..b2ef218d7 --- /dev/null +++ b/.github/actions/do_build_ock/do_build_m1/action.yml @@ -0,0 +1,22 @@ +name: build-ock-m1 +description: Action to build the oneapi-construction-kit for default riscv m1 target + +inputs: + build_type: + description: 'build type (Release, ReleaseAssert)' + default: ReleaseAssert + +runs: + # We don't want a new docker just a list of steps, so mark as composite + using: "composite" + steps: + - name: build_ock + uses: ./.github/actions/do_build_ock + with: + build_type: ${{ inputs.build_type }} + mux_targets_enable: riscv + mux_compilers_enable: refsi_m1 + external_compiler_dirs: "${{ github.workspace }}/examples/refsi/refsi_m1/compiler/refsi_m1" + riscv_enabled: ON + enable_rvv_scalable_vecz_check: ON + enable_rvv_scalable_VP_vecz_check: ON diff --git a/.github/actions/setup_ubuntu_build/action.yml b/.github/actions/setup_ubuntu_build/action.yml new file mode 100644 index 000000000..c532cfb6b --- /dev/null +++ b/.github/actions/setup_ubuntu_build/action.yml @@ -0,0 +1,34 @@ +name: setup-ubuntu-build +description: Setup ubuntu ready for building. Does not include cache which is separate + +inputs: + build_type: + description: 'build type (Release, RelAssert)' + default: RelAssert + llvm_version: + description: 'TBD' + default: 16 + ubuntu_version: + description: 'TBD' + default: 22.04 + + +runs: + # We don't want a new docker just a list of steps, so mark as composite + using: "composite" + steps: + - name: Install prerequisites + shell: bash + run: | + sudo apt-get install -y spirv-tools + pip install lit + + - name: Install Ninja + uses: llvm/actions/install-ninja@main + + - name: load llvm + uses: actions/cache/restore@v3 + with: + path: llvm_install/** + key: llvm-ubuntu-${{ inputs.ubuntu_version }}-v${{ inputs.llvm_version}}-${{ inputs.build_type }} + fail-on-cache-miss: true diff --git a/.github/workflows/build_mr_cache.yml b/.github/workflows/build_mr_cache.yml new file mode 100644 index 000000000..da236d2d1 --- /dev/null +++ b/.github/workflows/build_mr_cache.yml @@ -0,0 +1,63 @@ +# Simple workflow for building sccache for PR testing +name: Build cache for PR testing +# Note this will currently create a new sscache file and this must be manually pruned until such time as we have a job +# for this. +on: + push: + branches: + - colin/add_cached_mr_building # Change to main before review + path: [.github/workflows/build_mr_cache.yml, .github/do_build_ock/**] + # 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: Checkout repo + uses: actions/checkout@v3 + + # installs tools, ninja and installs llvm (default 16, RelAssert) + - name: setup-ubuntu + uses: ./.github/actions/setup_ubuntu_build + + # note the PR testing usage should set 'save' to false, to avoid PR testing creating new caches on a branch + - name: Setup sccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: 200M + key: sccache-build + variant: sccache + + - name: build_mr_x86-cl3.0-release + uses: ./.github/actions/do_build_ock + with: + build_type: Release + + - name: build_mr_x86-offline + uses: ./.github/actions/do_build_ock + with: + build_type: Release + extra_flags: -DCA_RUNTIME_COMPILER_ENABLED=OFF -DCA_EXTERNAL_CLC=${{ github.workspace }}/build/bin/clc + build_dir: build_offline + build_targets: UnitCL + + - name: run host offline for extra checking + run: + ninja -C build check-UnitCL + + - name: clean_build + run: + rm -rf ${{ github.workspace }}/build* + + - name: build_mr-ubuntu-gcc-x86_64-riscv-3.0_m1 + uses: ./.github/actions/do_build_ock/do_build_m1 + + - name: run riscv M1 UnitCL for extra checking + run: + ninja -C build check-UnitCL + + - name: run riscv M1 lit for extra checking + run: + ninja -C build check-all-lit diff --git a/.github/workflows/merge_request.yml b/.github/workflows/merge_request.yml deleted file mode 100644 index 36ce81905..000000000 --- a/.github/workflows/merge_request.yml +++ /dev/null @@ -1,91 +0,0 @@ -# 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_x86-offline - uses: ./.github/actions/build_ock - with: - build_type: Release - mux_targets_enable: host - extra_flags: -DCA_RUNTIME_COMPILER_ENABLED=OFF -DCA_EXTERNAL_CLC=${{ github.workspace }}/build/bin/clc - build_dir: build_offline - build_targets: UnitCL - - # - python -u scripts/build.py -GNinja --verbose --clean - # --build_type $BuildType --arch $Arch --compiler $Compiler - # --binary_dir build_offline --target check-ComputeAorta - # --offline_only --external_clc $CI_PROJECT_DIR/oneapi-construction-kit/build/bin/clc - # -DCA_CL_ENABLE_ICD_LOADER=ON - # -DCA_ENABLE_HOST_IMAGE_SUPPORT=$Images - # -DCA_HOST_ENABLE_FP16=$FP16 - # -DOCL_EXTENSION_cl_khr_command_buffer=$CommandBuffer - # -DOCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=$CommandBuffer - # -DCA_USE_LINKER=gold - - # - 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_offline check-UnitCL - - name: run_it_for_demo2 - run: - ninja -C build_offline check-all-lit -