Correct validation during creating command queue

check if device is associated with context

Related-To: NEO-3691
Change-Id: I7dfe12376bb2bb2c764b471315072a29068a0cb7
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-03-24 15:05:12 +01:00
committed by sys_ocldev
parent 70d50616d0
commit a651625473
8 changed files with 54 additions and 12 deletions

View File

@@ -527,6 +527,10 @@ cl_command_queue CL_API_CALL clCreateCommandQueue(cl_context context,
if (retVal != CL_SUCCESS) {
break;
}
if (!pContext->isDeviceAssociated(*pDevice)) {
retVal = CL_INVALID_DEVICE;
break;
}
cl_queue_properties props[] = {
CL_QUEUE_PROPERTIES, properties,
@@ -4719,6 +4723,12 @@ cl_command_queue CL_API_CALL clCreateCommandQueueWithProperties(cl_context conte
return commandQueue;
}
if (!pContext->isDeviceAssociated(*pDevice)) {
err.set(CL_INVALID_DEVICE);
TRACING_EXIT(clCreateCommandQueueWithProperties, &commandQueue);
return commandQueue;
}
auto minimumCreateDeviceQueueFlags = static_cast<cl_command_queue_properties>(CL_QUEUE_ON_DEVICE |
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE);
auto tokenValue = properties ? *properties : 0;