diff --git a/test_common/harness/testHarness.cpp b/test_common/harness/testHarness.cpp index 6b8fc1f7cf..df54a35d71 100644 --- a/test_common/harness/testHarness.cpp +++ b/test_common/harness/testHarness.cpp @@ -62,6 +62,27 @@ bool gCoreILProgram = true; #define DEFAULT_NUM_ELEMENTS 0x4000 +test_definition *test_registry::definitions() { return &m_definitions[0]; } + +size_t test_registry::num_tests() { return m_definitions.size(); } + +void test_registry::add_test(test *t, const char *name, Version version) +{ + + m_tests.push_back(t); + test_definition testDef; + testDef.func = t->getFunction(); + testDef.name = name; + testDef.min_version = version; + m_definitions.push_back(testDef); +} + +test_registry &test_registry::getInstance() +{ + static test_registry instance; + return instance; +} + static int saveResultsToJson(const char *suiteName, test_definition testList[], unsigned char selectedTestList[], test_status resultTestList[], int testNum) diff --git a/test_common/harness/testHarness.h b/test_common/harness/testHarness.h index 32703b3038..957c6a92fc 100644 --- a/test_common/harness/testHarness.h +++ b/test_common/harness/testHarness.h @@ -21,6 +21,7 @@ #include #include +#include class Version { public: @@ -99,6 +100,53 @@ struct test_harness_config unsigned numWorkerThreads; }; + +struct test +{ + virtual test_function_pointer getFunction() = 0; +}; + +class test_registry { +private: + std::vector m_tests; + std::vector m_definitions; + +public: + static test_registry &getInstance(); + + test_definition *definitions(); + + size_t num_tests(); + + void add_test(test *t, const char *name, Version version); + test_registry() {} +}; + +template T *register_test(const char *name, Version version) +{ + T *t = new T(); + test_registry::getInstance().add_test((test *)t, name, version); + return t; +} + +#define REGISTER_TEST_VERSION(name, version) \ + extern int test_##name(cl_device_id deviceID, cl_context context, \ + cl_command_queue queue, int num_elements); \ + class test_##name##_class : public test { \ + private: \ + test_function_pointer fn; \ + \ + public: \ + test_##name##_class(): fn(test_##name) {} \ + test_function_pointer getFunction() { return fn; } \ + }; \ + test_##name##_class *var_##name = \ + register_test(#name, version); \ + int test_##name(cl_device_id deviceID, cl_context context, \ + cl_command_queue queue, int num_elements) + +#define REGISTER_TEST(name) REGISTER_TEST_VERSION(name, Version(1, 2)) + extern int gFailCount; extern int gTestCount; extern cl_uint gReSeed; diff --git a/test_conformance/device_timer/main.cpp b/test_conformance/device_timer/main.cpp index 1c460af89f..adcb6ffc8e 100644 --- a/test_conformance/device_timer/main.cpp +++ b/test_conformance/device_timer/main.cpp @@ -23,13 +23,6 @@ #include #endif -#include "procs.h" - -test_definition test_list[] = { - ADD_TEST( timer_resolution_queries ), - ADD_TEST( device_and_host_timers ), -}; - test_status InitCL(cl_device_id device) { auto version = get_device_cl_version(device); @@ -70,11 +63,10 @@ test_status InitCL(cl_device_id device) return TEST_PASS; } - -const int test_num = ARRAY_SIZE( test_list ); - int main(int argc, const char *argv[]) { - return runTestHarnessWithCheck( argc, argv, test_num, test_list, false, 0, InitCL ); + return runTestHarnessWithCheck( + argc, argv, test_registry::getInstance().num_tests(), + test_registry::getInstance().definitions(), false, 0, InitCL); } diff --git a/test_conformance/device_timer/procs.h b/test_conformance/device_timer/procs.h deleted file mode 100644 index 8157ec7f59..0000000000 --- a/test_conformance/device_timer/procs.h +++ /dev/null @@ -1,24 +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. -// -#ifndef __PROCS_H__ -#define __PROCS_H__ - -extern int test_device_and_host_timers(cl_device_id deviceID, cl_context context, - cl_command_queue queue, int num_elements); - -extern int test_timer_resolution_queries(cl_device_id deviceID, cl_context context, - cl_command_queue queue, int num_elements); -#endif // #ifndef __PROCS_H__ diff --git a/test_conformance/device_timer/test_device_timer.cpp b/test_conformance/device_timer/test_device_timer.cpp index c5943fadc6..88bd9a3caa 100644 --- a/test_conformance/device_timer/test_device_timer.cpp +++ b/test_conformance/device_timer/test_device_timer.cpp @@ -17,6 +17,7 @@ #include #include "harness/errorHelpers.h" #include "harness/compat.h" +#include "harness/testHarness.h" #if !defined(_WIN32) #include "unistd.h" // For "sleep" @@ -24,7 +25,7 @@ #define ALLOWED_ERROR 0.005f -int test_device_and_host_timers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(device_and_host_timers) { int errors = 0; cl_int result = CL_SUCCESS; @@ -124,7 +125,7 @@ int test_device_and_host_timers(cl_device_id deviceID, cl_context context, cl_co return errors; } -int test_timer_resolution_queries(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) +REGISTER_TEST(timer_resolution_queries) { int errors = 0; cl_int result = CL_SUCCESS; diff --git a/test_conformance/spirv_new/main.cpp b/test_conformance/spirv_new/main.cpp index 2df19dd591..e3640b1253 100644 --- a/test_conformance/spirv_new/main.cpp +++ b/test_conformance/spirv_new/main.cpp @@ -69,34 +69,6 @@ std::vector readSPIRV(const char *file_name) return readBinary(full_name_str.c_str()); } -test_definition *spirvTestsRegistry::getTestDefinitions() -{ - return &testDefinitions[0]; -} - -size_t spirvTestsRegistry::getNumTests() -{ - return testDefinitions.size(); -} - -void spirvTestsRegistry::addTestClass(baseTestClass *test, const char *testName, - Version version) -{ - - testClasses.push_back(test); - test_definition testDef; - testDef.func = test->getFunction(); - testDef.name = testName; - testDef.min_version = version; - testDefinitions.push_back(testDef); -} - -spirvTestsRegistry& spirvTestsRegistry::getInstance() -{ - static spirvTestsRegistry instance; - return instance; -} - static int offline_get_program_with_il(clProgramWrapper &prog, const cl_device_id deviceID, const cl_context context, @@ -270,7 +242,6 @@ int main(int argc, const char *argv[]) } return runTestHarnessWithCheck( - argc, argv, spirvTestsRegistry::getInstance().getNumTests(), - spirvTestsRegistry::getInstance().getTestDefinitions(), false, 0, - InitCL); + argc, argv, test_registry::getInstance().num_tests(), + test_registry::getInstance().definitions(), false, 0, InitCL); } diff --git a/test_conformance/spirv_new/procs.h b/test_conformance/spirv_new/procs.h index a80d4edc85..3211da08ff 100644 --- a/test_conformance/spirv_new/procs.h +++ b/test_conformance/spirv_new/procs.h @@ -36,56 +36,6 @@ return -1; \ } while (0) - -class baseTestClass { -public: - baseTestClass() {} - virtual test_function_pointer getFunction() = 0; -}; - -class spirvTestsRegistry { -private: - std::vector testClasses; - std::vector testDefinitions; - -public: - static spirvTestsRegistry &getInstance(); - - test_definition *getTestDefinitions(); - - size_t getNumTests(); - - void addTestClass(baseTestClass *test, const char *testName, - Version version); - spirvTestsRegistry() {} -}; - -template T *createAndRegister(const char *name, Version version) -{ - T *testClass = new T(); - spirvTestsRegistry::getInstance().addTestClass((baseTestClass *)testClass, - name, version); - return testClass; -} - -#define TEST_SPIRV_FUNC_VERSION(name, version) \ - extern int test_##name(cl_device_id deviceID, cl_context context, \ - cl_command_queue queue, int num_elements); \ - class test_##name##_class : public baseTestClass { \ - private: \ - test_function_pointer fn; \ - \ - public: \ - test_##name##_class(): fn(test_##name) {} \ - test_function_pointer getFunction() { return fn; } \ - }; \ - test_##name##_class *var_##name = \ - createAndRegister(#name, version); \ - int test_##name(cl_device_id deviceID, cl_context context, \ - cl_command_queue queue, int num_elements) - -#define TEST_SPIRV_FUNC(name) TEST_SPIRV_FUNC_VERSION(name, Version(1, 2)) - struct spec_const { spec_const(cl_int id = 0, size_t sizet = 0, const void *value = NULL) diff --git a/test_conformance/spirv_new/test_basic_versions.cpp b/test_conformance/spirv_new/test_basic_versions.cpp index afe173906a..011234c541 100644 --- a/test_conformance/spirv_new/test_basic_versions.cpp +++ b/test_conformance/spirv_new/test_basic_versions.cpp @@ -23,7 +23,7 @@ extern bool gVersionSkip; -TEST_SPIRV_FUNC(basic_versions) +REGISTER_TEST(basic_versions) { cl_int error = CL_SUCCESS; diff --git a/test_conformance/spirv_new/test_cl_khr_expect_assume.cpp b/test_conformance/spirv_new/test_cl_khr_expect_assume.cpp index 62a3c2baca..74a425c4ce 100644 --- a/test_conformance/spirv_new/test_cl_khr_expect_assume.cpp +++ b/test_conformance/spirv_new/test_cl_khr_expect_assume.cpp @@ -117,7 +117,7 @@ static int test_expect_type(cl_device_id device, cl_context context, return TEST_PASS; } -TEST_SPIRV_FUNC(op_expect) +REGISTER_TEST(op_expect) { if (!is_extension_available(deviceID, "cl_khr_expect_assume")) { @@ -139,7 +139,7 @@ TEST_SPIRV_FUNC(op_expect) return result; } -TEST_SPIRV_FUNC(op_assume) +REGISTER_TEST(op_assume) { if (!is_extension_available(deviceID, "cl_khr_expect_assume")) { diff --git a/test_conformance/spirv_new/test_decorate.cpp b/test_conformance/spirv_new/test_decorate.cpp index b85419300d..8c76aa225a 100644 --- a/test_conformance/spirv_new/test_decorate.cpp +++ b/test_conformance/spirv_new/test_decorate.cpp @@ -110,29 +110,29 @@ int test_decorate_full(cl_device_id deviceID, return verify_results(deviceID, context, queue, name, prog); } -TEST_SPIRV_FUNC(decorate_restrict) +REGISTER_TEST(decorate_restrict) { return test_decorate_full(deviceID, context, queue, "decorate_restrict"); } -TEST_SPIRV_FUNC(decorate_aliased) +REGISTER_TEST(decorate_aliased) { return test_decorate_full(deviceID, context, queue, "decorate_aliased"); } -TEST_SPIRV_FUNC(decorate_alignment) +REGISTER_TEST(decorate_alignment) { //TODO: Check for results ? How to ensure buffers are aligned clProgramWrapper prog; return get_program_with_il(prog, deviceID, context, "decorate_alignment"); } -TEST_SPIRV_FUNC(decorate_constant) +REGISTER_TEST(decorate_constant) { return test_decorate_full(deviceID, context, queue, "decorate_constant"); } -TEST_SPIRV_FUNC(decorate_cpacked) +REGISTER_TEST(decorate_cpacked) { PACKED(struct packed_struct_t { cl_int ival; @@ -382,7 +382,7 @@ int test_saturate_full(cl_device_id deviceID, } #define TEST_SATURATED_CONVERSION(Ti, Tl, To) \ - TEST_SPIRV_FUNC(decorate_saturated_conversion_##Ti##_to_##To) \ + REGISTER_TEST(decorate_saturated_conversion_##Ti##_to_##To) \ { \ typedef cl_##Ti cl_Ti; \ typedef cl_##Tl cl_Tl; \ @@ -532,7 +532,7 @@ static inline Ti generate_fprounding_input(RandomSeed &seed) } #define TEST_SPIRV_FP_ROUNDING_DECORATE(name, func, Ti, To) \ - TEST_SPIRV_FUNC(decorate_fp_rounding_mode_##name##_##Ti##_##To) \ + REGISTER_TEST(decorate_fp_rounding_mode_##name##_##Ti##_##To) \ { \ typedef cl_##Ti clTi; \ typedef cl_##To clTo; \ diff --git a/test_conformance/spirv_new/test_get_program_il.cpp b/test_conformance/spirv_new/test_get_program_il.cpp index 8525b37e1d..7c0d39dfea 100644 --- a/test_conformance/spirv_new/test_get_program_il.cpp +++ b/test_conformance/spirv_new/test_get_program_il.cpp @@ -26,7 +26,7 @@ const char *sample_kernel_code_single_line[] = { "}\n" }; -TEST_SPIRV_FUNC(get_program_il) +REGISTER_TEST(get_program_il) { clProgramWrapper source_program; size_t il_size = -1; diff --git a/test_conformance/spirv_new/test_linkage.cpp b/test_conformance/spirv_new/test_linkage.cpp index ea17040ad2..6e991bd701 100644 --- a/test_conformance/spirv_new/test_linkage.cpp +++ b/test_conformance/spirv_new/test_linkage.cpp @@ -77,19 +77,19 @@ static int test_linkage_compile(cl_device_id deviceID, return 0; } -TEST_SPIRV_FUNC(linkage_export_function_compile) +REGISTER_TEST(linkage_export_function_compile) { clProgramWrapper prog; return test_linkage_compile(deviceID, context, queue, "linkage_export", prog); } -TEST_SPIRV_FUNC(linkage_import_function_compile) +REGISTER_TEST(linkage_import_function_compile) { clProgramWrapper prog; return test_linkage_compile(deviceID, context, queue, "linkage_import", prog); } -TEST_SPIRV_FUNC(linkage_import_function_link) +REGISTER_TEST(linkage_import_function_link) { int err = 0; @@ -212,7 +212,7 @@ static int test_linkonce_odr_helper(cl_device_id deviceID, cl_context context, return TEST_PASS; } -TEST_SPIRV_FUNC(linkage_linkonce_odr) +REGISTER_TEST(linkage_linkonce_odr) { if (!is_extension_available(deviceID, "cl_khr_spirv_linkonce_odr")) { diff --git a/test_conformance/spirv_new/test_no_integer_wrap_decoration.cpp b/test_conformance/spirv_new/test_no_integer_wrap_decoration.cpp index 042f0757d5..15088f5189 100644 --- a/test_conformance/spirv_new/test_no_integer_wrap_decoration.cpp +++ b/test_conformance/spirv_new/test_no_integer_wrap_decoration.cpp @@ -226,8 +226,7 @@ int test_no_integer_wrap_decoration(cl_device_id deviceID, cl_context context, } #define TEST_FMATH_FUNC_KHR(TYPE, FUNC) \ - TEST_SPIRV_FUNC( \ - ext_cl_khr_spirv_no_integer_wrap_decoration_##FUNC##_##TYPE) \ + REGISTER_TEST(ext_cl_khr_spirv_no_integer_wrap_decoration_##FUNC##_##TYPE) \ { \ if (!is_extension_available( \ deviceID, "cl_khr_spirv_no_integer_wrap_decoration")) \ @@ -253,7 +252,7 @@ TEST_FMATH_FUNC_KHR(uint, fmul) TEST_FMATH_FUNC_KHR(uint, fshiftleft) #define TEST_FMATH_FUNC_14(TYPE, FUNC) \ - TEST_SPIRV_FUNC(spirv14_no_integer_wrap_decoration_##FUNC##_##TYPE) \ + REGISTER_TEST(spirv14_no_integer_wrap_decoration_##FUNC##_##TYPE) \ { \ if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) \ { \ diff --git a/test_conformance/spirv_new/test_op_atomic.cpp b/test_conformance/spirv_new/test_op_atomic.cpp index 0ee2cfb0b1..dca310d7b1 100644 --- a/test_conformance/spirv_new/test_op_atomic.cpp +++ b/test_conformance/spirv_new/test_op_atomic.cpp @@ -87,14 +87,14 @@ int test_atomic(cl_device_id deviceID, cl_context context, return 0; } -TEST_SPIRV_FUNC(op_atomic_inc_global) +REGISTER_TEST(op_atomic_inc_global) { int num = 1 << 16; return test_atomic(deviceID, context, queue, "atomic_inc_global", num, true); } -TEST_SPIRV_FUNC(op_atomic_dec_global) +REGISTER_TEST(op_atomic_dec_global) { int num = 1 << 16; return test_atomic(deviceID, context, queue, diff --git a/test_conformance/spirv_new/test_op_branch.cpp b/test_conformance/spirv_new/test_op_branch.cpp index f87de6c60a..6ffeb5ed8f 100644 --- a/test_conformance/spirv_new/test_op_branch.cpp +++ b/test_conformance/spirv_new/test_op_branch.cpp @@ -65,19 +65,19 @@ int test_branch_simple(cl_device_id deviceID, cl_context context, return 0; } -#define TEST_BRANCH_SIMPLE(NAME) \ - TEST_SPIRV_FUNC(op_##NAME##_simple) \ - { \ - RandomSeed seed(gRandomSeed); \ - int num = 1 << 10; \ - std::vector results(num); \ - for (int i = 0; i < num; i++) { \ - results[i] = genrand(seed); \ - } \ - return test_branch_simple(deviceID, context, queue, \ - #NAME "_simple", \ - results); \ - } \ +#define TEST_BRANCH_SIMPLE(NAME) \ + REGISTER_TEST(op_##NAME##_simple) \ + { \ + RandomSeed seed(gRandomSeed); \ + int num = 1 << 10; \ + std::vector results(num); \ + for (int i = 0; i < num; i++) \ + { \ + results[i] = genrand(seed); \ + } \ + return test_branch_simple(deviceID, context, queue, #NAME "_simple", \ + results); \ + } TEST_BRANCH_SIMPLE(label) diff --git a/test_conformance/spirv_new/test_op_branch_conditional.cpp b/test_conformance/spirv_new/test_op_branch_conditional.cpp index 9c2d920e96..d7705e8b64 100644 --- a/test_conformance/spirv_new/test_op_branch_conditional.cpp +++ b/test_conformance/spirv_new/test_op_branch_conditional.cpp @@ -84,7 +84,7 @@ int test_branch_conditional(cl_device_id deviceID, } #define TEST_BRANCH_CONDITIONAL(name) \ - TEST_SPIRV_FUNC(op_##name) \ + REGISTER_TEST(op_##name) \ { \ const int num = 1 << 10; \ RandomSeed seed(gRandomSeed); \ diff --git a/test_conformance/spirv_new/test_op_composite_construct.cpp b/test_conformance/spirv_new/test_op_composite_construct.cpp index db4a66bf21..3d8d450fd8 100644 --- a/test_conformance/spirv_new/test_op_composite_construct.cpp +++ b/test_conformance/spirv_new/test_op_composite_construct.cpp @@ -56,14 +56,14 @@ int test_composite_construct(cl_device_id deviceID, cl_context context, return 0; } -TEST_SPIRV_FUNC(op_composite_construct_int4) +REGISTER_TEST(op_composite_construct_int4) { cl_int4 value = { { 123, 122, 121, 119 } }; std::vector results(256, value); return test_composite_construct(deviceID, context, queue, "composite_construct_int4", results); } -TEST_SPIRV_FUNC(op_composite_construct_struct) +REGISTER_TEST(op_composite_construct_struct) { typedef AbstractStruct2 CustomType1; typedef AbstractStruct2 CustomType2; diff --git a/test_conformance/spirv_new/test_op_constant.cpp b/test_conformance/spirv_new/test_op_constant.cpp index c3b7c58fbb..abbee1ebb6 100644 --- a/test_conformance/spirv_new/test_op_constant.cpp +++ b/test_conformance/spirv_new/test_op_constant.cpp @@ -64,14 +64,13 @@ int test_constant(cl_device_id deviceID, cl_context context, return 0; } -#define TEST_CONSTANT(NAME, type, value) \ - TEST_SPIRV_FUNC(op_constant_##NAME##_simple) \ - { \ - std::vector results(1024, (type)value); \ - return test_constant(deviceID, context, queue, \ - "constant_" #NAME "_simple", \ - results); \ - } \ +#define TEST_CONSTANT(NAME, type, value) \ + REGISTER_TEST(op_constant_##NAME##_simple) \ + { \ + std::vector results(1024, (type)value); \ + return test_constant(deviceID, context, queue, \ + "constant_" #NAME "_simple", results); \ + } // Boolean tests TEST_CONSTANT(true , cl_int , 1 ) @@ -98,14 +97,14 @@ TEST_CONSTANT(short , cl_short , 32000 ) TEST_CONSTANT(float , cl_float , 3.1415927 ) TEST_CONSTANT(double , cl_double , 3.141592653589793) -TEST_SPIRV_FUNC(op_constant_int4_simple) +REGISTER_TEST(op_constant_int4_simple) { cl_int4 value = { { 123, 122, 121, 119 } }; std::vector results(256, value); return test_constant(deviceID, context, queue, "constant_int4_simple", results); } -TEST_SPIRV_FUNC(op_constant_int3_simple) +REGISTER_TEST(op_constant_int3_simple) { cl_int3 value = { { 123, 122, 121, 0 } }; std::vector results(256, value); @@ -113,21 +112,21 @@ TEST_SPIRV_FUNC(op_constant_int3_simple) results, isVectorNotEqual); } -TEST_SPIRV_FUNC(op_constant_struct_int_float_simple) +REGISTER_TEST(op_constant_struct_int_float_simple) { AbstractStruct2 value = {1024, 3.1415}; std::vector > results(256, value); return test_constant(deviceID, context, queue, "constant_struct_int_float_simple", results); } -TEST_SPIRV_FUNC(op_constant_struct_int_char_simple) +REGISTER_TEST(op_constant_struct_int_char_simple) { AbstractStruct2 value = { 2100483600, (char)128 }; std::vector > results(256, value); return test_constant(deviceID, context, queue, "constant_struct_int_char_simple", results); } -TEST_SPIRV_FUNC(op_constant_struct_struct_simple) +REGISTER_TEST(op_constant_struct_struct_simple) { typedef AbstractStruct2 CustomType1; typedef AbstractStruct2 CustomType2; @@ -140,7 +139,7 @@ TEST_SPIRV_FUNC(op_constant_struct_struct_simple) return test_constant(deviceID, context, queue, "constant_struct_struct_simple", results); } -TEST_SPIRV_FUNC(op_constant_half_simple) +REGISTER_TEST(op_constant_half_simple) { PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); std::vector results(1024, 3.25); diff --git a/test_conformance/spirv_new/test_op_copy_object.cpp b/test_conformance/spirv_new/test_op_copy_object.cpp index 019b603323..fa76581cd9 100644 --- a/test_conformance/spirv_new/test_op_copy_object.cpp +++ b/test_conformance/spirv_new/test_op_copy_object.cpp @@ -64,14 +64,13 @@ int test_copy(cl_device_id deviceID, cl_context context, return 0; } -#define TEST_COPY(NAME, type, value) \ - TEST_SPIRV_FUNC(op_copy_##NAME##_simple) \ - { \ - std::vector results(1024, (type)value); \ - return test_copy(deviceID, context, queue, \ - "copy_" #NAME "_simple", \ - results); \ - } \ +#define TEST_COPY(NAME, type, value) \ + REGISTER_TEST(op_copy_##NAME##_simple) \ + { \ + std::vector results(1024, (type)value); \ + return test_copy(deviceID, context, queue, "copy_" #NAME "_simple", \ + results); \ + } // Integer tests TEST_COPY(int , cl_int , 123 ) @@ -94,14 +93,14 @@ TEST_COPY(short , cl_short , 32000 ) TEST_COPY(float , cl_float , 3.1415927 ) TEST_COPY(double , cl_double , 3.141592653589793) -TEST_SPIRV_FUNC(op_copy_int4_simple) +REGISTER_TEST(op_copy_int4_simple) { cl_int4 value = { { 123, 122, 121, 119 } }; std::vector results(256, value); return test_copy(deviceID, context, queue, "copy_int4_simple", results); } -TEST_SPIRV_FUNC(op_copy_int3_simple) +REGISTER_TEST(op_copy_int3_simple) { cl_int3 value = { { 123, 122, 121, 0 } }; std::vector results(256, value); @@ -109,21 +108,21 @@ TEST_SPIRV_FUNC(op_copy_int3_simple) results, isVectorNotEqual); } -TEST_SPIRV_FUNC(op_copy_struct_int_float_simple) +REGISTER_TEST(op_copy_struct_int_float_simple) { AbstractStruct2 value = {1024, 3.1415}; std::vector > results(256, value); return test_copy(deviceID, context, queue, "copy_struct_int_float_simple", results); } -TEST_SPIRV_FUNC(op_copy_struct_int_char_simple) +REGISTER_TEST(op_copy_struct_int_char_simple) { AbstractStruct2 value = { 2100483600, (char)128 }; std::vector > results(256, value); return test_copy(deviceID, context, queue, "copy_struct_int_char_simple", results); } -TEST_SPIRV_FUNC(op_copy_struct_struct_simple) +REGISTER_TEST(op_copy_struct_struct_simple) { typedef AbstractStruct2 CustomType1; typedef AbstractStruct2 CustomType2; @@ -136,7 +135,7 @@ TEST_SPIRV_FUNC(op_copy_struct_struct_simple) return test_copy(deviceID, context, queue, "copy_struct_struct_simple", results); } -TEST_SPIRV_FUNC(op_copy_half_simple) +REGISTER_TEST(op_copy_half_simple) { PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); std::vector results(1024, 3.25); diff --git a/test_conformance/spirv_new/test_op_fmath.cpp b/test_conformance/spirv_new/test_op_fmath.cpp index de887bfee2..3dfe901497 100644 --- a/test_conformance/spirv_new/test_op_fmath.cpp +++ b/test_conformance/spirv_new/test_op_fmath.cpp @@ -150,30 +150,28 @@ int test_fmath(cl_device_id deviceID, return 0; } -#define TEST_FMATH_FUNC(TYPE, FUNC, MODE) \ - TEST_SPIRV_FUNC(op_##FUNC##_##TYPE##_##MODE) \ - { \ - if (sizeof(cl_##TYPE) == 2) { \ - PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ - } \ - const int num = 1 << 20; \ - std::vector lhs(num); \ - std::vector rhs(num); \ - \ - RandomSeed seed(gRandomSeed); \ - \ - for (int i = 0; i < num; i++) { \ - lhs[i] = genrandReal(seed); \ - rhs[i] = genrandReal(seed); \ - } \ - \ - const char *mode = #MODE; \ - return test_fmath(deviceID, context, queue, \ - #FUNC "_" #TYPE, \ - #FUNC, \ - #TYPE, \ - mode[0] == 'f', \ - lhs, rhs); \ +#define TEST_FMATH_FUNC(TYPE, FUNC, MODE) \ + REGISTER_TEST(op_##FUNC##_##TYPE##_##MODE) \ + { \ + if (sizeof(cl_##TYPE) == 2) \ + { \ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ + } \ + const int num = 1 << 20; \ + std::vector lhs(num); \ + std::vector rhs(num); \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) \ + { \ + lhs[i] = genrandReal(seed); \ + rhs[i] = genrandReal(seed); \ + } \ + \ + const char *mode = #MODE; \ + return test_fmath(deviceID, context, queue, #FUNC "_" #TYPE, #FUNC, \ + #TYPE, mode[0] == 'f', lhs, rhs); \ } #define TEST_FMATH_MODE(TYPE, MODE) \ diff --git a/test_conformance/spirv_new/test_op_function.cpp b/test_conformance/spirv_new/test_op_function.cpp index 4a0f4d2632..4f8c4442c9 100644 --- a/test_conformance/spirv_new/test_op_function.cpp +++ b/test_conformance/spirv_new/test_op_function.cpp @@ -67,21 +67,18 @@ int test_function(cl_device_id deviceID, } -#define TEST_FUNCTION(TYPE) \ - TEST_SPIRV_FUNC(function_##TYPE) \ - { \ - int num = 1 << 20; \ - std::vector in(num); \ - RandomSeed seed(gRandomSeed); \ - for (int i = 0; i < num; i++) { \ - in[i] = genrand(seed); \ - } \ - return test_function(deviceID, \ - context, \ - queue, \ - #TYPE, \ - in); \ - } \ +#define TEST_FUNCTION(TYPE) \ + REGISTER_TEST(function_##TYPE) \ + { \ + int num = 1 << 20; \ + std::vector in(num); \ + RandomSeed seed(gRandomSeed); \ + for (int i = 0; i < num; i++) \ + { \ + in[i] = genrand(seed); \ + } \ + return test_function(deviceID, context, queue, #TYPE, in); \ + } TEST_FUNCTION(none) TEST_FUNCTION(inline) diff --git a/test_conformance/spirv_new/test_op_lifetime.cpp b/test_conformance/spirv_new/test_op_lifetime.cpp index 86e7ce0661..f8b7dd5f40 100644 --- a/test_conformance/spirv_new/test_op_lifetime.cpp +++ b/test_conformance/spirv_new/test_op_lifetime.cpp @@ -83,25 +83,25 @@ int test_op_lifetime(cl_device_id deviceID, return 0; } -#define TEST_LIFETIME(name) \ - TEST_SPIRV_FUNC(op_##name) \ - { \ - const int num = 1 << 10; \ - RandomSeed seed(gRandomSeed); \ - \ - std::vector lhs(num); \ - std::vector rhs(num); \ - std::vector out(num); \ - \ - for (int i = 0; i < num; i++) { \ - lhs[i] = genrand(seed); \ - rhs[i] = genrand(seed); \ - out[i] = lhs[i] - rhs[i]; \ - } \ - \ - return test_op_lifetime(deviceID, context, queue, \ - #name, \ - lhs, rhs, out); \ - } \ +#define TEST_LIFETIME(name) \ + REGISTER_TEST(op_##name) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) \ + { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = lhs[i] - rhs[i]; \ + } \ + \ + return test_op_lifetime(deviceID, context, queue, #name, lhs, rhs, \ + out); \ + } TEST_LIFETIME(lifetime_simple) diff --git a/test_conformance/spirv_new/test_op_loop_merge.cpp b/test_conformance/spirv_new/test_op_loop_merge.cpp index 3cac328471..2e9f65b0ce 100644 --- a/test_conformance/spirv_new/test_op_loop_merge.cpp +++ b/test_conformance/spirv_new/test_op_loop_merge.cpp @@ -81,30 +81,32 @@ int test_selection_merge(cl_device_id deviceID, return 0; } -#define TEST_LOOP_BRANCH(control) \ - TEST_SPIRV_FUNC(op_loop_merge_branch_##control) \ - { \ - const int num = 1 << 10; \ - RandomSeed seed(gRandomSeed); \ - \ - int rep = 4; \ - std::vector in(rep * num); \ - std::vector out(num); \ - \ - for (int i = 0; i < num; i++) { \ - int res = 0; \ - for (int j = 0; j < rep; j++) { \ - cl_int val = genrand(seed) % 1024; \ - res += val; \ - in[j * num + i] = val; \ - } \ - out[i] = res; \ - } \ - \ - return test_selection_merge(deviceID, context, queue, \ - "loop_merge_branch_" #control, \ - in, out, rep); \ - } \ +#define TEST_LOOP_BRANCH(control) \ + REGISTER_TEST(op_loop_merge_branch_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + int rep = 4; \ + std::vector in(rep *num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) \ + { \ + int res = 0; \ + for (int j = 0; j < rep; j++) \ + { \ + cl_int val = genrand(seed) % 1024; \ + res += val; \ + in[j * num + i] = val; \ + } \ + out[i] = res; \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "loop_merge_branch_" #control, in, out, \ + rep); \ + } TEST_LOOP_BRANCH(none) TEST_LOOP_BRANCH(unroll) diff --git a/test_conformance/spirv_new/test_op_negate.cpp b/test_conformance/spirv_new/test_op_negate.cpp index 281b1f8ce7..7ff2b844be 100644 --- a/test_conformance/spirv_new/test_op_negate.cpp +++ b/test_conformance/spirv_new/test_op_negate.cpp @@ -86,7 +86,7 @@ int test_negation(cl_device_id deviceID, } #define TEST_NEGATION(TYPE, Tv, OP, FUNC) \ - TEST_SPIRV_FUNC(OP##_##TYPE) \ + REGISTER_TEST(OP##_##TYPE) \ { \ int num = 1 << 20; \ std::vector in(num); \ diff --git a/test_conformance/spirv_new/test_op_opaque.cpp b/test_conformance/spirv_new/test_op_opaque.cpp index 52b54a25b8..19e3c3db7b 100644 --- a/test_conformance/spirv_new/test_op_opaque.cpp +++ b/test_conformance/spirv_new/test_op_opaque.cpp @@ -17,7 +17,7 @@ #include "testBase.h" #include "types.hpp" -TEST_SPIRV_FUNC(op_type_opaque_simple) +REGISTER_TEST(op_type_opaque_simple) { const char *name = "opaque"; cl_int err = CL_SUCCESS; diff --git a/test_conformance/spirv_new/test_op_phi.cpp b/test_conformance/spirv_new/test_op_phi.cpp index 4dbe200424..3f5e86c4dc 100644 --- a/test_conformance/spirv_new/test_op_phi.cpp +++ b/test_conformance/spirv_new/test_op_phi.cpp @@ -83,7 +83,7 @@ int test_phi(cl_device_id deviceID, return 0; } -TEST_SPIRV_FUNC(op_phi_2_blocks) +REGISTER_TEST(op_phi_2_blocks) { const int num = 1 << 10; RandomSeed seed(gRandomSeed); @@ -101,7 +101,7 @@ TEST_SPIRV_FUNC(op_phi_2_blocks) return test_phi(deviceID, context, queue, "phi_2", lhs, rhs, out); } -TEST_SPIRV_FUNC(op_phi_3_blocks) +REGISTER_TEST(op_phi_3_blocks) { const int num = 1 << 10; RandomSeed seed(gRandomSeed); @@ -123,7 +123,7 @@ TEST_SPIRV_FUNC(op_phi_3_blocks) return test_phi(deviceID, context, queue, "phi_3", lhs, rhs, out); } -TEST_SPIRV_FUNC(op_phi_4_blocks) +REGISTER_TEST(op_phi_4_blocks) { const int num = 1 << 10; RandomSeed seed(gRandomSeed); diff --git a/test_conformance/spirv_new/test_op_selection_merge.cpp b/test_conformance/spirv_new/test_op_selection_merge.cpp index 3889528732..e719108575 100644 --- a/test_conformance/spirv_new/test_op_selection_merge.cpp +++ b/test_conformance/spirv_new/test_op_selection_merge.cpp @@ -84,7 +84,7 @@ int test_selection_merge(cl_device_id deviceID, } #define TEST_SELECT_IF(control) \ - TEST_SPIRV_FUNC(op_selection_merge_if_##control) \ + REGISTER_TEST(op_selection_merge_if_##control) \ { \ const int num = 1 << 10; \ RandomSeed seed(gRandomSeed); \ @@ -108,26 +108,26 @@ TEST_SELECT_IF(none) TEST_SELECT_IF(flatten) TEST_SELECT_IF(dont_flatten) -#define TEST_SELECT_SWITCH(control) \ - TEST_SPIRV_FUNC(op_selection_merge_swith_##control) \ - { \ - const int num = 1 << 10; \ - RandomSeed seed(gRandomSeed); \ - \ - std::vector lhs(num); \ - std::vector rhs(num); \ - std::vector out(num); \ - \ - for (int i = 0; i < num; i++) { \ - lhs[i] = genrand(seed); \ - rhs[i] = genrand(seed); \ - out[i] = (lhs[i] + rhs[i]) % 4; \ - } \ - \ - return test_selection_merge(deviceID, context, queue, \ - "select_switch_" #control, \ - lhs, rhs, out); \ - } \ +#define TEST_SELECT_SWITCH(control) \ + REGISTER_TEST(op_selection_merge_swith_##control) \ + { \ + const int num = 1 << 10; \ + RandomSeed seed(gRandomSeed); \ + \ + std::vector lhs(num); \ + std::vector rhs(num); \ + std::vector out(num); \ + \ + for (int i = 0; i < num; i++) \ + { \ + lhs[i] = genrand(seed); \ + rhs[i] = genrand(seed); \ + out[i] = (lhs[i] + rhs[i]) % 4; \ + } \ + \ + return test_selection_merge(deviceID, context, queue, \ + "select_switch_" #control, lhs, rhs, out); \ + } TEST_SELECT_SWITCH(none) TEST_SELECT_SWITCH(flatten) diff --git a/test_conformance/spirv_new/test_op_spec_constant.cpp b/test_conformance/spirv_new/test_op_spec_constant.cpp index 3b3b4d45db..3bf2e825ed 100644 --- a/test_conformance/spirv_new/test_op_spec_constant.cpp +++ b/test_conformance/spirv_new/test_op_spec_constant.cpp @@ -115,7 +115,7 @@ int test_spec_constant(cl_device_id deviceID, cl_context context, #define TEST_SPEC_CONSTANT(NAME, type, init_buffer, spec_constant_value) \ - TEST_SPIRV_FUNC_VERSION(op_spec_constant_##NAME##_simple, Version(2, 2)) \ + REGISTER_TEST_VERSION(op_spec_constant_##NAME##_simple, Version(2, 2)) \ { \ type init_value = init_buffer; \ type final_value = init_value + spec_constant_value; \ @@ -137,7 +137,7 @@ TEST_SPEC_CONSTANT(double, cl_double, 14534.53453, 1.53453) // documenation: 'If a specialization constant is a boolean // constant, spec_value should be a pointer to a cl_uchar value' -TEST_SPIRV_FUNC_VERSION(op_spec_constant_true_simple, Version(2, 2)) +REGISTER_TEST_VERSION(op_spec_constant_true_simple, Version(2, 2)) { // 1-st ndrange init_value is expected value (no change) // 2-nd ndrange sets spec const to 'false' so value = value + 1 @@ -149,7 +149,7 @@ TEST_SPIRV_FUNC_VERSION(op_spec_constant_true_simple, Version(2, 2)) init_value, 0, final_value); } -TEST_SPIRV_FUNC_VERSION(op_spec_constant_false_simple, Version(2, 2)) +REGISTER_TEST_VERSION(op_spec_constant_false_simple, Version(2, 2)) { // 1-st ndrange init_value is expected value (no change) // 2-nd ndrange sets spec const to 'true' so value = value + 1 diff --git a/test_conformance/spirv_new/test_op_undef.cpp b/test_conformance/spirv_new/test_op_undef.cpp index 43610f82b4..36cb66cc1d 100644 --- a/test_conformance/spirv_new/test_op_undef.cpp +++ b/test_conformance/spirv_new/test_op_undef.cpp @@ -57,12 +57,12 @@ int test_undef(cl_device_id deviceID, cl_context context, return 0; } -#define TEST_UNDEF(NAME, TYPE) \ - TEST_SPIRV_FUNC(op_undef_##NAME##_simple) \ - { \ - return test_undef(deviceID, context, queue, \ - "undef_" #NAME "_simple"); \ - } \ +#define TEST_UNDEF(NAME, TYPE) \ + REGISTER_TEST(op_undef_##NAME##_simple) \ + { \ + return test_undef(deviceID, context, queue, \ + "undef_" #NAME "_simple"); \ + } // Boolean tests TEST_UNDEF(true , cl_int ) @@ -92,26 +92,26 @@ TEST_UNDEF(int4 , cl_int4) TEST_UNDEF(int3 , cl_int3) -TEST_SPIRV_FUNC(op_undef_struct_int_float_simple) +REGISTER_TEST(op_undef_struct_int_float_simple) { typedef AbstractStruct2 CustomType; return test_undef(deviceID, context, queue, "undef_struct_int_float_simple"); } -TEST_SPIRV_FUNC(op_undef_struct_int_char_simple) +REGISTER_TEST(op_undef_struct_int_char_simple) { typedef AbstractStruct2 CustomType; return test_undef(deviceID, context, queue, "undef_struct_int_char_simple"); } -TEST_SPIRV_FUNC(op_undef_struct_struct_simple) +REGISTER_TEST(op_undef_struct_struct_simple) { typedef AbstractStruct2 CustomType1; typedef AbstractStruct2 CustomType2; return test_undef(deviceID, context, queue, "undef_struct_struct_simple"); } -TEST_SPIRV_FUNC(op_undef_half_simple) +REGISTER_TEST(op_undef_half_simple) { PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); return test_undef(deviceID, context, queue, diff --git a/test_conformance/spirv_new/test_op_vector_extract.cpp b/test_conformance/spirv_new/test_op_vector_extract.cpp index 62a155b407..9188a0a32d 100644 --- a/test_conformance/spirv_new/test_op_vector_extract.cpp +++ b/test_conformance/spirv_new/test_op_vector_extract.cpp @@ -91,7 +91,7 @@ int test_extract(cl_device_id deviceID, cl_context context, } #define TEST_VECTOR_EXTRACT(TYPE, N) \ - TEST_SPIRV_FUNC(op_vector_##TYPE##N##_extract) \ + REGISTER_TEST(op_vector_##TYPE##N##_extract) \ { \ if (sizeof(cl_##TYPE) == 2) \ { \ diff --git a/test_conformance/spirv_new/test_op_vector_insert.cpp b/test_conformance/spirv_new/test_op_vector_insert.cpp index ed47238557..32e883e3f5 100644 --- a/test_conformance/spirv_new/test_op_vector_insert.cpp +++ b/test_conformance/spirv_new/test_op_vector_insert.cpp @@ -109,7 +109,7 @@ int test_insert(cl_device_id deviceID, cl_context context, } #define TEST_VECTOR_INSERT(TYPE, N) \ - TEST_SPIRV_FUNC(op_vector_##TYPE##N##_insert) \ + REGISTER_TEST(op_vector_##TYPE##N##_insert) \ { \ if (sizeof(cl_##TYPE) == 2) \ { \ diff --git a/test_conformance/spirv_new/test_op_vector_times_scalar.cpp b/test_conformance/spirv_new/test_op_vector_times_scalar.cpp index da79d3bea3..de92438d94 100644 --- a/test_conformance/spirv_new/test_op_vector_times_scalar.cpp +++ b/test_conformance/spirv_new/test_op_vector_times_scalar.cpp @@ -161,29 +161,29 @@ int test_vector_times_scalar(cl_device_id deviceID, return 0; } -#define TEST_VECTOR_TIMES_SCALAR(TYPE, N) \ - TEST_SPIRV_FUNC(op_vector_times_scalar_##TYPE) \ - { \ - if (sizeof(cl_##TYPE) == 2) { \ - PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ - } \ - typedef cl_##TYPE##N Tv; \ - typedef cl_##TYPE Ts; \ - const int num = 1 << 20; \ - std::vector lhs(num); \ - std::vector rhs(num); \ - \ - RandomSeed seed(gRandomSeed); \ - \ - for (int i = 0; i < num; i++) { \ - lhs[i] = genrandReal(seed); \ - rhs[i] = genrandReal(seed); \ - } \ - \ - return test_vector_times_scalar(deviceID, \ - context, queue, \ - #TYPE, \ - lhs, rhs); \ +#define TEST_VECTOR_TIMES_SCALAR(TYPE, N) \ + REGISTER_TEST(op_vector_times_scalar_##TYPE) \ + { \ + if (sizeof(cl_##TYPE) == 2) \ + { \ + PASSIVE_REQUIRE_FP16_SUPPORT(deviceID); \ + } \ + typedef cl_##TYPE##N Tv; \ + typedef cl_##TYPE Ts; \ + const int num = 1 << 20; \ + std::vector lhs(num); \ + std::vector rhs(num); \ + \ + RandomSeed seed(gRandomSeed); \ + \ + for (int i = 0; i < num; i++) \ + { \ + lhs[i] = genrandReal(seed); \ + rhs[i] = genrandReal(seed); \ + } \ + \ + return test_vector_times_scalar(deviceID, context, queue, \ + #TYPE, lhs, rhs); \ } diff --git a/test_conformance/spirv_new/test_spirv_14.cpp b/test_conformance/spirv_new/test_spirv_14.cpp index 4bf0a1c83f..360250597c 100644 --- a/test_conformance/spirv_new/test_spirv_14.cpp +++ b/test_conformance/spirv_new/test_spirv_14.cpp @@ -90,7 +90,7 @@ static int test_image_operand_helper(cl_device_id deviceID, cl_context context, return TEST_PASS; } -TEST_SPIRV_FUNC(spirv14_image_operand_signextend) +REGISTER_TEST(spirv14_image_operand_signextend) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -100,7 +100,7 @@ TEST_SPIRV_FUNC(spirv14_image_operand_signextend) return test_image_operand_helper(deviceID, context, queue, true); } -TEST_SPIRV_FUNC(spirv14_image_operand_zeroextend) +REGISTER_TEST(spirv14_image_operand_zeroextend) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -155,7 +155,7 @@ static int test_loop_control_helper(cl_device_id deviceID, cl_context context, return TEST_PASS; } -TEST_SPIRV_FUNC(spirv14_loop_control_miniterations) +REGISTER_TEST(spirv14_loop_control_miniterations) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -166,7 +166,7 @@ TEST_SPIRV_FUNC(spirv14_loop_control_miniterations) "loop_control_miniterations"); } -TEST_SPIRV_FUNC(spirv14_loop_control_maxiterations) +REGISTER_TEST(spirv14_loop_control_maxiterations) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -177,7 +177,7 @@ TEST_SPIRV_FUNC(spirv14_loop_control_maxiterations) "loop_control_maxiterations"); } -TEST_SPIRV_FUNC(spirv14_loop_control_iterationmultiple) +REGISTER_TEST(spirv14_loop_control_iterationmultiple) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -188,7 +188,7 @@ TEST_SPIRV_FUNC(spirv14_loop_control_iterationmultiple) "loop_control_iterationmultiple"); } -TEST_SPIRV_FUNC(spirv14_loop_control_peelcount) +REGISTER_TEST(spirv14_loop_control_peelcount) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -199,7 +199,7 @@ TEST_SPIRV_FUNC(spirv14_loop_control_peelcount) "loop_control_peelcount"); } -TEST_SPIRV_FUNC(spirv14_loop_control_partialcount) +REGISTER_TEST(spirv14_loop_control_partialcount) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -210,7 +210,7 @@ TEST_SPIRV_FUNC(spirv14_loop_control_partialcount) "loop_control_partialcount"); } -TEST_SPIRV_FUNC(spirv14_ptrops) +REGISTER_TEST(spirv14_ptrops) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -331,7 +331,7 @@ static int test_usersemantic_decoration(cl_device_id deviceID, return TEST_PASS; } -TEST_SPIRV_FUNC(spirv14_usersemantic_decoratestring) +REGISTER_TEST(spirv14_usersemantic_decoratestring) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -342,7 +342,7 @@ TEST_SPIRV_FUNC(spirv14_usersemantic_decoratestring) return test_usersemantic_decoration(deviceID, context, queue, false); } -TEST_SPIRV_FUNC(spirv14_usersemantic_memberdecoratestring) +REGISTER_TEST(spirv14_usersemantic_memberdecoratestring) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -353,7 +353,7 @@ TEST_SPIRV_FUNC(spirv14_usersemantic_memberdecoratestring) return test_usersemantic_decoration(deviceID, context, queue, true); } -TEST_SPIRV_FUNC(spirv14_nonwriteable_decoration) +REGISTER_TEST(spirv14_nonwriteable_decoration) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -399,7 +399,7 @@ TEST_SPIRV_FUNC(spirv14_nonwriteable_decoration) return TEST_PASS; } -TEST_SPIRV_FUNC(spirv14_copymemory_memory_operands) +REGISTER_TEST(spirv14_copymemory_memory_operands) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { @@ -450,7 +450,7 @@ TEST_SPIRV_FUNC(spirv14_copymemory_memory_operands) return TEST_PASS; } -TEST_SPIRV_FUNC(spirv14_select_composite) +REGISTER_TEST(spirv14_select_composite) { constexpr size_t global_size = 16; @@ -512,7 +512,7 @@ TEST_SPIRV_FUNC(spirv14_select_composite) return TEST_PASS; } -TEST_SPIRV_FUNC(spirv14_copylogical) +REGISTER_TEST(spirv14_copylogical) { if (!is_spirv_version_supported(deviceID, "SPIR-V_1.4")) { diff --git a/test_conformance/subgroups/subhelpers.h b/test_conformance/subgroups/subhelpers.h index 8600088e8b..a081bd098c 100644 --- a/test_conformance/subgroups/subhelpers.h +++ b/test_conformance/subgroups/subhelpers.h @@ -1447,7 +1447,7 @@ template class KernelExecutor { }; // Driver for testing a single built in function -template struct test +template struct subgroup_test { static test_status run(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements, @@ -1688,9 +1688,9 @@ struct RunTestForType std::regex_replace(test_params_.get_kernel_source(function_name), std::regex("\\%s"), function_name); std::string kernel_name = "test_" + function_name; - error = - test::run(device_, context_, queue_, num_elements_, - kernel_name.c_str(), source.c_str(), test_params_); + error = subgroup_test::run(device_, context_, queue_, + num_elements_, kernel_name.c_str(), + source.c_str(), test_params_); // If we return TEST_SKIPPED_ITSELF here, then an entire suite may be // reported as having been skipped even if some tests within it diff --git a/test_conformance/subgroups/test_barrier.cpp b/test_conformance/subgroups/test_barrier.cpp index fb93ddb1ac..f97e2a33f7 100644 --- a/test_conformance/subgroups/test_barrier.cpp +++ b/test_conformance/subgroups/test_barrier.cpp @@ -164,9 +164,10 @@ int test_barrier_functions(cl_device_id device, cl_context context, constexpr size_t local_work_size = 200; WorkGroupParams test_params(global_work_size, local_work_size); test_params.use_core_subgroups = useCoreSubgroups; - error = test>::run(device, context, queue, num_elements, - "test_lbar", lbar_source, test_params); - error |= test, global_work_size>::run( + error = subgroup_test>::run(device, context, queue, + num_elements, "test_lbar", + lbar_source, test_params); + error |= subgroup_test, global_work_size>::run( device, context, queue, num_elements, "test_gbar", gbar_source, test_params); diff --git a/test_conformance/subgroups/test_ifp.cpp b/test_conformance/subgroups/test_ifp.cpp index f2bd5b9257..61c65673df 100644 --- a/test_conformance/subgroups/test_ifp.cpp +++ b/test_conformance/subgroups/test_ifp.cpp @@ -297,8 +297,9 @@ int test_ifp(cl_device_id device, cl_context context, cl_command_queue queue, WorkGroupParams test_params(global_work_size, local_work_size); test_params.use_core_subgroups = useCoreSubgroups; test_params.dynsc = NUM_LOC + 1; - error = test::run(device, context, queue, num_elements, - "test_ifp", ifp_source, test_params); + error = + subgroup_test::run(device, context, queue, num_elements, + "test_ifp", ifp_source, test_params); return error; }