[RFC] Move logic for test registration to the test harness (#2151)

And use in device_timer suite.

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2024-11-26 17:55:09 +00:00
committed by GitHub
parent df5e87bf97
commit 0a1456d8f9
36 changed files with 307 additions and 352 deletions

View File

@@ -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<TYPE>(deviceID, context, queue, \
"undef_" #NAME "_simple"); \
} \
#define TEST_UNDEF(NAME, TYPE) \
REGISTER_TEST(op_undef_##NAME##_simple) \
{ \
return test_undef<TYPE>(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<cl_int, cl_float> CustomType;
return test_undef<CustomType>(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<cl_int, cl_char> CustomType;
return test_undef<CustomType>(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<cl_int, cl_char> CustomType1;
typedef AbstractStruct2<cl_int2, CustomType1> CustomType2;
return test_undef<CustomType2>(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<cl_float>(deviceID, context, queue,