Skip to content

Commit

Permalink
Add test unitcl using ock artefact
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Dec 12, 2024
1 parent 39f6c34 commit 30e5032
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 12 deletions.
24 changes: 18 additions & 6 deletions .github/actions/do_build_ock_artefact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ inputs:
default: '19'
target:
description: 'target architecture'
create_ock_artefact_method:
description: 'method of creating ock artefact - build,<run_id>'
default: "build"

# TODO: This has not been tested yet on windows so would likely need some updating.
runs:
Expand All @@ -29,21 +32,23 @@ runs:
# installs tools, ninja, installs llvm and sets up sccache
- name: setup
uses: ./.github/actions/setup_build
if: inputs.create_ock_artefact_method == 'build'
with:
llvm_version: ${{ inputs.llvm_version }}
llvm_build_type: RelAssert
cross_arch: ${{ steps.calc_vars.outputs.arch == 'x86_64' && 'none' || steps.calc_vars.outputs.arch }}

- name: build ock x86
if: steps.calc_vars.outputs.arch == 'x86_64'
if: steps.calc_vars.outputs.arch == 'x86_64' && inputs.create_ock_artefact_method == 'build'
uses: ./.github/actions/do_build_ock
with:
build_targets: install
offline_kernel_tests: OFF
extra_flags: -DCA_ENABLE_TESTS=OFF -DCA_ENABLE_EXAMPLES=OFF -DCA_ENABLE_DOCUMENTATION=OFF
# Todo: allow tests or no tests via a flag.
extra_flags: -DCA_ENABLE_EXAMPLES=OFF -DCA_ENABLE_DOCUMENTATION=OFF

- name: build ock other ${{ matrix.target }}
if: steps.calc_vars.outputs.arch != 'x86_64'
if: steps.calc_vars.outputs.arch != 'x86_64' && inputs.create_ock_artefact_method == 'build'
uses: ./.github/actions/do_build_ock
with:
build_targets: install
Expand All @@ -53,19 +58,26 @@ runs:
offline_kernel_tests: OFF
host_fp16: ON

- name: download previous ock if needed ${{ matrix.target }} ${{ matrix.create_ock_artefact_method}}
shell: bash
if: inputs.create_ock_artefact_method != 'build'
run: |
gh run download ${{ inputs.create_ock_artefact_method }} -n ock_${{ inputs.target }} -D install
ls install
# Prune it as there is too much things in there we don't want to use
# Todo: move this logic to cmake settings so that we build only what we
# want to install. As time goes on we may want to install more.
- name: prune ock artefact
shell: bash
run: |
# delete all but clc, city runner and the python associated file under bin
find install/bin -maxdepth 1 -type f -and ! \( -name "*.py" -o -name "*clc" \) -delete
rm -rf install/share
find install/bin -maxdepth 1 -type f -and ! \( -name "*.py" -o -name "*clc" -o -name "*UnitCL*" \) -delete
# rm -rf install/share
- name: upload ock artefact
uses: actions/upload-artifact@v4
with:
name: ock_${{ inputs.target }}
path: install
retention-days: 1
retention-days: 3
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
# pull_request:
# branches:
# - main
paths:
- 'source/**'
- 'clik/**'
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ on:
required: false
type: boolean
default: false
test_ock_artefact_unitcl:
# UnitCL testing via an ock artefact (i.e. not standalone)
required: false
type: boolean
default: true
create_ock_artefact_method:
# How to create the ock artefact
required: false
type: string
default: "build"

jobs:

Expand All @@ -35,13 +45,15 @@ jobs:
runs-on: ubuntu-22.04
outputs:
matrix_only_linux_x86_64_aarch64: ${{ steps.vars.outputs.matrix_only_linux_x86_64_aarch64 }}
matrix_only_linux_aarch64: ${{ steps.vars.outputs.matrix_only_linux_aarch64 }}
matrix_only_linux_x86_64: ${{ steps.vars.outputs.matrix_only_linux_x86_64 }}
steps:
- id: vars
# TODO: If we expand on this, come up with a more programmatical way of doing only certain targets.
# These variables are for excluding certain targets from the total list, which is why just including
# two targets is a long list of excludes
run: |
echo matrix_only_linux_aarch64="[ {\"target\": \"host_x86_64_linux\"}, {\"target\": \"host_arm_linux\"}, {\"target\": \"host_riscv64_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT
echo matrix_only_linux_x86_64_aarch64="[ {\"target\": \"host_arm_linux\"}, {\"target\": \"host_riscv64_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT
echo matrix_only_linux_x86_64="[ {\"target\": \"host_aarch64_linux\"}, {\"target\": \"host_riscv64_linux\"}, {\"target\": \"host_arm_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
Expand All @@ -62,11 +74,21 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up secret ubuntu
if: !startsWith(runner.os, 'Windows')
run:
echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: set up secret windows
if: startsWith(runner.os, 'Windows')
run:
echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $env:GITHUB_ENV

- name: build ock artefact
uses: ./.github/actions/do_build_ock_artefact
with:
target: ${{ matrix.target }}
llvm_version: ${{ inputs.llvm_version }}
create_ock_artefact_method: ${{ inputs.create_ock_artefact_method }}

build_icd:
if: inputs.test_tornado || inputs.test_opencl_cts
Expand Down Expand Up @@ -149,3 +171,23 @@ jobs:
with:
target: ${{ matrix.target }}

test_unitcl_ock_artefact:
if: inputs.test_ock_artefact_unitcl
needs: [workflow_vars, create_ock_artefacts ]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}
runs-on: ubuntu-22.04
# TODO: Look into running on aarch64/riscv64 (and aarch64 hardware)
steps:
- name: Download ock artefact
uses: actions/download-artifact@v4
with:
name: ock_${{matrix.target}}
path: install_ock
- name: run unitcl
# chmod +x here since archiving removes execute permissions
run:
chmod +x ./install_ock/bin/UnitCL;
LD_LIBRARY_PATH=$PWD/install_ock/lib OCL_ICD_FILENAMES=$PWD/install_ock/lib/libCL.so ./install_ock/bin/UnitCL --gtest_filter=Exec*Task_01_02*
11 changes: 8 additions & 3 deletions .github/workflows/planned_testing_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ jobs:
if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule'
uses: ./.github/workflows/planned_testing.yml
with:
target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
test_tornado: true
test_opencl_cts: true
# target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
target_list: '["host_x86_64_linux" ]'
# test_tornado: true
# test_opencl_cts: true
test_opencl_cts: false
test_tornado: false
test_ock_artefact_unitcl: true
# Have a pull request setting which can be used to test the flow as best as possible
# in a reasonable time
pull_request: ${{ github.event_name == 'pull_request' }}
create_ock_artefact_method: 12282430965

0 comments on commit 30e5032

Please sign in to comment.