From 59b9cd758e60a4e371b37001275f1a166a6f60f4 Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 30 Oct 2014 13:11:11 -0400
Subject: [PATCH] P4 to Git Change 1092261 by gandryey@gera-dev-w7 on
2014/10/30 13:01:38
ECR #304775 - Align the queue size to match the multidispatch scheduler requirements
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#337 edit
[ROCm/clr commit: 7cac96b9a5d5bbe169af31c01f2fb3b3a06c758b]
---
projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
index 74924c242f..b2426250a9 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuvirtual.cpp
@@ -264,6 +264,12 @@ VirtualGPU::releasePinnedMem()
bool
VirtualGPU::createVirtualQueue(uint deviceQueueSize)
{
+ uint MinDeviceQueueSize = 16 * 1024;
+ deviceQueueSize = std::max(deviceQueueSize, MinDeviceQueueSize);
+ // Align the queue size for the multiple dispatch scheduler.
+ // Each thread works with 32 entries
+ deviceQueueSize = amd::alignUp(deviceQueueSize, sizeof(AmdAqlWrap) * 32);
+
if (deviceQueueSize_ == deviceQueueSize) {
return true;
}
@@ -281,19 +287,18 @@ VirtualGPU::createVirtualQueue(uint deviceQueueSize)
schedParamIdx_ = 0;
deviceQueueSize_ = 0;
}
-
uint numSlots = deviceQueueSize / sizeof(AmdAqlWrap);
uint allocSize = deviceQueueSize;
// Add the virtual queue header
allocSize += sizeof(AmdVQueueHeader);
- allocSize = amd::alignUp(allocSize, 128);
+ allocSize = amd::alignUp(allocSize, sizeof(AmdAqlWrap));
uint argOffs = allocSize;
// Add the kernel arguments and wait events
uint singleArgSize = amd::alignUp(dev().info().maxParameterSize_ + 64 +
- dev().settings().numWaitEvents_ * sizeof(uint64_t), 128);
+ dev().settings().numWaitEvents_ * sizeof(uint64_t), sizeof(AmdAqlWrap));
allocSize += singleArgSize * numSlots;
uint eventsOffs = allocSize;