diff --git a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp index 3c134d8f21..c9b2f33899 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp @@ -156,6 +156,18 @@ HWTEST_F(TimestampPacketTests, givenDebugModeWhereAtomicsAreNotEmittedWhenComman EXPECT_FALSE(tag.isCompleted()); } +HWTEST_F(TimestampPacketTests, givenDebugModeWhereAtomicsAreNotEmittedWhenInitializingTagThenDontResetDependenciesCount) { + DebugManagerStateRestore restorer; + DebugManager.flags.DisableAtomicForPostSyncs.set(true); + + TimestampPacketStorage tag; + + tag.incImplicitDependenciesCount(); + auto currentValue = tag.implicitDependenciesCount.load(); + tag.initialize(); + EXPECT_EQ(currentValue, tag.implicitDependenciesCount.load()); +} + HWTEST_F(TimestampPacketTests, givenTagNodeWithPacketsUsed2WhenSemaphoreAndAtomicAreProgrammedThenUseGpuAddress) { using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT; using MI_ATOMIC = typename FamilyType::MI_ATOMIC; diff --git a/shared/source/helpers/timestamp_packet.h b/shared/source/helpers/timestamp_packet.h index 9ee9f51c8e..00d546c843 100644 --- a/shared/source/helpers/timestamp_packet.h +++ b/shared/source/helpers/timestamp_packet.h @@ -64,8 +64,11 @@ struct TimestampPacketStorage { packet.contextEnd = 1u; packet.globalEnd = 1u; } - implicitDependenciesCount.store(0); packetsUsed = 1; + + if (!DebugManager.flags.DisableAtomicForPostSyncs.get()) { + implicitDependenciesCount.store(0); + } } void incImplicitDependenciesCount() { implicitDependenciesCount++; }