Skip to content

Commit

Permalink
Add opencl cts aarch64 linux to planned testing (uxlfoundation#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-forbes-cp authored and coldav committed Jan 16, 2025
1 parent f74fd85 commit dc2747a
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/actions/calc_vars/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
CMAKE_TOOLCHAIN="--toolchain $TOOLCHAIN"
elif [[ "${{inputs.target}}" = "host_riscv64_linux" ]]; then
ARCH=riscv64 >> $GITHUB_OUTPUT
TOOLCHAIN=$GITHUB_WORKSPACE/platform/riscv64-linux/riscv64-toolchain.cmake
TOOLCHAIN=$GITHUB_WORKSPACE/platform/riscv64-linux/riscv64-gcc-toolchain.cmake
CMAKE_TOOLCHAIN="--toolchain $TOOLCHAIN"
else
echo Unknown target ${{inputs.target}}
Expand Down
25 changes: 14 additions & 11 deletions .github/actions/do_build_icd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ runs:

- name: cmake headers
shell: bash
run:
cmake headers -Bheaders/build_${{steps.calc_vars.outputs.arch}}
-DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }}
-DCMAKE_INSTALL_PREFIX=$PWD/headers_install_${{steps.calc_vars.outputs.arch}}
run: |
set -x
cmake headers -Bheaders/build_${{steps.calc_vars.outputs.arch}} \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }} \
-DCMAKE_INSTALL_PREFIX=$PWD/headers_install_${{steps.calc_vars.outputs.arch}} \
-GNinja
- name: ninja install headers
shell: bash
run:
Expand All @@ -56,13 +58,14 @@ runs:

- name: icd cmake
shell: bash
run:
cmake icd -B icd/build_${{steps.calc_vars.outputs.arch}}
-DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }}
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }}
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install_icd_${{steps.calc_vars.outputs.arch}}
-DOpenCLHeaders_DIR=$GITHUB_WORKSPACE/headers_install_${{steps.calc_vars.outputs.arch}}/share/cmake/OpenCLHeaders
-GNinja
run: |
set -x
cmake icd -B icd/build_${{steps.calc_vars.outputs.arch}} \
-DCMAKE_TOOLCHAIN_FILE=${{ steps.calc_vars.outputs.toolchain }} \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install_icd_${{steps.calc_vars.outputs.arch}} \
-DOpenCLHeaders_DIR=$GITHUB_WORKSPACE/headers_install_${{steps.calc_vars.outputs.arch}}/share/cmake/OpenCLHeaders \
-GNinja
- name: icd build
shell: bash
Expand Down
4 changes: 4 additions & 0 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'
vulkan_sdk_install:
description: 'vulkan install flag'
default: true

# TODO: This has not been tested yet on windows so would likely need some updating.
runs:
Expand All @@ -33,6 +36,7 @@ runs:
llvm_version: ${{ inputs.llvm_version }}
llvm_build_type: RelAssert
cross_arch: ${{ steps.calc_vars.outputs.arch == 'x86_64' && 'none' || steps.calc_vars.outputs.arch }}
vulkan_sdk_install: ${{ inputs.vulkan_sdk_install }}
os: ${{ contains(inputs.target, 'windows') && 'windows' || 'ubuntu' }}

- name: build ock x86
Expand Down
22 changes: 18 additions & 4 deletions .github/actions/do_build_opencl_cts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,27 @@ runs:
repository: KhronosGroup/OpenCL-CTS
path: OpenCL-CTS

