From 13b82d18337eaf71d7972f3c4143581e19be0de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Petit?= Date: Tue, 11 Mar 2025 21:48:14 +0000 Subject: [PATCH] Migrate non_uniform_work_group suite to the new test registration framework (#2317) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributes to #2181 Signed-off-by: Kévin Petit --- .../TestNonUniformWorkGroup.h | 1 - .../non_uniform_work_group/main.cpp | 28 +++------------- .../non_uniform_work_group/procs.h | 32 ------------------- .../test_advanced_2d.cpp | 12 +++---- .../test_advanced_3d.cpp | 12 +++---- .../test_advanced_other.cpp | 12 +++---- .../non_uniform_work_group/test_basic.cpp | 12 +++---- .../non_uniform_work_group/tools.h | 4 ++- 8 files changed, 24 insertions(+), 89 deletions(-) delete mode 100644 test_conformance/non_uniform_work_group/procs.h diff --git a/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h b/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h index f5846061..0929bf0d 100644 --- a/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h +++ b/test_conformance/non_uniform_work_group/TestNonUniformWorkGroup.h @@ -16,7 +16,6 @@ #ifndef TESTNONUNIFORMWORKGROUP_H #define TESTNONUNIFORMWORKGROUP_H -#include "procs.h" #include #include "tools.h" #include diff --git a/test_conformance/non_uniform_work_group/main.cpp b/test_conformance/non_uniform_work_group/main.cpp index 64eff96a..6310e1ad 100644 --- a/test_conformance/non_uniform_work_group/main.cpp +++ b/test_conformance/non_uniform_work_group/main.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,31 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "procs.h" #include "tools.h" #include "harness/testHarness.h" #include "TestNonUniformWorkGroup.h" -test_definition test_list[] = { - ADD_TEST( non_uniform_1d_basic ), - ADD_TEST( non_uniform_1d_atomics ), - ADD_TEST( non_uniform_1d_barriers ), - - ADD_TEST( non_uniform_2d_basic ), - ADD_TEST( non_uniform_2d_atomics ), - ADD_TEST( non_uniform_2d_barriers ), - - ADD_TEST( non_uniform_3d_basic ), - ADD_TEST( non_uniform_3d_atomics ), - ADD_TEST( non_uniform_3d_barriers ), - - ADD_TEST( non_uniform_other_basic ), - ADD_TEST( non_uniform_other_atomics ), - ADD_TEST( non_uniform_other_barriers ), -}; - -const int test_num = ARRAY_SIZE( test_list ); - test_status InitCL(cl_device_id device) { auto version = get_device_cl_version(device); auto expected_min_version = Version(2, 0); @@ -69,6 +48,9 @@ int main(int argc, const char *argv[]) PrimeNumbers::generatePrimeNumbers(100000); - return runTestHarnessWithCheck(static_cast(programArgs.size()), &programArgs.front(), test_num, test_list, false, false, InitCL); + return runTestHarnessWithCheck( + static_cast(programArgs.size()), &programArgs.front(), + test_registry::getInstance().num_tests(), + test_registry::getInstance().definitions(), false, false, InitCL); } diff --git a/test_conformance/non_uniform_work_group/procs.h b/test_conformance/non_uniform_work_group/procs.h deleted file mode 100644 index cb49e87f..00000000 --- a/test_conformance/non_uniform_work_group/procs.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// Copyright (c) 2017 The Khronos Group Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "harness/typeWrappers.h" - -extern int test_non_uniform_1d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_1d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_1d_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_non_uniform_2d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_2d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_2d_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_non_uniform_3d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_3d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_3d_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); - -extern int test_non_uniform_other_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_other_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); -extern int test_non_uniform_other_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements); diff --git a/test_conformance/non_uniform_work_group/test_advanced_2d.cpp b/test_conformance/non_uniform_work_group/test_advanced_2d.cpp index 3ed1082d..9c0ed964 100644 --- a/test_conformance/non_uniform_work_group/test_advanced_2d.cpp +++ b/test_conformance/non_uniform_work_group/test_advanced_2d.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,13 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "procs.h" #include "tools.h" #include "TestNonUniformWorkGroup.h" -int - test_non_uniform_2d_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_2d_basic) { SubTestExecutor exec(device, context, queue); @@ -140,8 +138,7 @@ int return exec.status(); } -int - test_non_uniform_2d_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_2d_atomics) { SubTestExecutor exec(device, context, queue); @@ -262,8 +259,7 @@ int return exec.status(); } -int - test_non_uniform_2d_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_2d_barriers) { SubTestExecutor exec(device, context, queue); diff --git a/test_conformance/non_uniform_work_group/test_advanced_3d.cpp b/test_conformance/non_uniform_work_group/test_advanced_3d.cpp index 1e205525..a159c8d6 100644 --- a/test_conformance/non_uniform_work_group/test_advanced_3d.cpp +++ b/test_conformance/non_uniform_work_group/test_advanced_3d.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,13 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "procs.h" #include "tools.h" #include "TestNonUniformWorkGroup.h" -int - test_non_uniform_3d_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_3d_basic) { SubTestExecutor exec(device, context, queue); @@ -148,8 +146,7 @@ int return exec.status(); } -int - test_non_uniform_3d_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_3d_atomics) { SubTestExecutor exec(device, context, queue); @@ -278,8 +275,7 @@ int return exec.status(); } -int - test_non_uniform_3d_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_3d_barriers) { SubTestExecutor exec(device, context, queue); diff --git a/test_conformance/non_uniform_work_group/test_advanced_other.cpp b/test_conformance/non_uniform_work_group/test_advanced_other.cpp index 6aed795c..63df8c0c 100644 --- a/test_conformance/non_uniform_work_group/test_advanced_other.cpp +++ b/test_conformance/non_uniform_work_group/test_advanced_other.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,13 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "procs.h" #include "tools.h" #include "TestNonUniformWorkGroup.h" -int - test_non_uniform_other_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_other_basic) { SubTestExecutor exec(device, context, queue); @@ -105,8 +103,7 @@ int return exec.status(); } -int - test_non_uniform_other_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_other_atomics) { SubTestExecutor exec(device, context, queue); @@ -190,8 +187,7 @@ int return exec.status(); } -int - test_non_uniform_other_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_other_barriers) { SubTestExecutor exec(device, context, queue); diff --git a/test_conformance/non_uniform_work_group/test_basic.cpp b/test_conformance/non_uniform_work_group/test_basic.cpp index 2bf410bc..537d7eeb 100644 --- a/test_conformance/non_uniform_work_group/test_basic.cpp +++ b/test_conformance/non_uniform_work_group/test_basic.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -13,13 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include "procs.h" #include "tools.h" #include "TestNonUniformWorkGroup.h" -int - test_non_uniform_1d_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_1d_basic) { SubTestExecutor exec(device, context, queue); @@ -144,8 +142,7 @@ int return exec.status(); } -int - test_non_uniform_1d_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_1d_atomics) { SubTestExecutor exec(device, context, queue); @@ -270,8 +267,7 @@ int return exec.status(); } -int - test_non_uniform_1d_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(non_uniform_1d_barriers) { SubTestExecutor exec(device, context, queue); diff --git a/test_conformance/non_uniform_work_group/tools.h b/test_conformance/non_uniform_work_group/tools.h index ba01fc99..8e235c3a 100644 --- a/test_conformance/non_uniform_work_group/tools.h +++ b/test_conformance/non_uniform_work_group/tools.h @@ -16,7 +16,9 @@ #ifndef TOOLS_H #define TOOLS_H -#include "procs.h" +#include "harness/testHarness.h" +#include "harness/typeWrappers.h" + #include #include #include