mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09: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:
@@ -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<cl_int> in(rep * num); \
|
||||
std::vector<cl_int> out(num); \
|
||||
\
|
||||
for (int i = 0; i < num; i++) { \
|
||||
int res = 0; \
|
||||
for (int j = 0; j < rep; j++) { \
|
||||
cl_int val = genrand<cl_int>(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<cl_int> in(rep *num); \
|
||||
std::vector<cl_int> out(num); \
|
||||
\
|
||||
for (int i = 0; i < num; i++) \
|
||||
{ \
|
||||
int res = 0; \
|
||||
for (int j = 0; j < rep; j++) \
|
||||
{ \
|
||||
cl_int val = genrand<cl_int>(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)
|
||||
|
||||
Reference in New Issue
Block a user