Skip to content

Commit

Permalink
First
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-forbes-cp committed Dec 19, 2024
1 parent ec3b102 commit 29bf8ef
Showing 1 changed file with 26 additions and 167 deletions.
193 changes: 26 additions & 167 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,173 +35,32 @@ jobs:

# Calculate some useful variables that can be used through the workflow
# Currently this can be used to exclude all but certain targets in matrices
workflow_vars:
alan:
runs-on: ubuntu-22.04
outputs:
matrix_only_linux_x86_64_aarch64: ${{ steps.vars.outputs.matrix_only_linux_x86_64_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_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
create_ock_artefacts:
needs: [workflow_vars]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}

# risc-v needs ubuntu 24.04 so we get the latest qemu as well as how we
# build llvm. Otherwise we choose windows or ubuntu-22.04 depending on the
# target.
runs-on: ${{ (contains(matrix.target, 'host_riscv') && 'ubuntu-24.04') || (contains(matrix.target, 'windows') && 'windows-2019' || 'ubuntu-22.04' ) }}
if : inputs.ock
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: build ock artefact
uses: ./.github/actions/do_build_ock_artefact
with:
target: ${{ matrix.target }}
llvm_version: ${{ inputs.llvm_version }}

build_icd:
if: inputs.test_tornado || inputs.test_opencl_cts || inputs.test_sycl_cts
needs: [workflow_vars]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}

runs-on: ubuntu-22.04
steps:
- name: clone ock platform
uses: actions/checkout@v4
with:
sparse-checkout: |
platform
.github
- name : build and upload icd ${{matrix.target}}
uses: ./.github/actions/do_build_icd
with:
target: ${{matrix.target}}


# Currently only builds and runs on x86_64 linux
build_run_tornado:
if: inputs.test_tornado
needs: [ workflow_vars, build_icd, create_ock_artefacts ]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}

# Todo: expand for aarch64
runs-on: ubuntu-22.04
steps:
- name: clone ock platform
uses: actions/checkout@v4
with:
sparse-checkout: |
platform
.github
# TODO: Consider separating out tornado build and run in the future
- name : build and upload tornado
uses: ./.github/actions/do_build_tornado
with:
target: ${{ matrix.target }}
- name : run tornado
uses: ./.github/actions/run_tornado
with:
target: ${{ matrix.target }}

# Currently only builds and runs (default: quick) on x86_64 linux
build_run_opencl_cts:
if: inputs.test_opencl_cts
needs: [ workflow_vars, build_icd, create_ock_artefacts ]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}

# TODO: host-x86_64-linux only - expand for other targets
runs-on: ubuntu-22.04
steps:
- name: clone ock
uses: actions/checkout@v4
with:
# scripts: for run_cities.py
# source: for CTS filter.csv files
sparse-checkout: |
scripts
source
.github
# 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 }}
- name : run opencl_cts
uses: ./.github/actions/run_opencl_cts
with:
target: ${{ matrix.target }}

build_dpcpp_native_host:
needs: [workflow_vars]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}

runs-on: ${{ contains(matrix.target, 'windows') && 'windows-2019' || 'ubuntu-22.04' }}
if : inputs.test_sycl_cts
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: build dpc++ artefact
uses: ./.github/actions/do_build_dpcpp
with:
target: ${{ matrix.target }}

build_sycl_cts:
needs: [workflow_vars, build_icd, build_dpcpp_native_host]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
# TODO: For now just linux x86_64
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}

runs-on: 'ubuntu-22.04'
if : inputs.test_sycl_cts
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: build dpc++ artefact
uses: ./.github/actions/do_build_sycl_cts
with:
target: ${{ matrix.target }}

run_sycl_cts:
needs: [workflow_vars, create_ock_artefacts, build_dpcpp_native_host, build_sycl_cts]
strategy:
matrix:
target: ${{ fromJson(inputs.target_list) }}
# TODO: For now just linux x86_64
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}

runs-on: 'ubuntu-22.04'
if : inputs.test_sycl_cts
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: build dpc++ artefact
uses: ./.github/actions/run_sycl_cts
- name: Download ock artefact
uses: actions/download-artifact@v4
with:
target: ${{ matrix.target }}
name: ock_${{inputs.target}}
path: install_ock

- name: Run opencl cts
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?
run: |
cd "$GITHUB_WORKSPACE/OpenCL-CTS"
echo "Running OpenCL CTS tests with CTS file $CTS_CSV_FILE with filter $CTS_FILTER"
set -x
echo python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \
--color=always --timeout $CTS_TIMEOUT \
-p qemu --qemu '/usr/bin/qemu-aarch64 -L /usr/aarch64-linux-gnu' \
-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"

0 comments on commit 29bf8ef

Please sign in to comment.