mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 08:19:02 +00:00
Migrate allocations suite to the new test registration framework (#2191)
Contributes to #2181
This commit is contained in:
@@ -272,48 +272,28 @@ int doTest(cl_device_id device, cl_context context, cl_command_queue queue,
|
|||||||
return failure_counts;
|
return failure_counts;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_buffer(cl_device_id device, cl_context context, cl_command_queue queue,
|
REGISTER_TEST(buffer) { return doTest(device, context, queue, BUFFER); }
|
||||||
int num_elements)
|
REGISTER_TEST(image2d_read)
|
||||||
{
|
|
||||||
return doTest(device, context, queue, BUFFER);
|
|
||||||
}
|
|
||||||
int test_image2d_read(cl_device_id device, cl_context context,
|
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
return doTest(device, context, queue, IMAGE_READ);
|
return doTest(device, context, queue, IMAGE_READ);
|
||||||
}
|
}
|
||||||
int test_image2d_write(cl_device_id device, cl_context context,
|
REGISTER_TEST(image2d_write)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
return doTest(device, context, queue, IMAGE_WRITE);
|
return doTest(device, context, queue, IMAGE_WRITE);
|
||||||
}
|
}
|
||||||
int test_buffer_non_blocking(cl_device_id device, cl_context context,
|
REGISTER_TEST(buffer_non_blocking)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
return doTest(device, context, queue, BUFFER_NON_BLOCKING);
|
return doTest(device, context, queue, BUFFER_NON_BLOCKING);
|
||||||
}
|
}
|
||||||
int test_image2d_read_non_blocking(cl_device_id device, cl_context context,
|
REGISTER_TEST(image2d_read_non_blocking)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
return doTest(device, context, queue, IMAGE_READ_NON_BLOCKING);
|
return doTest(device, context, queue, IMAGE_READ_NON_BLOCKING);
|
||||||
}
|
}
|
||||||
int test_image2d_write_non_blocking(cl_device_id device, cl_context context,
|
REGISTER_TEST(image2d_write_non_blocking)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
return doTest(device, context, queue, IMAGE_WRITE_NON_BLOCKING);
|
return doTest(device, context, queue, IMAGE_WRITE_NON_BLOCKING);
|
||||||
}
|
}
|
||||||
|
|
||||||
test_definition test_list[] = {
|
|
||||||
ADD_TEST(buffer),
|
|
||||||
ADD_TEST(image2d_read),
|
|
||||||
ADD_TEST(image2d_write),
|
|
||||||
ADD_TEST(buffer_non_blocking),
|
|
||||||
ADD_TEST(image2d_read_non_blocking),
|
|
||||||
ADD_TEST(image2d_write_non_blocking),
|
|
||||||
};
|
|
||||||
|
|
||||||
const int test_num = ARRAY_SIZE(test_list);
|
|
||||||
|
|
||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
char *endPtr;
|
char *endPtr;
|
||||||
@@ -382,8 +362,9 @@ int main(int argc, const char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = runTestHarnessWithCheck(argCount, argList, test_num, test_list,
|
int ret = runTestHarnessWithCheck(
|
||||||
false, 0, init_cl);
|
argCount, argList, test_registry::getInstance().num_tests(),
|
||||||
|
test_registry::getInstance().definitions(), false, 0, init_cl);
|
||||||
|
|
||||||
free(argList);
|
free(argList);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -416,8 +397,8 @@ void printUsage(const char *execName)
|
|||||||
"of the memory objects.\n");
|
"of the memory objects.\n");
|
||||||
log_info("\n");
|
log_info("\n");
|
||||||
log_info("Test names (Allocation Types):\n");
|
log_info("Test names (Allocation Types):\n");
|
||||||
for (int i = 0; i < test_num; i++)
|
for (int i = 0; i < test_registry::getInstance().num_tests(); i++)
|
||||||
{
|
{
|
||||||
log_info("\t%s\n", test_list[i].name);
|
log_info("\t%s\n", test_registry::getInstance().definitions()[i].name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user