From 2b8e8294c1bc06e13c02a71d1b8bca34e6da5dc0 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 3 May 2016 14:32:32 -0400
Subject: [PATCH] P4 to Git Change 1264675 by gandryey@gera-w8 on 2016/05/03
14:13:52
SWDEV-86170 - Need OCL changes for Compute Unit Reservation
- Add support for RT and Medium priority queues
- Use the new packet for the CU mask programming. It will allow CU reservation for RT queue in KMD.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_command.cpp#11 edit
... //depot/stg/opencl/drivers/opencl/library/hsa/hsail/src/devenq/schedule.cl#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#546 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#159 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#127 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#402 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#139 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp#81 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.h#52 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#165 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/backend.h#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.hpp#17 edit
[ROCm/clr commit: 0c54d874fb0668973323712c92c314487906b642]
---
projects/clr/opencl/api/opencl/amdocl/cl_command.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_command.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_command.cpp
index ee353076d6..0c80c83622 100644
--- a/projects/clr/opencl/api/opencl/amdocl/cl_command.cpp
+++ b/projects/clr/opencl/api/opencl/amdocl/cl_command.cpp
@@ -87,7 +87,8 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, (
} *p = reinterpret_cast(queue_properties);
uint queueSize = amdDevice.info().queueOnDevicePreferredSize_;
- uint queueRTCUs = 0;
+ uint queueRTCUs = amd::CommandQueue::RealTimeDisabled;
+ amd::CommandQueue::Priority priority = amd::CommandQueue::Priority::Normal;
if (p != NULL) while(p->name != 0) {
switch(p->name) {
case CL_QUEUE_PROPERTIES:
@@ -102,6 +103,10 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, (
case CL_QUEUE_REAL_TIME_COMPUTE_UNITS_AMD:
queueRTCUs = p->value.size;
break;
+#define CL_QUEUE_MEDIUM_PRIORITY 0x4050
+ case CL_QUEUE_MEDIUM_PRIORITY:
+ priority = amd::CommandQueue::Priority::Medium;
+ break;
default:
*not_null(errcode_ret) = CL_INVALID_QUEUE_PROPERTIES;
LogWarning("invalid property name");
@@ -115,7 +120,8 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, (
return (cl_command_queue) 0;
}
- if (queueRTCUs > amdDevice.info().numRTCUs_) {
+ if ((queueRTCUs != amd::CommandQueue::RealTimeDisabled) &&
+ ((queueRTCUs > amdDevice.info().numRTCUs_) || (queueRTCUs == 0))) {
*not_null(errcode_ret) = CL_INVALID_VALUE;
return (cl_command_queue) 0;
}
@@ -126,7 +132,7 @@ RUNTIME_ENTRY_RET(cl_command_queue, clCreateCommandQueueWithProperties, (
// Check if the app creates a host queue
if (!(properties & CL_QUEUE_ON_DEVICE)) {
- queue = new amd::HostQueue(amdContext, amdDevice, properties, queueRTCUs);
+ queue = new amd::HostQueue(amdContext, amdDevice, properties, queueRTCUs, priority);
}
else {
// Is it a device default queue