Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenCL_CTS (x86_64/linux) to planned testing #599

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
469196f
Commit Colins versions @ 5e091fd0
alan-forbes-cp Nov 26, 2024
844f8b3
Commit Colins versions @ 5e091fd0
alan-forbes-cp Nov 26, 2024
0ac8b14
Disable CodeQL and PR tests
alan-forbes-cp Nov 26, 2024
5f4863f
Initil opencl cts structure
alan-forbes-cp Nov 26, 2024
987fc0c
Enable build_icd
alan-forbes-cp Nov 26, 2024
633f87f
add listing to opencl_cts build
alan-forbes-cp Nov 27, 2024
3070e3e
Disabled OCK artefacts; download headers artefact
alan-forbes-cp Nov 27, 2024
9444329
Formally disable ock
alan-forbes-cp Nov 27, 2024
481b3a3
Remove need for OCK artefacts for opencl_cts
alan-forbes-cp Nov 27, 2024
a31af59
Move listing below downloads
alan-forbes-cp Nov 27, 2024
609664a
Fix dummy artefact
alan-forbes-cp Nov 27, 2024
2a67d89
Remove download ock from run for now
alan-forbes-cp Nov 27, 2024
5d212cf
Add cmake call
alan-forbes-cp Nov 28, 2024
75c6858
Fix install_headers dir
alan-forbes-cp Nov 28, 2024
caa22a5
release => Releasae
alan-forbes-cp Nov 28, 2024
f675877
add assemble_spirv.py script call
alan-forbes-cp Nov 28, 2024
e97b576
Merge branch 'main' into alan/OR-629_opencl_cts_testing
alan-forbes-cp Nov 28, 2024
ab4151c
fix python call
alan-forbes-cp Nov 28, 2024
35a6f9f
Fix python output dir.
alan-forbes-cp Nov 28, 2024
2367694
Enable ock and tidy following rebase
alan-forbes-cp Nov 28, 2024
db6f65c
Remove whitespace and improve listing
alan-forbes-cp Nov 28, 2024
a0d9600
Fix listing vars
alan-forbes-cp Nov 28, 2024
1676152
Add spirv-tools (for spirv-as)
alan-forbes-cp Nov 29, 2024
69736fc
Add proper artefacts
alan-forbes-cp Nov 29, 2024
e61c098
add artefact exclusions
alan-forbes-cp Nov 29, 2024
8e90224
update artefact exclusions
alan-forbes-cp Nov 29, 2024
b101721
add further artefacts and tidy exclusion
alan-forbes-cp Nov 29, 2024
196a92d
finalise artefacts
alan-forbes-cp Nov 29, 2024
15d9975
tidy logging
alan-forbes-cp Nov 29, 2024
65f9ecb
restructure; resolve some TODOs
alan-forbes-cp Nov 29, 2024
dc101fc
Remove env vars
alan-forbes-cp Nov 29, 2024
2089ce3
formal git checkout for test suite
alan-forbes-cp Nov 29, 2024
8d62c03
fix repo name
alan-forbes-cp Nov 29, 2024
923df2c
Set path for repo
alan-forbes-cp Nov 29, 2024
dd88bee
add patches ; remove toolchain
alan-forbes-cp Nov 29, 2024
35e8ce4
move patch application
alan-forbes-cp Nov 29, 2024
f52401f
Resolve TODO; use pushd/popd
alan-forbes-cp Nov 29, 2024
08c242e
Move python call to run job
alan-forbes-cp Nov 29, 2024
70a7641
remove pushd/popd
alan-forbes-cp Nov 29, 2024
c9b72d6
tidy comments
alan-forbes-cp Nov 29, 2024
722cd7f
restore exclusions
alan-forbes-cp Nov 29, 2024
0b591b8
Remove extra shell from run
alan-forbes-cp Nov 29, 2024
bd3cf95
remove old comment
alan-forbes-cp Nov 29, 2024
8aff410
Update run job; remove cllayerinfo artefact
alan-forbes-cp Dec 2, 2024
be26604
Add ock artefacts to opencl-cts
alan-forbes-cp Dec 2, 2024
82999f8
Fix ock artefact download
alan-forbes-cp Dec 2, 2024
ab52caf
Additional repo checkouts; add clc to ock artifact; opencl-cts run l…
alan-forbes-cp Dec 2, 2024
68d9ecf
Fix find command for clc
alan-forbes-cp Dec 2, 2024
ca7ee04
add python call
alan-forbes-cp Dec 2, 2024
c1e300d
tidy logging and python call
alan-forbes-cp Dec 2, 2024
2c6f487
update logging
alan-forbes-cp Dec 2, 2024
4b1be89
Update opencl-cts artefacts
alan-forbes-cp Dec 2, 2024
8990bb4
Point python at new artefacts
alan-forbes-cp Dec 2, 2024
a608c77
Use full paths
alan-forbes-cp Dec 3, 2024
76ffa74
Refactor artefact list; add quick|full test type; update logging
alan-forbes-cp Dec 3, 2024
f93302a
reformat build commands
alan-forbes-cp Dec 3, 2024
2d99888
add "toolchain"
alan-forbes-cp Dec 3, 2024
64247fc
Tidy comments and logging
alan-forbes-cp Dec 3, 2024
d0d51c6
remove platform; tidy formatting
alan-forbes-cp Dec 3, 2024
0dd60cd
Update comments following review
alan-forbes-cp Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/do_build_ock_artefact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ runs:
- name: prune ock artefact
shell: bash
run: |
# delete all but city runner and the python associated file under bin
find install/bin -maxdepth 1 -type f ! -name "*.py" -delete
# 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

