diff --git a/opencl/api/opencl/amdocl/cl_command.cpp b/opencl/api/opencl/amdocl/cl_command.cpp index 5dc44b67c6..ee353076d6 100644 --- a/opencl/api/opencl/amdocl/cl_command.cpp +++ b/opencl/api/opencl/amdocl/cl_command.cpp @@ -87,6 +87,7 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, ( } *p = reinterpret_cast(queue_properties); uint queueSize = amdDevice.info().queueOnDevicePreferredSize_; + uint queueRTCUs = 0; if (p != NULL) while(p->name != 0) { switch(p->name) { case CL_QUEUE_PROPERTIES: @@ -94,9 +95,13 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, ( //properties = p->value.properties; properties = static_cast(p->value.raw); break; - case CL_QUEUE_SIZE: // Unimplemented + case CL_QUEUE_SIZE: queueSize = p->value.size; break; +#define CL_QUEUE_REAL_TIME_COMPUTE_UNITS_AMD 0x404f + case CL_QUEUE_REAL_TIME_COMPUTE_UNITS_AMD: + queueRTCUs = p->value.size; + break; default: *not_null(errcode_ret) = CL_INVALID_QUEUE_PROPERTIES; LogWarning("invalid property name"); @@ -110,13 +115,18 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, ( return (cl_command_queue) 0; } + if (queueRTCUs > amdDevice.info().numRTCUs_) { + *not_null(errcode_ret) = CL_INVALID_VALUE; + return (cl_command_queue) 0; + } + amd::CommandQueue* queue = NULL; { amd::ScopedLock lock(amdContext.lock()); // Check if the app creates a host queue if (!(properties & CL_QUEUE_ON_DEVICE)) { - queue = new amd::HostQueue(amdContext, amdDevice, properties); + queue = new amd::HostQueue(amdContext, amdDevice, properties, queueRTCUs); } else { // Is it a device default queue diff --git a/opencl/api/opencl/amdocl/cl_device.cpp b/opencl/api/opencl/amdocl/cl_device.cpp index c0778d554b..ce50acc300 100644 --- a/opencl/api/opencl/amdocl/cl_device.cpp +++ b/opencl/api/opencl/amdocl/cl_device.cpp @@ -652,6 +652,10 @@ RUNTIME_ENTRY(cl_int, clGetDeviceInfo, ( minor, param_value_size, param_value, param_value_size_ret); } CASE(CL_DEVICE_AVAILABLE_ASYNC_QUEUES_AMD, numAsyncQueues_); +#define CL_DEVICE_MAX_REAL_TIME_COMPUTE_QUEUES_AMD 0x404D +#define CL_DEVICE_MAX_REAL_TIME_COMPUTE_UNITS_AMD 0x404E + CASE(CL_DEVICE_MAX_REAL_TIME_COMPUTE_QUEUES_AMD, numRTQueues_); + CASE(CL_DEVICE_MAX_REAL_TIME_COMPUTE_UNITS_AMD, numRTCUs_); default: break; }