From a71f7f931e3f53a1e9072a71a8395ff3e9e46ea0 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Thu, 1 Apr 2021 15:19:03 -0400 Subject: [PATCH] SWDEV-279288 - Avoid profiling info for the sync barrier - With direct disaptch profiling state is enabled to trigger the callback on HSA signal. However ROCr has very low peformance on the first call to get the profiling info. That impacts some tiny performance tests. Change-Id: Idacd1b10a473fcfb5feef3074b7191d35743f769 --- rocclr/device/rocm/rocvirtual.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index 00aa67fafd..d0af23d012 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -110,7 +110,10 @@ static unsigned extractAqlBits(unsigned v, unsigned pos, unsigned width) { // ================================================================================================ void Timestamp::checkGpuTime() { - if (HwProfiling()) { + if (HwProfiling() && + // Avoid profiling data for the sync barrier, in tiny performance tests the first call + // to ROCr is very slow and that also affects the overall performance of the callback thread + (command().GetBatchHead() == nullptr)) { uint64_t start = std::numeric_limits::max(); uint64_t end = 0;