mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
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:
committed by
sys_ocldev
parent
70d50616d0
commit
a651625473
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user