From 95962bac8a92fd9dd58e3cd5bdb5c4fb14f7caae Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 7 Jul 2015 14:34:52 -0400
Subject: [PATCH] P4 to Git Change 1168292 by gandryey@gera-w8 on 2015/07/07
14:29:14
ECR #304775 - Fix a crash in memorybandwidth test
- Remove a pinned mem object from the list only if we need a free slot.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#367 edit
[ROCm/clr commit: 75b23216083fbb51c4f8b1202331c2011cddd8a5]
---
projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
index f6bdb1e413..13f8d8495a 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
@@ -239,12 +239,12 @@ VirtualGPU::releaseXferWrite()
void
VirtualGPU::addPinnedMem(amd::Memory* mem)
{
- if (pinnedMems_.size() > 7) {
- pinnedMems_.front()->release();
- pinnedMems_.pop_front();
- }
-
if (NULL == findPinnedMem(mem->getHostMem(), mem->getSize())) {
+ if (pinnedMems_.size() > 7) {
+ pinnedMems_.front()->release();
+ pinnedMems_.pop_front();
+ }
+
// Start operation, since we should release mem object
flushDMA(getGpuEvent(dev().getGpuMemory(mem))->engineId_);