From 83baaf707e3366a4b8087a5242bbe2a30a192bf6 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 19 Aug 2014 12:49:10 -0400
Subject: [PATCH] P4 to Git Change 1067933 by gandryey@gera-dev-w7 on
2014/08/19 12:34:09
ECR #304775 - HSAIL: Direct SRD support
- Copy SRD to CB1 for image views to avoid a wait for SRD resource when image view is destroyed.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#261 edit
---
rocclr/runtime/device/gpu/gpukernel.cpp | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/rocclr/runtime/device/gpu/gpukernel.cpp b/rocclr/runtime/device/gpu/gpukernel.cpp
index 142e3d7029..cdf91b789a 100644
--- a/rocclr/runtime/device/gpu/gpukernel.cpp
+++ b/rocclr/runtime/device/gpu/gpukernel.cpp
@@ -3941,9 +3941,24 @@ HSAILKernel::loadArguments(
HSA_IMAGE_OBJECT_SIZE, HSA_IMAGE_OBJECT_ALIGNMENT);
}
else {
- uint64_t srd = image->hwSrd();
- WriteAqlArg(&aqlArgBuf, &srd, sizeof(srd));
- srdResource = true;
+ //! \note Special case for the image views.
+ //! Copy SRD to CB1, so blit manager will be able to release
+ //! this view without a wait for SRD resource.
+ if (image->memoryType() == Resource::ImageView) {
+ // Copy the current structre into CB1
+ memcpy(aqlStruct, image->hwState(), HSA_IMAGE_OBJECT_SIZE);
+ ConstBuffer* cb = gpu.constBufs_[1];
+ cb->uploadDataToHw(HSA_IMAGE_OBJECT_SIZE);
+ // Then use a pointer in aqlArgBuffer to CB1
+ uint64_t srd = cb->vmAddress() + cb->wrtOffset();
+ WriteAqlArg(&aqlArgBuf, &srd, sizeof(srd));
+ memList.push_back(cb);
+ }
+ else {
+ uint64_t srd = image->hwSrd();
+ WriteAqlArg(&aqlArgBuf, &srd, sizeof(srd));
+ srdResource = true;
+ }
}
//! @todo Compiler has to return read/write attributes