- name: upload ock artefact
Expand Down
81 changes: 81 additions & 0 deletions .github/actions/do_build_opencl_cts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: build opencl cts
description: build opencl cts

inputs:
target:
description: 'target architecture'

runs:
using: "composite"
steps:
- name: calc vars
id: calc_vars
uses: ./.github/actions/calc_vars
with:
target: ${{ inputs.target }}

- name: Install Ninja
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main branch

- name: download icd artifact
uses: actions/download-artifact@v4
with:
name: icd_${{inputs.target}}
path: install_icd

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

- name: checkout test suite
uses: actions/checkout@v4
with:
repository: KhronosGroup/OpenCL-CTS
path: OpenCL-CTS

- 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"
run: |
# get spirv-as
sudo apt-get update
sudo apt-get install -y spirv-tools
# apply patches
pushd OpenCL-CTS
git log -1
git apply $GITHUB_WORKSPACE/.github/patches/OpenCL-CTS-0001-Patch-sub-group-testing.patch
git apply $GITHUB_WORKSPACE/.github/patches/OpenCL-CTS-0002-Permit-building-for-unknown-architectures.patch
popd
# do build
set -x
cmake -G Ninja $CMAKE_TOOLCHAIN $GITHUB_WORKSPACE/OpenCL-CTS \
-DCMAKE_BUILD_TYPE=Release \
-DOPENCL_LIBRARIES=OpenCL \
-DCL_INCLUDE_DIR=$GITHUB_WORKSPACE/install_headers/include \
-DCL_LIB_DIR=$GITHUB_WORKSPACE/install_icd/lib
ninja -v
python3 $GITHUB_WORKSPACE/OpenCL-CTS/test_conformance/spirv_new/assemble_spirv.py -v \
--source-dir $GITHUB_WORKSPACE/OpenCL-CTS/test_conformance/spirv_new/spirv_asm \
--output-dir $GITHUB_WORKSPACE/test_conformance/spirv_bin

