Add missing CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE check in negative_set_default_device_command_queue (#2602)

Fixes #2566
This commit is contained in:
Marcin Hajder
2026-02-03 17:42:28 +01:00
committed by GitHub
parent 591a736918
commit 2d9e1cb92e

View File

@@ -349,24 +349,34 @@ REGISTER_TEST_VERSION(negative_set_default_device_command_queue, Version(2, 1))
} }
{ {
constexpr cl_queue_properties props[] = { cl_command_queue_properties queue_properties;
CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0 err =
}; clGetDeviceInfo(device, CL_DEVICE_QUEUE_PROPERTIES,
clCommandQueueWrapper not_on_device_queue = sizeof(queue_properties), &queue_properties, NULL);
clCreateCommandQueueWithProperties(context, device, props, &err); test_error(err, "Unable to query CL_DEVICE_QUEUE_PROPERTIES");
test_error_fail(err, "clCreateCommandQueueWithProperties failed"); if (queue_properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE)
err = clSetDefaultDeviceCommandQueue(context, device,
not_on_device_queue);
if (err != CL_INVALID_OPERATION && err != CL_INVALID_COMMAND_QUEUE)
{ {
log_error("ERROR: %s! (Got %s, expected (%s) from %s:%d)\n", constexpr cl_queue_properties props[] = {
"clSetDefaultDeviceCommandQueue should return " CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, 0
"CL_INVALID_OPERATION or CL_INVALID_COMMAND_QUEUE when: " };
"\"command_queue is not a valid command-queue for " clCommandQueueWrapper not_on_device_queue =
"device\" using a command queue that is not on device", clCreateCommandQueueWithProperties(context, device, props,
IGetErrorString(err), &err);
"CL_INVALID_OPERATION or CL_INVALID_COMMAND_QUEUE", test_error_fail(err, "clCreateCommandQueueWithProperties failed");
__FILE__, __LINE__); err = clSetDefaultDeviceCommandQueue(context, device,
not_on_device_queue);
if (err != CL_INVALID_OPERATION && err != CL_INVALID_COMMAND_QUEUE)
{
log_error(
"ERROR: %s! (Got %s, expected (%s) from %s:%d)\n",
"clSetDefaultDeviceCommandQueue should return "
"CL_INVALID_OPERATION or CL_INVALID_COMMAND_QUEUE when: "
"\"command_queue is not a valid command-queue for "
"device\" using a command queue that is not on device",
IGetErrorString(err),
"CL_INVALID_OPERATION or CL_INVALID_COMMAND_QUEUE",
__FILE__, __LINE__);
}
} }
} }