OpenCL Queue Families extension 1/n

Basic implementation, some things will be tweaked in future commits

Related-To: NEO-5120
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2020-11-16 11:43:03 +00:00
committed by Compute-Runtime-Automation
parent 2be1b36422
commit 14f92cc7a1
16 changed files with 621 additions and 109 deletions

View File

@@ -4882,6 +4882,8 @@ cl_command_queue CL_API_CALL clCreateCommandQueueWithProperties(cl_context conte
tokenValue != CL_QUEUE_PRIORITY_KHR &&
tokenValue != CL_QUEUE_THROTTLE_KHR &&
tokenValue != CL_QUEUE_SLICE_COUNT_INTEL &&
tokenValue != CL_QUEUE_FAMILY_INTEL &&
tokenValue != CL_QUEUE_INDEX_INTEL &&
!isExtraToken(propertiesAddress)) {
err.set(CL_INVALID_VALUE);
TRACING_EXIT(clCreateCommandQueueWithProperties, &commandQueue);
@@ -4956,6 +4958,23 @@ cl_command_queue CL_API_CALL clCreateCommandQueueWithProperties(cl_context conte
return commandQueue;
}
bool queueFamilySelected = false;
bool queueSelected = false;
const auto queueFamilyIndex = getCmdQueueProperties<cl_uint>(properties, CL_QUEUE_FAMILY_INTEL, &queueFamilySelected);
const auto queueIndex = getCmdQueueProperties<cl_uint>(properties, CL_QUEUE_INDEX_INTEL, &queueSelected);
if (queueFamilySelected != queueSelected) {
err.set(CL_INVALID_QUEUE_PROPERTIES);
TRACING_EXIT(clCreateCommandQueueWithProperties, &commandQueue);
return commandQueue;
}
if (queueFamilySelected &&
(queueFamilyIndex >= pDevice->getDeviceInfo().queueFamilyProperties.size() ||
queueIndex >= pDevice->getDeviceInfo().queueFamilyProperties[queueFamilyIndex].count)) {
err.set(CL_INVALID_QUEUE_PROPERTIES);
TRACING_EXIT(clCreateCommandQueueWithProperties, &commandQueue);
return commandQueue;
}
auto maskedFlags = commandQueueProperties & minimumCreateDeviceQueueFlags;
if (maskedFlags == minimumCreateDeviceQueueFlags) {