From 1ffcdefc2218ad37472175f24a8dfa31480fb441 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 18 Oct 2019 17:47:30 -0400
Subject: [PATCH] P4 to Git Change 2016282 by gandryey@gera-win10 on 2019/10/18
17:41:12
SWDEV-79445 - OCL generic changes and code clean-up
- Remove cl_amd_command_intercept extension
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#21 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#38 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h#15 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_ext.h#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#53 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.hpp#30 edit
[ROCm/clr commit: 902353adc6435d0f9c31e7aba813822484082a56]
---
.../rocclr/runtime/platform/commandqueue.cpp | 20 +++----------------
.../clr/rocclr/runtime/platform/context.cpp | 5 -----
.../clr/rocclr/runtime/platform/context.hpp | 4 +---
3 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/projects/clr/rocclr/runtime/platform/commandqueue.cpp b/projects/clr/rocclr/runtime/platform/commandqueue.cpp
index e559d23ffb..160c97b67e 100644
--- a/projects/clr/rocclr/runtime/platform/commandqueue.cpp
+++ b/projects/clr/rocclr/runtime/platform/commandqueue.cpp
@@ -19,8 +19,7 @@ namespace amd {
HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properties properties,
uint queueRTCUs, Priority priority)
- : CommandQueue(context, device, properties,
- device.info().queueProperties_ | CL_QUEUE_COMMAND_INTERCEPT_ENABLE_AMD,
+ : CommandQueue(context, device, properties, device.info().queueProperties_,
queueRTCUs, priority),
lastEnqueueCommand_(nullptr) {
if (thread_.state() >= Thread::INITIALIZED) {
@@ -83,10 +82,6 @@ void HostQueue::finish() {
}
void HostQueue::loop(device::VirtualDevice* virtualDevice) {
- cl_int(CL_CALLBACK * commandIntercept)(cl_event, cl_int*) =
- properties().test(CL_QUEUE_COMMAND_INTERCEPT_ENABLE_AMD) ? context().info().commandIntercept_
- : NULL;
-
// Notify the caller that the queue is ready to accept commands.
{
ScopedLock sl(queueLock_);
@@ -138,20 +133,11 @@ void HostQueue::loop(device::VirtualDevice* virtualDevice) {
}
command->setStatus(CL_SUBMITTED);
-
- cl_int result;
- if ((commandIntercept != NULL) && commandIntercept(as_cl(command), &result)) {
- // The command was handled by the callback.
- command->setStatus(CL_RUNNING, command->profilingInfo().submitted_);
- command->setStatus(result);
- continue;
- }
-
// Submit to the device queue.
command->submit(*virtualDevice);
- // if we are in intercept mode or this is a user invisible marker command
- if ((0 == command->type()) || (commandIntercept != NULL)) {
+ // if this is a user invisible marker command, then flush
+ if (0 == command->type()) {
virtualDevice->flush(head);
tail = head = NULL;
}
diff --git a/projects/clr/rocclr/runtime/platform/context.cpp b/projects/clr/rocclr/runtime/platform/context.cpp
index 71dfc28fac..9e1d9db0ca 100644
--- a/projects/clr/rocclr/runtime/platform/context.cpp
+++ b/projects/clr/rocclr/runtime/platform/context.cpp
@@ -184,11 +184,6 @@ int Context::checkProperties(const cl_context_properties* properties, Context::I
// Set the offline device flag
info->flags_ |= OfflineDevices;
break;
- case CL_CONTEXT_COMMAND_INTERCEPT_CALLBACK_AMD:
- // Set the command intercept flag
- info->commandIntercept_ = (cl_int(CL_CALLBACK*)(cl_event, cl_int*))p->ptr;
- info->flags_ |= CommandIntercept;
- break;
default:
return CL_INVALID_VALUE;
}
diff --git a/projects/clr/rocclr/runtime/platform/context.hpp b/projects/clr/rocclr/runtime/platform/context.hpp
index be05d5cbee..8da380e2f4 100644
--- a/projects/clr/rocclr/runtime/platform/context.hpp
+++ b/projects/clr/rocclr/runtime/platform/context.hpp
@@ -33,7 +33,7 @@ class Context : public RuntimeObject {
GLDeviceKhrIdx = 0, //!< GL
D3D10DeviceKhrIdx, //!< D3D10
OfflineDevicesIdx, //!< Offline devices
- CommandInterceptIdx, //!< Command intercept
+ CommandInterceptIdx, //!< (Deprecated) Command intercept
D3D11DeviceKhrIdx, //!< D3D11
InteropUserSyncIdx, //!< Interop user sync enabled
D3D9DeviceKhrIdx, //!< d3d9 device
@@ -47,7 +47,6 @@ class Context : public RuntimeObject {
GLDeviceKhr = 1 << GLDeviceKhrIdx, //!< GL
D3D10DeviceKhr = 1 << D3D10DeviceKhrIdx, //!< D3D10
OfflineDevices = 1 << OfflineDevicesIdx, //!< Offline devices
- CommandIntercept = 1 << CommandInterceptIdx, //!< Command intercept
D3D11DeviceKhr = 1 << D3D11DeviceKhrIdx, //!< D3D11
InteropUserSync = 1 << InteropUserSyncIdx, //!< Interop user sync enabled
D3D9DeviceKhr = 1 << D3D9DeviceKhrIdx, //!< d3d9 device
@@ -62,7 +61,6 @@ class Context : public RuntimeObject {
void* hDev_[LastDeviceFlagIdx]; //!< Device object reference
void* hCtx_; //!< Context object reference
size_t propertiesSize_; //!< Size of the original properties in bytes
- cl_int(CL_CALLBACK* commandIntercept_)(cl_event, cl_int*);
};
struct DeviceQueueInfo {