-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenCL_CTS (x86_64/linux) to planned testing (#599)
Add OpenCL_CTS (x86_64/linux) to planned testing
- Loading branch information
1 parent
1f8bd7c
commit 39f6c34
Showing
7 changed files
with
294 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ | ||
--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
34
.github/patches/OpenCL-CTS-0001-Patch-sub-group-testing.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
98 changes: 98 additions & 0 deletions
98
.github/patches/OpenCL-CTS-0002-Permit-building-for-unknown-architectures.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters