mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 14:39:01 +00:00
Migrate API suite to the new test registration framework (#2196)
Contributes to #2181 Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
@@ -25,8 +25,7 @@ __kernel void test(__global int* dst) {
|
||||
}
|
||||
)CLC";
|
||||
|
||||
int test_consistency_svm(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_svm, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_SVM_CAPABILITIES:
|
||||
// May return 0, indicating that device does not support Shared Virtual
|
||||
@@ -39,8 +38,8 @@ int test_consistency_svm(cl_device_id deviceID, cl_context context,
|
||||
clKernelWrapper kernel;
|
||||
|
||||
cl_device_svm_capabilities svmCaps = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_SVM_CAPABILITIES,
|
||||
sizeof(svmCaps), &svmCaps, NULL);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_SVM_CAPABILITIES, sizeof(svmCaps),
|
||||
&svmCaps, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_SVM_CAPABILITIES");
|
||||
|
||||
if (svmCaps == 0)
|
||||
@@ -202,13 +201,12 @@ static int check_atomic_capabilities(cl_device_atomic_capabilities atomicCaps,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_memory_model(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_memory_model, Version(3, 0))
|
||||
{
|
||||
cl_int error;
|
||||
cl_device_atomic_capabilities atomicCaps = 0;
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES,
|
||||
sizeof(atomicCaps), &atomicCaps, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES");
|
||||
|
||||
@@ -221,7 +219,7 @@ int test_consistency_memory_model(cl_device_id deviceID, cl_context context,
|
||||
return error;
|
||||
}
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_ATOMIC_FENCE_CAPABILITIES,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_ATOMIC_FENCE_CAPABILITIES,
|
||||
sizeof(atomicCaps), &atomicCaps, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_ATOMIC_FENCE_CAPABILITIES");
|
||||
|
||||
@@ -238,8 +236,7 @@ int test_consistency_memory_model(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_device_enqueue, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES
|
||||
// May return 0, indicating that device does not support Device-Side Enqueue
|
||||
@@ -247,7 +244,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
cl_int error;
|
||||
|
||||
cl_device_device_enqueue_capabilities dseCaps = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES,
|
||||
sizeof(dseCaps), &dseCaps, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES");
|
||||
|
||||
@@ -258,7 +255,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
// On-Device Queues.
|
||||
|
||||
cl_command_queue_properties devQueueProps = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES,
|
||||
sizeof(devQueueProps), &devQueueProps, NULL);
|
||||
test_error(error,
|
||||
"Unable to query CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES");
|
||||
@@ -278,7 +275,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
cl_uint u = 0;
|
||||
|
||||
error =
|
||||
clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE,
|
||||
clGetDeviceInfo(device, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE,
|
||||
sizeof(u), &u, NULL);
|
||||
test_error(error,
|
||||
"Unable to query CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE");
|
||||
@@ -287,7 +284,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
"but CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE "
|
||||
"returned a non-zero value");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE,
|
||||
sizeof(u), &u, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE");
|
||||
test_assert_error(
|
||||
@@ -295,7 +292,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
"CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but "
|
||||
"CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE returned a non-zero value");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_ON_DEVICE_QUEUES,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_MAX_ON_DEVICE_QUEUES,
|
||||
sizeof(u), &u, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_MAX_ON_DEVICE_QUEUES");
|
||||
test_assert_error(
|
||||
@@ -303,7 +300,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
"CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 but "
|
||||
"CL_DEVICE_MAX_ON_DEVICE_QUEUES returned a non-zero value");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_ON_DEVICE_EVENTS,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_MAX_ON_DEVICE_EVENTS,
|
||||
sizeof(u), &u, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_MAX_ON_DEVICE_EVENTS");
|
||||
test_assert_error(
|
||||
@@ -334,7 +331,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
// clSetDefaultDeviceCommandQueue
|
||||
// Returns CL_INVALID_OPERATION if device does not support On-Device
|
||||
// Queues.
|
||||
error = clSetDefaultDeviceCommandQueue(context, deviceID, NULL);
|
||||
error = clSetDefaultDeviceCommandQueue(context, device, NULL);
|
||||
test_failure_error(error, CL_INVALID_OPERATION,
|
||||
"CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES returned 0 "
|
||||
"but clSetDefaultDeviceCommandQueue did not return "
|
||||
@@ -347,7 +344,7 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
// clSetDefaultDeviceCommandQueue
|
||||
// Returns CL_INVALID_OPERATION if device does not support a
|
||||
// replaceable default On-Device Queue.
|
||||
error = clSetDefaultDeviceCommandQueue(context, deviceID, NULL);
|
||||
error = clSetDefaultDeviceCommandQueue(context, device, NULL);
|
||||
test_failure_error(
|
||||
error, CL_INVALID_OPERATION,
|
||||
"CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES did not "
|
||||
@@ -371,9 +368,9 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
if ((dseCaps & CL_DEVICE_QUEUE_SUPPORTED) != 0)
|
||||
{
|
||||
cl_bool b;
|
||||
error = clGetDeviceInfo(deviceID,
|
||||
CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT,
|
||||
sizeof(b), &b, NULL);
|
||||
error =
|
||||
clGetDeviceInfo(device, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT,
|
||||
sizeof(b), &b, NULL);
|
||||
test_error(
|
||||
error,
|
||||
"Unable to query CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT");
|
||||
@@ -387,16 +384,15 @@ int test_consistency_device_enqueue(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_pipes(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_pipes, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_PIPE_SUPPORT
|
||||
// May return CL_FALSE, indicating that device does not support Pipes.
|
||||
cl_int error;
|
||||
|
||||
cl_bool pipeSupport = CL_FALSE;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_SUPPORT,
|
||||
sizeof(pipeSupport), &pipeSupport, NULL);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PIPE_SUPPORT, sizeof(pipeSupport),
|
||||
&pipeSupport, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_PIPE_SUPPORT");
|
||||
|
||||
if (pipeSupport == CL_FALSE)
|
||||
@@ -409,16 +405,15 @@ int test_consistency_pipes(cl_device_id deviceID, cl_context context,
|
||||
|
||||
cl_uint u = 0;
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_PIPE_ARGS, sizeof(u),
|
||||
&u, NULL);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_MAX_PIPE_ARGS, sizeof(u), &u,
|
||||
NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_MAX_PIPE_ARGS");
|
||||
test_assert_error(u == 0,
|
||||
"CL_DEVICE_PIPE_SUPPORT returned CL_FALSE, but "
|
||||
"CL_DEVICE_MAX_PIPE_ARGS returned a non-zero value");
|
||||
|
||||
error =
|
||||
clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS,
|
||||
sizeof(u), &u, NULL);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS,
|
||||
sizeof(u), &u, NULL);
|
||||
test_error(error,
|
||||
"Unable to query CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS");
|
||||
test_assert_error(u == 0,
|
||||
@@ -426,7 +421,7 @@ int test_consistency_pipes(cl_device_id deviceID, cl_context context,
|
||||
"CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS returned "
|
||||
"a non-zero value");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_PIPE_MAX_PACKET_SIZE,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PIPE_MAX_PACKET_SIZE,
|
||||
sizeof(u), &u, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_PIPE_MAX_PACKET_SIZE");
|
||||
test_assert_error(
|
||||
@@ -461,9 +456,8 @@ int test_consistency_pipes(cl_device_id deviceID, cl_context context,
|
||||
// Devices that support pipes must also return CL_TRUE
|
||||
// for CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT.
|
||||
cl_bool b;
|
||||
error =
|
||||
clGetDeviceInfo(deviceID, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT,
|
||||
sizeof(b), &b, NULL);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT,
|
||||
sizeof(b), &b, NULL);
|
||||
test_error(error,
|
||||
"Unable to query CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT");
|
||||
test_assert_error(
|
||||
@@ -475,8 +469,7 @@ int test_consistency_pipes(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_progvar(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_progvar, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE
|
||||
// May return 0, indicating that device does not support Program Scope
|
||||
@@ -487,7 +480,7 @@ int test_consistency_progvar(cl_device_id deviceID, cl_context context,
|
||||
clKernelWrapper kernel;
|
||||
|
||||
size_t maxGlobalVariableSize = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE,
|
||||
sizeof(maxGlobalVariableSize),
|
||||
&maxGlobalVariableSize, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE");
|
||||
@@ -506,7 +499,7 @@ int test_consistency_progvar(cl_device_id deviceID, cl_context context,
|
||||
// CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE
|
||||
// Returns 0 if device does not support Program Scope Global Variables.
|
||||
|
||||
error = clGetDeviceInfo(deviceID,
|
||||
error = clGetDeviceInfo(device,
|
||||
CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE,
|
||||
sizeof(sz), &sz, NULL);
|
||||
test_error(
|
||||
@@ -523,7 +516,7 @@ int test_consistency_progvar(cl_device_id deviceID, cl_context context,
|
||||
// Returns 0 if device does not support Program Scope Global Variables.
|
||||
|
||||
error = clGetProgramBuildInfo(
|
||||
program, deviceID, CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE,
|
||||
program, device, CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE,
|
||||
sizeof(sz), &sz, NULL);
|
||||
test_error(
|
||||
error,
|
||||
@@ -537,10 +530,7 @@ int test_consistency_progvar(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_non_uniform_work_group(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_non_uniform_work_group, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT:
|
||||
// May return CL_FALSE, indicating that device does not support Non-Uniform
|
||||
@@ -553,7 +543,7 @@ int test_consistency_non_uniform_work_group(cl_device_id deviceID,
|
||||
clKernelWrapper kernel;
|
||||
|
||||
cl_bool nonUniformWorkGroupSupport = CL_FALSE;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT,
|
||||
sizeof(nonUniformWorkGroupSupport),
|
||||
&nonUniformWorkGroupSupport, NULL);
|
||||
test_error(error,
|
||||
@@ -620,9 +610,7 @@ int test_consistency_non_uniform_work_group(cl_device_id deviceID,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_read_write_images(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_read_write_images, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing
|
||||
// CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS May return 0,
|
||||
@@ -630,7 +618,7 @@ int test_consistency_read_write_images(cl_device_id deviceID,
|
||||
cl_int error;
|
||||
|
||||
cl_uint maxReadWriteImageArgs = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS,
|
||||
sizeof(maxReadWriteImageArgs),
|
||||
&maxReadWriteImageArgs, NULL);
|
||||
test_error(error,
|
||||
@@ -683,10 +671,7 @@ int test_consistency_read_write_images(cl_device_id deviceID,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_2d_image_from_buffer(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_2d_image_from_buffer, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_IMAGE_PITCH_ALIGNMENT or
|
||||
// CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT
|
||||
@@ -703,7 +688,7 @@ int test_consistency_2d_image_from_buffer(cl_device_id deviceID,
|
||||
clMemWrapper image;
|
||||
|
||||
cl_uint imagePitchAlignment = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_PITCH_ALIGNMENT,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_IMAGE_PITCH_ALIGNMENT,
|
||||
sizeof(imagePitchAlignment), &imagePitchAlignment,
|
||||
NULL);
|
||||
test_error(error,
|
||||
@@ -711,7 +696,7 @@ int test_consistency_2d_image_from_buffer(cl_device_id deviceID,
|
||||
"CL_DEVICE_IMAGE_PITCH_ALIGNMENT");
|
||||
|
||||
cl_uint imageBaseAddressAlignment = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT,
|
||||
sizeof(imageBaseAddressAlignment),
|
||||
&imageBaseAddressAlignment, NULL);
|
||||
test_error(error,
|
||||
@@ -719,7 +704,7 @@ int test_consistency_2d_image_from_buffer(cl_device_id deviceID,
|
||||
"CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT");
|
||||
|
||||
bool supports_cl_khr_image2d_from_buffer =
|
||||
is_extension_available(deviceID, "cl_khr_image2d_from_buffer");
|
||||
is_extension_available(device, "cl_khr_image2d_from_buffer");
|
||||
|
||||
if (imagePitchAlignment == 0 || imageBaseAddressAlignment == 0)
|
||||
{
|
||||
@@ -790,8 +775,7 @@ int test_consistency_2d_image_from_buffer(cl_device_id deviceID,
|
||||
// All of the sRGB Image Channel Orders (such as CL_sRGBA) are optional for
|
||||
// devices supporting OpenCL 3.0.
|
||||
|
||||
int test_consistency_depth_images(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_depth_images, Version(3, 0))
|
||||
{
|
||||
// The CL_DEPTH Image Channel Order is optional for devices supporting
|
||||
// OpenCL 3.0.
|
||||
@@ -830,7 +814,7 @@ int test_consistency_depth_images(cl_device_id deviceID, cl_context context,
|
||||
}
|
||||
|
||||
bool supports_cl_khr_depth_images =
|
||||
is_extension_available(deviceID, "cl_khr_depth_images");
|
||||
is_extension_available(device, "cl_khr_depth_images");
|
||||
|
||||
if (totalDepthImageFormats == 0)
|
||||
{
|
||||
@@ -848,10 +832,7 @@ int test_consistency_depth_images(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_device_and_host_timer(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_device_and_host_timer, Version(3, 0))
|
||||
{
|
||||
// clGetPlatformInfo, passing CL_PLATFORM_HOST_TIMER_RESOLUTION
|
||||
// May return 0, indicating that platform does not support Device and Host
|
||||
@@ -859,7 +840,7 @@ int test_consistency_device_and_host_timer(cl_device_id deviceID,
|
||||
cl_int error;
|
||||
|
||||
cl_platform_id platform = NULL;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(platform),
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform),
|
||||
&platform, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_PLATFORM");
|
||||
|
||||
@@ -878,13 +859,13 @@ int test_consistency_device_and_host_timer(cl_device_id deviceID,
|
||||
cl_ulong dt = 0;
|
||||
cl_ulong ht = 0;
|
||||
|
||||
error = clGetDeviceAndHostTimer(deviceID, &dt, &ht);
|
||||
error = clGetDeviceAndHostTimer(device, &dt, &ht);
|
||||
test_failure_error(
|
||||
error, CL_INVALID_OPERATION,
|
||||
"CL_PLATFORM_HOST_TIMER_RESOLUTION returned 0 but "
|
||||
"clGetDeviceAndHostTimer did not return CL_INVALID_OPERATION");
|
||||
|
||||
error = clGetHostTimer(deviceID, &ht);
|
||||
error = clGetHostTimer(device, &ht);
|
||||
test_failure_error(
|
||||
error, CL_INVALID_OPERATION,
|
||||
"CL_PLATFORM_HOST_TIMER_RESOLUTION returned 0 but "
|
||||
@@ -894,8 +875,7 @@ int test_consistency_device_and_host_timer(cl_device_id deviceID,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_il_programs(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_il_programs, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_IL_VERSION or
|
||||
// CL_DEVICE_ILS_WITH_VERSION
|
||||
@@ -909,14 +889,14 @@ int test_consistency_il_programs(cl_device_id deviceID, cl_context context,
|
||||
// Even if the device does not support Intermediate Language Programs the
|
||||
// size of the string query should not be zero.
|
||||
size_t sz = SIZE_MAX;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_IL_VERSION, 0, NULL, &sz);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, 0, NULL, &sz);
|
||||
test_error(error, "Unable to query CL_DEVICE_IL_VERSION");
|
||||
test_assert_error(sz != 0,
|
||||
"CL_DEVICE_IL_VERSION should return a non-zero size");
|
||||
|
||||
std::string ilVersion = get_device_il_version_string(deviceID);
|
||||
std::string ilVersion = get_device_il_version_string(device);
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_ILS_WITH_VERSION, 0, NULL, &sz);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_ILS_WITH_VERSION, 0, NULL, &sz);
|
||||
test_error(error, "Unable to query CL_DEVICE_ILS_WITH_VERSION");
|
||||
|
||||
if (ilVersion == "" || sz == 0)
|
||||
@@ -935,7 +915,7 @@ int test_consistency_il_programs(cl_device_id deviceID, cl_context context,
|
||||
"but CL_DEVICE_IL_VERSION returned an empty string");
|
||||
|
||||
bool supports_cl_khr_il_program =
|
||||
is_extension_available(deviceID, "cl_khr_il_program");
|
||||
is_extension_available(device, "cl_khr_il_program");
|
||||
test_assert_error(supports_cl_khr_il_program == false,
|
||||
"Device does not support IL Programs but does "
|
||||
"support cl_khr_il_program");
|
||||
@@ -985,8 +965,7 @@ int test_consistency_il_programs(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_subgroups(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_subgroups, Version(3, 0))
|
||||
{
|
||||
// clGetDeviceInfo, passing CL_DEVICE_MAX_NUM_SUB_GROUPS
|
||||
// May return 0, indicating that device does not support Subgroups.
|
||||
@@ -996,7 +975,7 @@ int test_consistency_subgroups(cl_device_id deviceID, cl_context context,
|
||||
clKernelWrapper kernel;
|
||||
|
||||
cl_uint maxNumSubGroups = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_NUM_SUB_GROUPS,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_MAX_NUM_SUB_GROUPS,
|
||||
sizeof(maxNumSubGroups), &maxNumSubGroups, NULL);
|
||||
test_error(error, "Unable to query CL_DEVICE_MAX_NUM_SUB_GROUPS");
|
||||
|
||||
@@ -1014,7 +993,7 @@ int test_consistency_subgroups(cl_device_id deviceID, cl_context context,
|
||||
|
||||
cl_bool ifp = CL_FALSE;
|
||||
error = clGetDeviceInfo(
|
||||
deviceID, CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS,
|
||||
device, CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS,
|
||||
sizeof(ifp), &ifp, NULL);
|
||||
test_error(
|
||||
error,
|
||||
@@ -1029,7 +1008,7 @@ int test_consistency_subgroups(cl_device_id deviceID, cl_context context,
|
||||
// device does not support Subgroups.
|
||||
|
||||
bool supports_cl_khr_subgroups =
|
||||
is_extension_available(deviceID, "cl_khr_subgroups");
|
||||
is_extension_available(device, "cl_khr_subgroups");
|
||||
test_assert_error(supports_cl_khr_subgroups == false,
|
||||
"Device does not support Subgroups but does "
|
||||
"support cl_khr_subgroups");
|
||||
@@ -1038,7 +1017,7 @@ int test_consistency_subgroups(cl_device_id deviceID, cl_context context,
|
||||
// Returns CL_INVALID_OPERATION if device does not support Subgroups.
|
||||
|
||||
size_t sz = SIZE_MAX;
|
||||
error = clGetKernelSubGroupInfo(kernel, deviceID,
|
||||
error = clGetKernelSubGroupInfo(kernel, device,
|
||||
CL_KERNEL_MAX_NUM_SUB_GROUPS, 0, NULL,
|
||||
sizeof(sz), &sz, NULL);
|
||||
test_failure_error(
|
||||
@@ -1052,8 +1031,7 @@ int test_consistency_subgroups(cl_device_id deviceID, cl_context context,
|
||||
|
||||
static void CL_CALLBACK program_callback(cl_program, void*) {}
|
||||
|
||||
int test_consistency_prog_ctor_dtor(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_prog_ctor_dtor, Version(3, 0))
|
||||
{
|
||||
cl_int error;
|
||||
|
||||
@@ -1099,8 +1077,7 @@ int test_consistency_prog_ctor_dtor(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_3d_image_writes(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST_VERSION(consistency_3d_image_writes, Version(3, 0))
|
||||
{
|
||||
// clGetSupportedImageFormats, passing CL_MEM_OBJECT_IMAGE3D and one of
|
||||
// CL_MEM_WRITE_ONLY, CL_MEM_READ_WRITE, or CL_MEM_KERNEL_READ_AND_WRITE
|
||||
@@ -1131,7 +1108,7 @@ int test_consistency_3d_image_writes(cl_device_id deviceID, cl_context context,
|
||||
}
|
||||
|
||||
bool supports_cl_khr_3d_image_writes =
|
||||
is_extension_available(deviceID, "cl_khr_3d_image_writes");
|
||||
is_extension_available(device, "cl_khr_3d_image_writes");
|
||||
|
||||
if (total3DImageWriteFormats == 0)
|
||||
{
|
||||
@@ -1152,18 +1129,16 @@ int test_consistency_3d_image_writes(cl_device_id deviceID, cl_context context,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_requirements_fp64(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(consistency_requirements_fp64)
|
||||
{
|
||||
cl_int error = CL_SUCCESS;
|
||||
cl_device_fp_config value = 0;
|
||||
|
||||
if (is_extension_available(deviceID, "cl_khr_fp64"))
|
||||
if (is_extension_available(device, "cl_khr_fp64"))
|
||||
{
|
||||
const Version version = get_device_cl_version(deviceID);
|
||||
const Version version = get_device_cl_version(device);
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_DOUBLE_FP_CONFIG,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_DOUBLE_FP_CONFIG,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(error, "Unable to get device CL_DEVICE_DOUBLE_FP_CONFIG");
|
||||
test_assert_error(
|
||||
@@ -1187,9 +1162,8 @@ int test_consistency_requirements_fp64(cl_device_id deviceID,
|
||||
"for OpenCL 2.0 or newer devices");
|
||||
}
|
||||
|
||||
error =
|
||||
clGetDeviceInfo(deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
|
||||
sizeof(value), &value, nullptr);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(
|
||||
error,
|
||||
"Unable to get device CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE");
|
||||
@@ -1197,7 +1171,7 @@ int test_consistency_requirements_fp64(cl_device_id deviceID,
|
||||
"CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE must return "
|
||||
"nonzero value");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(error,
|
||||
"Unable to get device CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE");
|
||||
@@ -1207,15 +1181,14 @@ int test_consistency_requirements_fp64(cl_device_id deviceID,
|
||||
}
|
||||
else
|
||||
{
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_DOUBLE_FP_CONFIG,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_DOUBLE_FP_CONFIG,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(error, "Unable to get device CL_DEVICE_DOUBLE_FP_CONFIG");
|
||||
test_assert_error(value == 0,
|
||||
"CL_DEVICE_DOUBLE_FP_CONFIG must return 0");
|
||||
|
||||
error =
|
||||
clGetDeviceInfo(deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
|
||||
sizeof(value), &value, nullptr);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(
|
||||
error,
|
||||
"Unable to get device CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE");
|
||||
@@ -1223,7 +1196,7 @@ int test_consistency_requirements_fp64(cl_device_id deviceID,
|
||||
value == 0,
|
||||
"CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE must return 0");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(error,
|
||||
"Unable to get device CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE");
|
||||
@@ -1234,17 +1207,15 @@ int test_consistency_requirements_fp64(cl_device_id deviceID,
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
int test_consistency_requirements_fp16(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(consistency_requirements_fp16)
|
||||
{
|
||||
cl_int error = CL_SUCCESS;
|
||||
cl_device_fp_config value = 0;
|
||||
|
||||
if (is_extension_available(deviceID, "cl_khr_fp16"))
|
||||
if (is_extension_available(device, "cl_khr_fp16"))
|
||||
{
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_HALF_FP_CONFIG,
|
||||
sizeof(value), &value, nullptr);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_HALF_FP_CONFIG, sizeof(value),
|
||||
&value, nullptr);
|
||||
test_error(error, "Unable to get device CL_DEVICE_HALF_FP_CONFIG");
|
||||
test_assert_error(value > 0,
|
||||
"CL_DEVICE_HALF_FP_CONFIG must return nonzero value");
|
||||
@@ -1253,7 +1224,7 @@ int test_consistency_requirements_fp16(cl_device_id deviceID,
|
||||
|| (value & CL_FP_ROUND_TO_ZERO),
|
||||
"Reported half fp config doesn't meet minimum set");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(
|
||||
error,
|
||||
@@ -1262,7 +1233,7 @@ int test_consistency_requirements_fp16(cl_device_id deviceID,
|
||||
"CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF must return "
|
||||
"nonzero value");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(error,
|
||||
"Unable to get device CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF");
|
||||
@@ -1272,14 +1243,14 @@ int test_consistency_requirements_fp16(cl_device_id deviceID,
|
||||
}
|
||||
else
|
||||
{
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_HALF_FP_CONFIG,
|
||||
sizeof(value), &value, nullptr);
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_HALF_FP_CONFIG, sizeof(value),
|
||||
&value, nullptr);
|
||||
test_failure_error(
|
||||
error, CL_INVALID_VALUE,
|
||||
"cl_khr_fp16 is not available; CL_DEVICE_HALF_FP_CONFIG must fail "
|
||||
"with CL_INVALID_VALUE");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(
|
||||
error,
|
||||
@@ -1288,7 +1259,7 @@ int test_consistency_requirements_fp16(cl_device_id deviceID,
|
||||
"CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF must return "
|
||||
"0");
|
||||
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF,
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF,
|
||||
sizeof(value), &value, nullptr);
|
||||
test_error(error,
|
||||
"Unable to get device CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF");
|
||||
|
||||
Reference in New Issue
Block a user