- name: build opencl cts
- name: aarch64 set-up # TODO: update if/when qemu no longer used
if: steps.calc_vars.outputs.arch == 'aarch64'
shell: bash
run: |
set -x
sudo sed -i -e '/^deb /{h;s|deb |&[arch=amd64,i386] |p;g;s|deb http://[^ ]*|deb [arch=arm64,riscv64] http://ports.ubuntu.com/ubuntu-ports|p;d}' /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo apt-get install --yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get update
if [[ "${{inputs.target}}" =~ .*aarch64.* ]] ; then
# TODO: Only needed for run - could be moved to corresponding run action
echo QEMU INSTALL MATCH FOR ${{inputs.target}}
sudo apt-get install --yes qemu-user
fi
- name: build opencl cts
shell: bash
env:
# TODO: host-x86_64-linux 'toolchain' - expand for other targets
CMAKE_TOOLCHAIN: "-DCMAKE_C_COMPILER=gcc -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS=-m64 -DPKG_CONFIG_EXECUTABLE=pkg-config"
CMAKE_TOOLCHAIN: "${{ steps.calc_vars.outputs.cmake_toolchain }}"
run: |
echo CMAKE_TOOLCHAIN is: $CMAKE_TOOLCHAIN
# get spirv-as
sudo apt-get update
sudo apt-get install -y spirv-tools
Expand Down
28 changes: 18 additions & 10 deletions .github/actions/run_opencl_cts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,27 @@ runs:
shell: bash
env:
CTS_CSV_FILE: opencl_conformance_tests_${{inputs.test_type}}.csv
# TODO: host-x86_64-linux filter - expand for other targets
# TODO: expand filter 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"
export QEMU_SETTING=""
if [[ "${{inputs.target}}" =~ .*aarch64.* ]] ; then
echo QEMU SETTINGS MATCH FOR ${{inputs.target}}
QEMU_SETTING="-p qemu --qemu '/usr/bin/qemu-aarch64 -L /usr/aarch64-linux-gnu'"
fi
set -x
python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \
--color=always --timeout $CTS_TIMEOUT \
-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"
# Note: use 'eval' built-in to handle quoting/escaping/splitting reqs
RUN_CITIES="python -u $GITHUB_WORKSPACE/scripts/testing/run_cities.py -v \
--color=always --timeout $CTS_TIMEOUT \
$QEMU_SETTING \
-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"
eval $RUN_CITIES
7 changes: 6 additions & 1 deletion .github/actions/setup_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
description: 'Enable installing of clang-tidy (currently 19)'
type: boolean
default: false
vulkan_sdk_install:
description: 'vulkan install flag'
default: true

runs:
# We don't want a new docker just a list of steps, so mark as composite
Expand Down Expand Up @@ -60,7 +63,9 @@ runs:
# required for gtest-terse-runner running in docker
sudo apt-get install --yes python3-colorama
sudo apt-get install --yes doxygen
sudo apt-get install --yes vulkan-sdk
if [ "${{ inputs.vulkan_sdk_install }}" = "true" ]; then \
sudo apt-get install --yes vulkan-sdk
fi
# TODO: Only required if we are running something that requires qemu, not required for building
if [ "${{ inputs.cross_arch }}" != "none" ] && [ "${{ inputs.cross_arch }}" != "x86" ]; then \
# Install QEMU for testing cross compilation.
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
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_windows:
needs: [workflow_vars]
# Currently there is only one windows target so we don't bother with the
Expand All @@ -74,6 +73,7 @@ jobs:
create_ock_artefacts_ubuntu:
needs: [workflow_vars]
strategy:
fail-fast: false # let all matrix jobs complete
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}
Expand All @@ -94,11 +94,13 @@ jobs:
with:
target: ${{ matrix.target }}
llvm_version: ${{ inputs.llvm_version }}
vulkan_sdk_install: false

build_icd:
if: inputs.test_tornado || inputs.test_opencl_cts || inputs.test_sycl_cts
needs: [workflow_vars]
strategy:
fail-fast: false # let all matrix jobs complete
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}
Expand Down Expand Up @@ -145,14 +147,14 @@ jobs:
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_ubuntu ]
strategy:
fail-fast: false # let all matrix jobs complete
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}

# TODO: host-x86_64-linux only - expand for other targets
runs-on: cp-ubuntu-24.04
Expand All @@ -166,9 +168,11 @@ jobs:
with:
# scripts: for run_cities.py
# source: for CTS filter.csv files
# platform: for toolchain files
sparse-checkout: |
scripts
source
platform
.github
# TODO: Consider separating out opencl_cts build and run in the future
- name : build and upload opencl_cts
Expand Down

0 comments on commit dc2747a

Please sign in to comment.