- name: upload opencl cts artifacts
uses: actions/upload-artifact@v4
with:
name: opencl_cts_${{inputs.target}}
path: |
test_conformance
!test_conformance/**/.*
!test_conformance/**/CMakeCache.txt
!test_conformance/**/CMakeFiles
!test_conformance/**/CMakeFiles/**
!test_conformance/**/*.cmake
!test_conformance/**/*.ninja
!test_conformance/test_common
!test_conformance/test_common/**
retention-days: 1

41 changes: 41 additions & 0 deletions .github/actions/run_opencl_cts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: run opencl cts
description: run opencl cts

# This action is not standalone and assumes it has been run after the build_opencl_cts action.

inputs:
target:
description: 'target architecture'
test_type:
description: 'quick | full'
default: "quick"

runs:
using: "composite"
steps:
- name: Download ock artefact
uses: actions/download-artifact@v4
with:
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
python -u "$GITHUB_WORKSPACE/scripts/testing/run_cities.py" -v \
coldav marked this conversation as resolved.
Show resolved Hide resolved
--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"
34 changes: 34 additions & 0 deletions .github/patches/OpenCL-CTS-0001-Patch-sub-group-testing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 3c250cfe63b7af59ce0141885596a426053fe669 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <[email protected]>
Date: Mon, 30 Jan 2023 14:06:50 +0000
Subject: [PATCH] Patch sub-group testing

There's currently a bug in the CTS whereby our degenerate sub-groups
crash the test, which uses too small a fixed data structure to track all
work-items in a work-group larger than 128.

While we wait for an official patch upstream, I've quickly patched it so
the data structure is as big as the largest local work-group size tested
by the tests.
---
test_conformance/subgroups/subhelpers.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test_conformance/subgroups/subhelpers.h b/test_conformance/subgroups/subhelpers.h
index 8600088e..fafe35fe 100644
--- a/test_conformance/subgroups/subhelpers.h
+++ b/test_conformance/subgroups/subhelpers.h
@@ -29,7 +29,8 @@
#include <map>

extern MTdata gMTdata;
-typedef std::bitset<128> bs128;
+// See https://github.com/KhronosGroup/OpenCL-CTS/pull/1621
+typedef std::bitset<200> bs128;
extern cl_half_rounding_mode g_rounding_mode;

bs128 cl_uint4_to_bs128(cl_uint4 v);
--
2.34.1


Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
From 4c1fa69fb30d94e5edb54d93364a332af0301b67 Mon Sep 17 00:00:00 2001
From: Harald van Dijk <[email protected]>
Date: Wed, 15 May 2024 17:57:47 +0100
Subject: [PATCH] Permit building for unknown architectures.

---
CMakeLists.txt | 3 ++-
test_common/harness/fpcontrol.h | 6 +++---
test_common/harness/rounding_mode.cpp | 5 +++--
test_common/harness/testHarness.cpp | 3 ++-
4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cfef6b3..0e4dd1f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,7 +78,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
endif()

if(NOT DEFINED CLConform_TARGET_ARCH)
- message (FATAL_ERROR "Target architecture not recognised. Exiting.")
+ message (WARNING "Target architecture not recognised.")
+ set(CLConform_TARGET_ARCH unknown)
endif()

macro(add_cxx_flag_if_supported flag)
diff --git a/test_common/harness/fpcontrol.h b/test_common/harness/fpcontrol.h
index 12aba0a9..c6f94140 100644
--- a/test_common/harness/fpcontrol.h
+++ b/test_common/harness/fpcontrol.h
@@ -70,7 +70,7 @@ inline void ForceFTZ(FPU_mode_type *mode)
#elif defined(__mips__)
fpa_bissr(FPA_CSR_FS);
#else
-#error ForceFTZ needs an implentation
+#warning ForceFTZ needs an implentation
#endif
}

@@ -98,7 +98,7 @@ inline void DisableFTZ(FPU_mode_type *mode)
#elif defined(__mips__)
fpa_bicsr(FPA_CSR_FS);
#else
-#error DisableFTZ needs an implentation
+#warning DisableFTZ needs an implentation
#endif
}

@@ -118,7 +118,7 @@ inline void RestoreFPState(FPU_mode_type *mode)
#elif defined(__mips__)
// Mips runs by default with DAZ=1 FTZ=1
#else
-#error RestoreFPState needs an implementation
+#warning RestoreFPState needs an implementation
#endif
}
#else
diff --git a/test_common/harness/rounding_mode.cpp b/test_common/harness/rounding_mode.cpp
index 191c04d9..3100a225 100644
--- a/test_common/harness/rounding_mode.cpp
+++ b/test_common/harness/rounding_mode.cpp
@@ -225,7 +225,8 @@ void *FlushToZero(void)
fpa_bissr(FPA_CSR_FS);
return NULL;
#else
-#error Unknown arch
+#warning Unknown arch
+ return NULL;
#endif
#else
#error Please configure FlushToZero and UnFlushToZero to behave properly on this operating system.
@@ -255,7 +256,7 @@ void UnFlushToZero(void *p)
#elif defined(__mips__)
fpa_bicsr(FPA_CSR_FS);
#else
-#error Unknown arch
+#warning Unknown arch
#endif
#else
#error Please configure FlushToZero and UnFlushToZero to behave properly on this operating system.
diff --git a/test_common/harness/testHarness.cpp b/test_common/harness/testHarness.cpp
index 0e3c49e9..4c565cec 100644
--- a/test_common/harness/testHarness.cpp
+++ b/test_common/harness/testHarness.cpp
@@ -1316,7 +1316,8 @@ void PrintArch(void)
#elif defined(__mips__)
vlog("ARCH:\tmips\n");
#else
-#error unknown arch
+#warning unknown arch
+ vlog("ARCH:\tunknown\n");
#endif

#if defined(__APPLE__)
--
2.43.0


39 changes: 37 additions & 2 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: false
type: boolean
default: true
test_opencl_cts:
required: false
type: boolean
default: true
target_list:
required: false
type: string
Expand Down Expand Up @@ -65,8 +69,7 @@ jobs:
llvm_version: ${{ inputs.llvm_version }}

build_icd:
# Will also be required for opencl
if: inputs.test_tornado
if: inputs.test_tornado || inputs.test_opencl_cts
needs: [workflow_vars]
strategy:
matrix:
Expand Down Expand Up @@ -114,3 +117,35 @@ jobs:
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 }}

1 change: 1 addition & 0 deletions .github/workflows/planned_testing_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
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
# 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' }}
Loading