From 626cca32134130a01e7d0842adf5cea014923ec0 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Tue, 18 Feb 2020 17:49:26 -0500 Subject: [PATCH] SWDEV-79445 OCL generic changes and code clean-up Remove a workaround to CS_PARTIAL_FLUSH added in CL#1495187, since PAL is no longer uses CS_PARTIAL_FLUSH. Change-Id: I03edc7595459e19aad33b2b0901f0ebe4754d310 [ROCm/clr commit: 1d25343af8f9220f94a133f04a09bb853a7e22ac] --- projects/clr/rocclr/device/pal/paltimestamp.cpp | 6 +++--- projects/clr/rocclr/device/pal/palvirtual.cpp | 13 +++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/projects/clr/rocclr/device/pal/paltimestamp.cpp b/projects/clr/rocclr/device/pal/paltimestamp.cpp index ef091d3e24..e9726afcc1 100644 --- a/projects/clr/rocclr/device/pal/paltimestamp.cpp +++ b/projects/clr/rocclr/device/pal/paltimestamp.cpp @@ -17,7 +17,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + #include "os/os.hpp" #include "platform/perfctr.hpp" #include "device/pal/paldefs.hpp" @@ -36,7 +36,7 @@ TimeStamp::~TimeStamp() {} void TimeStamp::begin() { if (!flags_.beginIssued_) { - gpu().iCmd()->CmdWriteTimestamp(Pal::HwPipePoint::HwPipeTop, *iMem_, + gpu().iCmd()->CmdWriteTimestamp(Pal::HwPipePoint::HwPipeBottom, *iMem_, memOffset_ + CommandStartTime * sizeof(uint64_t)); flags_.beginIssued_ = true; } @@ -44,7 +44,7 @@ void TimeStamp::begin() { void TimeStamp::end() { CondLog(!flags_.beginIssued_, "We didn't issue a begin operation!"); - gpu().iCmd()->CmdWriteTimestamp(Pal::HwPipePoint::HwPipeTop, *iMem_, + gpu().iCmd()->CmdWriteTimestamp(Pal::HwPipePoint::HwPipeBottom, *iMem_, memOffset_ + CommandEndTime * sizeof(uint64_t)); flags_.endIssued_ = true; } diff --git a/projects/clr/rocclr/device/pal/palvirtual.cpp b/projects/clr/rocclr/device/pal/palvirtual.cpp index 53dc7e52d7..43ef2c9333 100644 --- a/projects/clr/rocclr/device/pal/palvirtual.cpp +++ b/projects/clr/rocclr/device/pal/palvirtual.cpp @@ -588,9 +588,8 @@ void VirtualGPU::MemoryDependency::validate(VirtualGPU& gpu, const Memory* memor if (flushL1Cache) { // Flush cache - if (!gpu.profiling()) { - gpu.addBarrier(RgpSqqtBarrierReason::MemDependency); - } + gpu.addBarrier(RgpSqqtBarrierReason::MemDependency); + // Clear memory dependency state const static bool All = true; clear(!All); @@ -2514,13 +2513,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const // Run AQL dispatch in HW eventBegin(MainEngine); iCmd()->CmdDispatchAql(dispatchParam); - // Note: This a workaround for incorrect results reported with release_mem packet, - // when the packet can be processed later after this dispatch and including extra time - if (profiling() || state_.profileEnabled_) { - addBarrier(RgpSqqtBarrierReason::ProfilingControl); - // Clear memory dependency to avoid the second L1 invalidation - memoryDependency().clear(); - } + if (id != gpuEvent.id_) { LogError("Something is wrong. ID mismatch!\n"); }