Skip to content

Commit

Permalink
TBD
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Dec 13, 2024
1 parent 39f6c34 commit 95b8cae
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 14 deletions.
15 changes: 13 additions & 2 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,22 @@ 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

- 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,6 +57,13 @@ 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.
Expand Down
22 changes: 20 additions & 2 deletions .github/actions/do_build_opencl_cts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,47 @@ description: build opencl cts
inputs:
target:
description: 'target architecture'

create_opencl_cts_artefact_method:
description: 'method of creating ock artefact - build,<run_id>'
default: "build"
runs:
using: "composite"
steps:
- name: calc vars
if: inputs.create_opencl_cts_artefact_method == 'build'
id: calc_vars
uses: ./.github/actions/calc_vars
with:
target: ${{ inputs.target }}

- name: Install Ninja
if: inputs.create_opencl_cts_artefact_method == 'build'
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main branch

- name: download icd artifact
# Currently need to do the even if we are installing as build and run have
# not been separated into different jobs
uses: actions/download-artifact@v4
with:
name: icd_${{inputs.target}}
path: install_icd

- name: download header artifact
if: inputs.create_opencl_cts_artefact_method == 'build'
uses: actions/download-artifact@v4
with:
name: header_${{inputs.target}}
path: install_headers

- name: checkout test suite
if: inputs.create_opencl_cts_artefact_method == 'build'
uses: actions/checkout@v4
with:
repository: KhronosGroup/OpenCL-CTS
path: OpenCL-CTS

- name: build opencl cts
if: inputs.create_opencl_cts_artefact_method == 'build'
shell: bash
env:
# TODO: host-x86_64-linux 'toolchain' - expand for other targets
Expand Down Expand Up @@ -63,6 +72,15 @@ runs:
--source-dir $GITHUB_WORKSPACE/OpenCL-CTS/test_conformance/spirv_new/spirv_asm \
--output-dir $GITHUB_WORKSPACE/test_conformance/spirv_bin
- name: download previous opencl_cts if needed ${{ matrix.target }} ${{ matrix.create_ock_artefact_method}}
shell: bash
if: inputs.create_opencl_cts_artefact_method != 'build'
run: |
gh run download ${{ inputs.create_opencl_cts_artefact_method }} -n opencl_cts_${{ inputs.target }} -D test_conformance
pwd
echo ls $PWD/test_conformance
ls test_conformance
- name: upload opencl cts artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -77,5 +95,5 @@ runs:
!test_conformance/**/*.ninja
!test_conformance/test_common
!test_conformance/test_common/**
retention-days: 1
retention-days: 2

35 changes: 28 additions & 7 deletions .github/actions/run_opencl_cts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,40 @@ runs:
shell: bash
env:
CTS_CSV_FILE: opencl_conformance_tests_${{inputs.test_type}}.csv
# TODO: host-x86_64-linux filter - expand for other targets
CTS_FILTER: cts-3.0-online-ignore-linux-host.csv
CTS_TIMEOUT: 18:00:00 # OK for github?
CTS_FILTER: cts-3.0-online-ignore-linux-host.csv

run: |
cd "$GITHUB_WORKSPACE/OpenCL-CTS"
echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER"
set -x
pwd
echo ls $PWD/test_conformance
# Todo: always download artefact and ensure artefacts are stored with permissions using an action that uses tar
chmod +x test_conformance/*/*
echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER"
echo > expect_fail.csv
# $CTS_FILTER ignores certain test, so is treated differently to temporary fails.
cat expect_fail.csv "$GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER" > disable.csv
[ -f .github/opencl_cts/expect_fail_all.csv ] && cat .github/opencl_cts/expect_fail_all.csv >> expect_fail.csv
[ -f .github/opencl_cts/expect_fail_${{ inputs.target }}.csv ] && cat .github/opencl_cts/expect_fail_${{ inputs.target }}.csv >> expect_fail.csv
python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \
--color=always --timeout $CTS_TIMEOUT \
--color=always --timeout 05:00:00 \
-b "$GITHUB_WORKSPACE/test_conformance" \
-L "$GITHUB_WORKSPACE/install_icd/lib" \
-e "CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc" \
-e "OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so" \
-e "CL_PLATFORM_INDEX=0" \
-s "$GITHUB_WORKSPACE/test_conformance/$CTS_CSV_FILE" \
-i "$GITHUB_WORKSPACE/source/cl/scripts/$CTS_FILTER"
-i disable.csv
- name: Run expected failed opencl cts
shell: bash
run: |
echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER"
set -x
python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \
--color=always --timeout 05:00:00 \
-b "$GITHUB_WORKSPACE/test_conformance" \
-L "$GITHUB_WORKSPACE/install_icd/lib" \
-e "CLC_EXECUTABLE=$GITHUB_WORKSPACE/install_ock/bin/clc" \
-e "OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so" \
-e "CL_PLATFORM_INDEX=0" \
-s expect_fail.csv || echo failed as expected
1 change: 1 addition & 0 deletions .github/opencl_cts/expect_fail_all.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API,api/test_api
24 changes: 23 additions & 1 deletion .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
create_ock_artefact_method:
# How to create the ock artefact build or workflow id
required: false
type: string
default: "build"
create_opencl_cts_artefact_method:
# How to create the ock opencl cts build or workflow id
required: false
type: string
default: "build"

jobs:

Expand Down Expand Up @@ -62,11 +72,20 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up secret ubuntu
if: startsWith(runner.os, 'Windows') != true
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 @@ -139,13 +158,16 @@ jobs:
scripts
source
.github
- name: set up secret ubuntu
run:
echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
# TODO: Consider separating out opencl_cts build and run in the future
- name : build and upload opencl_cts
uses: ./.github/actions/do_build_opencl_cts
with:
target: ${{ matrix.target }}
create_opencl_cts_artefact_method: ${{ inputs.create_opencl_cts_artefact_method }}
- name : run opencl_cts
uses: ./.github/actions/run_opencl_cts
with:
target: ${{ matrix.target }}

8 changes: 6 additions & 2 deletions .github/workflows/planned_testing_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ 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
# 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_tornado: false
test_opencl_cts: true
# Have a pull request setting which can be used to test the flow as best as possible
# in a reasonable time
create_ock_artefact_method: 12300776706
create_opencl_cts_artefact_method: 12300776706
pull_request: ${{ github.event_name == 'pull_request' }}

0 comments on commit 95b8cae

Please sign in to comment.