From 42ae43ee24a8bb5aeffd5ca6a5de128adf640049 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Wed, 22 Sep 2021 10:57:20 -0400 Subject: [PATCH] SWDEV-292408 - Keep tracking of subbuffers for multiple devices Change-Id: I568b5ea79614ef507cf1f0efb3dca38ab6cc2db7 [ROCm/clr commit: 6b47e50350f0c7bf0999d09009501db3194befc0] --- projects/clr/rocclr/platform/memory.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/projects/clr/rocclr/platform/memory.cpp b/projects/clr/rocclr/platform/memory.cpp index 5a42a435ed..737bffa0c4 100644 --- a/projects/clr/rocclr/platform/memory.cpp +++ b/projects/clr/rocclr/platform/memory.cpp @@ -457,12 +457,11 @@ bool Memory::setDestructorCallback(DestructorCallBackFunction callback, void* da } void Memory::signalWrite(const Device* writer) { - // Disable cache coherency layer for HIP - if (!amd::IS_HIP) { - // (the potential race condition below doesn't matter, no critical - // section needed) - ++version_; - lastWriter_ = writer; + // The potential race condition below doesn't matter, no critical section needed + ++version_; + lastWriter_ = writer; + // Keep subbuffers tracking only for multiple devices and it's not system memory + if ((numDevices() > 1) && (nullptr == getHostMem())) { // Update all subbuffers for this object for (auto buf : subBuffers_) { buf->signalWrite(writer);