From 1a5a90160ac0d046f0f63f269bcbcd31dacdcd4e Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 12 Oct 2016 18:27:35 -0400
Subject: [PATCH] P4 to Git Change 1325741 by cpaquot@hog-ocl on 2016/10/12
18:18:44
SWDEV-102937, SWDEV-103130 - Set agent acquire fence all the time in dispatch
Misunderstanding of fence acquire and release: The fence release doesn't mean another dispatch will wait. So we need to set the acquire in the dispatch kernel even if we insert a barrier packet to try to sync.
We could try to fix this by including the memory tracking to all the image/buffer operations provided by OpenCL (ReadImage, WriteImage, etc.) but that's a much bigger change and not what it's in place right now at all.
ReviewBoardURL = http://ocltc.amd.com/reviews/r/11508/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#15 edit
[ROCm/clr commit: da9d770820921a39c1ac554e7d8de69836c56724]
---
projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
index f657e24207..663ea208f8 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
@@ -47,7 +47,7 @@ namespace roc {
static const uint16_t kDispatchPacketHeaderNoSync =
(HSA_PACKET_TYPE_KERNEL_DISPATCH << HSA_PACKET_HEADER_TYPE) |
- (HSA_FENCE_SCOPE_NONE << HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE) |
+ (HSA_FENCE_SCOPE_AGENT << HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE) |
(HSA_FENCE_SCOPE_NONE << HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE);
static const uint16_t kDispatchPacketHeader =