mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 07:39:01 +00:00
[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:
@@ -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<cl_##TYPE> lhs(num); \
|
||||
std::vector<cl_##TYPE> rhs(num); \
|
||||
\
|
||||
RandomSeed seed(gRandomSeed); \
|
||||
\
|
||||
for (int i = 0; i < num; i++) { \
|
||||
lhs[i] = genrandReal<cl_##TYPE>(seed); \
|
||||
rhs[i] = genrandReal<cl_##TYPE>(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<cl_##TYPE> lhs(num); \
|
||||
std::vector<cl_##TYPE> rhs(num); \
|
||||
\
|
||||
RandomSeed seed(gRandomSeed); \
|
||||
\
|
||||
for (int i = 0; i < num; i++) \
|
||||
{ \
|
||||
lhs[i] = genrandReal<cl_##TYPE>(seed); \
|
||||
rhs[i] = genrandReal<cl_##TYPE>(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) \
|
||||
|
||||
Reference in New Issue
Block a user