From c1e910d666a85107ace95c15c912e127495c972b Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 28 May 2018 14:56:22 -0400
Subject: [PATCH] P4 to Git Change 1560456 by gandryey@gera-w8 on 2018/05/28
14:41:37
SWDEV-154862 - [CQE OCL][DTB][DTB-BLOCKER][Perf][QR][G] Upto 13% Performance drop observed while running CLFFT subtests due to Faulty CL #1559246
- Disable command queue notification if the event is on the same queue.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_common.hpp#22 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_execute.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#59 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#82 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_profile_amd.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_sdi_amd.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_thread_trace_amd.cpp#9 edit
---
opencl/api/opencl/amdocl/cl_common.hpp | 6 ++--
opencl/api/opencl/amdocl/cl_execute.cpp | 10 +++---
opencl/api/opencl/amdocl/cl_gl.cpp | 4 +--
opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp | 2 +-
opencl/api/opencl/amdocl/cl_memobj.cpp | 34 +++++++++----------
opencl/api/opencl/amdocl/cl_profile_amd.cpp | 4 +--
opencl/api/opencl/amdocl/cl_sdi_amd.cpp | 6 ++--
opencl/api/opencl/amdocl/cl_svm.cpp | 12 +++----
.../api/opencl/amdocl/cl_thread_trace_amd.cpp | 4 +--
9 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/opencl/api/opencl/amdocl/cl_common.hpp b/opencl/api/opencl/amdocl/cl_common.hpp
index aefe80c1d7..c642f82bd8 100644
--- a/opencl/api/opencl/amdocl/cl_common.hpp
+++ b/opencl/api/opencl/amdocl/cl_common.hpp
@@ -181,7 +181,7 @@ clGetInfo(
static inline cl_int
clSetEventWaitList(
Command::EventWaitList& eventWaitList,
- const Context& context,
+ const amd::HostQueue& hostQueue,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list)
{
@@ -196,10 +196,10 @@ clSetEventWaitList(
if (!is_valid(event)) {
return CL_INVALID_EVENT_WAIT_LIST;
}
- if (&context != &amdEvent->context()) {
+ if (&hostQueue.context() != &amdEvent->context()) {
return CL_INVALID_CONTEXT;
}
- if (!amdEvent->notifyCmdQueue()) {
+ if ((amdEvent->command().queue() != &hostQueue) && !amdEvent->notifyCmdQueue()) {
return CL_INVALID_EVENT_WAIT_LIST;
}
eventWaitList.push_back(amdEvent);
diff --git a/opencl/api/opencl/amdocl/cl_execute.cpp b/opencl/api/opencl/amdocl/cl_execute.cpp
index 3fa99f154b..c0972f5faf 100644
--- a/opencl/api/opencl/amdocl/cl_execute.cpp
+++ b/opencl/api/opencl/amdocl/cl_execute.cpp
@@ -250,7 +250,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueNDRangeKernel,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -459,7 +459,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueNativeKernel,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -640,7 +640,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueMarkerWithWaitList,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue->context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, *hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -702,7 +702,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueWaitForEvents,
amd::HostQueue& hostQueue = *queue;
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events, event_list);
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events, event_list);
if (err != CL_SUCCESS) {
return err;
}
@@ -796,7 +796,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueBarrierWithWaitList,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue->context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, *hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_gl.cpp b/opencl/api/opencl/amdocl/cl_gl.cpp
index f7781e2f36..a3b6318b69 100644
--- a/opencl/api/opencl/amdocl/cl_gl.cpp
+++ b/opencl/api/opencl/amdocl/cl_gl.cpp
@@ -1934,7 +1934,7 @@ cl_int clEnqueueAcquireExtObjectsAMD(cl_command_queue command_queue, cl_uint num
}
amd::Command::EventWaitList eventWaitList;
- err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -2007,7 +2007,7 @@ cl_int clEnqueueReleaseExtObjectsAMD(cl_command_queue command_queue, cl_uint num
}
amd::Command::EventWaitList eventWaitList;
- err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp b/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp
index 38e498b8f3..bdd4b47426 100644
--- a/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp
+++ b/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp
@@ -240,7 +240,7 @@ static cl_int EnqueueTransferBufferFromSsgFileAMD(
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_memobj.cpp b/opencl/api/opencl/amdocl/cl_memobj.cpp
index 823c3529aa..6a88d9d3ea 100644
--- a/opencl/api/opencl/amdocl/cl_memobj.cpp
+++ b/opencl/api/opencl/amdocl/cl_memobj.cpp
@@ -608,7 +608,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueReadBuffer,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -748,7 +748,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueWriteBuffer,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -877,7 +877,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyBuffer,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -1060,7 +1060,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueReadBufferRect,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -1244,7 +1244,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueWriteBufferRect,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -1425,7 +1425,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyBufferRect,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -2195,7 +2195,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueReadImage,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -2377,7 +2377,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueWriteImage,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -2556,7 +2556,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyImage,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -2730,7 +2730,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyImageToBuffer,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -2884,7 +2884,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyBufferToImage,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -3060,7 +3060,7 @@ RUNTIME_ENTRY_RET(void*, clEnqueueMapBuffer,
// Wait for possible pending operations
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
*not_null(errcode_ret) = err;
@@ -3325,7 +3325,7 @@ RUNTIME_ENTRY_RET(void*, clEnqueueMapImage,
// Wait for possible pending operations
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
*not_null(errcode_ret) = err;
@@ -3464,7 +3464,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueUnmapMemObject,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -4203,7 +4203,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueFillBuffer,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -4362,7 +4362,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueFillImage,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -4513,7 +4513,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueMigrateMemObjects,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_profile_amd.cpp b/opencl/api/opencl/amdocl/cl_profile_amd.cpp
index 5bf54dc5f2..5e8cec3234 100644
--- a/opencl/api/opencl/amdocl/cl_profile_amd.cpp
+++ b/opencl/api/opencl/amdocl/cl_profile_amd.cpp
@@ -171,7 +171,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueBeginPerfCounterAMD,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue->context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, *hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -257,7 +257,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueEndPerfCounterAMD,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue->context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, *hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_sdi_amd.cpp b/opencl/api/opencl/amdocl/cl_sdi_amd.cpp
index f07d7da2d0..eaca193213 100644
--- a/opencl/api/opencl/amdocl/cl_sdi_amd.cpp
+++ b/opencl/api/opencl/amdocl/cl_sdi_amd.cpp
@@ -38,7 +38,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueWaitSignalAMD,
amd::Command::EventWaitList eventWaitList;
cl_int err =
- amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events, event_wait_list);
+ amd::clSetEventWaitList(eventWaitList, hostQueue, num_events, event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -107,7 +107,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueWriteSignalAMD,
amd::Command::EventWaitList eventWaitList;
cl_int err =
- amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events, event_wait_list);
+ amd::clSetEventWaitList(eventWaitList, hostQueue, num_events, event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -186,7 +186,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueMakeBuffersResidentAMD,
amd::Command::EventWaitList eventWaitList;
cl_int err =
- amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events, event_wait_list);
+ amd::clSetEventWaitList(eventWaitList, hostQueue, num_events, event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_svm.cpp b/opencl/api/opencl/amdocl/cl_svm.cpp
index a4f8847ad3..237331bba2 100644
--- a/opencl/api/opencl/amdocl/cl_svm.cpp
+++ b/opencl/api/opencl/amdocl/cl_svm.cpp
@@ -305,7 +305,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMFree,
amd::HostQueue& hostQueue = *queue;
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -431,7 +431,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMMemcpy,
amd::HostQueue& hostQueue = *queue;
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -568,7 +568,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMMemFill,
amd::HostQueue& hostQueue = *queue;
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -731,7 +731,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMMap,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -839,7 +839,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMUnmap,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -1166,7 +1166,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueSVMMigrateMem,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue.context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
diff --git a/opencl/api/opencl/amdocl/cl_thread_trace_amd.cpp b/opencl/api/opencl/amdocl/cl_thread_trace_amd.cpp
index e7cc96568f..d0f9243020 100644
--- a/opencl/api/opencl/amdocl/cl_thread_trace_amd.cpp
+++ b/opencl/api/opencl/amdocl/cl_thread_trace_amd.cpp
@@ -319,7 +319,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueThreadTraceCommandAMD,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue->context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, *hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;
@@ -481,7 +481,7 @@ RUNTIME_ENTRY(cl_int, clEnqueueBindThreadTraceBufferAMD,
}
amd::Command::EventWaitList eventWaitList;
- cl_int err = amd::clSetEventWaitList(eventWaitList, hostQueue->context(), num_events_in_wait_list,
+ cl_int err = amd::clSetEventWaitList(eventWaitList, *hostQueue, num_events_in_wait_list,
event_wait_list);
if (err != CL_SUCCESS) {
return err;