From b8e2fcd0319bcd855b7e9d79643187c57ebb35f1 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 22 Jan 2015 18:39:40 -0500
Subject: [PATCH] P4 to Git Change 1114490 by gandryey@gera-dev-w7 on
2015/01/22 18:28:21
EPR #410560 - Forum: [169727] Bug? CL_MEM_COPY_HOST_PTR is not thread safe
- Regression on Trinity. Add scratch unbind. On Trinity blit kernels may use scratch.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#348 edit
[ROCm/clr commit: 1c3b32fef24d67a4cae7ca7276a5f2808575cee5]
---
projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
index f4e656413e..2dc6337196 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
@@ -2915,6 +2915,17 @@ VirtualGPU::releaseMemObjects()
if (numGrpCb_ != NULL) {
setConstantBuffer(SC_INFO_CONSTANTBUFFER, NULL, 0, 0);
}
+
+ if ((dev().scratch(hwRing()) != NULL) &&
+ (dev().scratch(hwRing())->regNum_ > 0)) {
+ // Unbind scratch memory
+ const std::vector& mems = dev().scratch(hwRing())->memObjs_;
+ for (uint i = 0; i < mems.size(); ++i) {
+ if (mems[i] != NULL) {
+ setScratchBuffer(NULL, i);
+ }
+ }
+ }
gpuEvents_.clear();
}