From 88d379f5e5adf88729e0f798b0b2124d7ff3873b Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Mon, 3 Nov 2025 07:45:40 +0000 Subject: [PATCH] performance: enable timestamp caching on OCL Related-To: NEO-14360 Signed-off-by: Lukasz Jobczyk --- .../os_interface/product_helper_xe2_and_later.inl | 2 +- .../helpers/gfx_core_helper_xe2_and_later.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/shared/source/os_interface/product_helper_xe2_and_later.inl b/shared/source/os_interface/product_helper_xe2_and_later.inl index 3c6a2c367a..6892389297 100644 --- a/shared/source/os_interface/product_helper_xe2_and_later.inl +++ b/shared/source/os_interface/product_helper_xe2_and_later.inl @@ -59,7 +59,7 @@ bool ProductHelperHw::isNonCoherentTimestampsModeEnabled() const { if (debugManager.flags.ForceNonCoherentModeForTimestamps.get() != -1) { return debugManager.flags.ForceNonCoherentModeForTimestamps.get(); } - return !this->isDcFlushAllowed(); + return !this->isDcFlushAllowed() || (ApiSpecificConfig::OCL == ApiSpecificConfig::getApiType()); } template diff --git a/shared/test/unit_test/helpers/gfx_core_helper_xe2_and_later.cpp b/shared/test/unit_test/helpers/gfx_core_helper_xe2_and_later.cpp index 26548d3de8..ca9e9659c7 100644 --- a/shared/test/unit_test/helpers/gfx_core_helper_xe2_and_later.cpp +++ b/shared/test/unit_test/helpers/gfx_core_helper_xe2_and_later.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/api_specific_config.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/register_offsets.h" #include "shared/test/common/cmd_parse/hw_parse.h" @@ -17,6 +18,9 @@ #include "shared/test/common/mocks/mock_gmm_resource_info.h" #include "shared/test/common/test_macros/hw_test.h" +namespace NEO { +extern ApiSpecificConfig::ApiType apiTypeForUlts; +} using namespace NEO; using GfxCoreHelperXe2AndLaterTests = ::testing::Test; @@ -31,7 +35,14 @@ HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenCallIsNonCoherent MockExecutionEnvironment mockExecutionEnvironment{}; auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - EXPECT_EQ(!productHelper.isDcFlushAllowed(), productHelper.isNonCoherentTimestampsModeEnabled()); + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL); + EXPECT_TRUE(productHelper.isNonCoherentTimestampsModeEnabled()); + } + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); + EXPECT_EQ(!productHelper.isDcFlushAllowed(), productHelper.isNonCoherentTimestampsModeEnabled()); + } } HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenDebugFlagWhenCheckingIsResolveDependenciesByPipeControlsSupportedThenCorrectValueIsReturned, IsLNL) {