Unify isTimestampWaitSupportedForEvents helper function

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>

No need to keep isTimestampWaitSupportedForEvents function
in hwHelper and in hwInfoConfig helper, move it to hwInfoConfig instead.
This commit is contained in:
Kamil Kopryk
2022-11-09 13:01:21 +00:00
committed by Compute-Runtime-Automation
parent e4d10e5460
commit c82038565e
14 changed files with 35 additions and 45 deletions

View File

@ -688,10 +688,9 @@ bool Event::isCompleted() {
}
bool Event::isWaitForTimestampsEnabled() const {
const auto &hwInfo = cmdQueue->getDevice().getHardwareInfo();
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
const auto &productHelper = cmdQueue->getDevice().getRootDeviceEnvironment().getHelper<ProductHelper>();
auto enabled = cmdQueue->isTimestampWaitEnabled();
enabled &= hwHelper.isTimestampWaitSupportedForEvents(hwInfo);
enabled &= productHelper.isTimestampWaitSupportedForEvents();
switch (DebugManager.flags.EnableTimestampWaitForEvents.get()) {
case 0:

View File

@ -1843,9 +1843,8 @@ TEST(EventTimestampTest, givenEnableTimestampWaitWhenCheckIsTimestampWaitEnabled
{
DebugManager.flags.EnableTimestampWaitForEvents.set(-1);
const auto &hwInfo = mockDevice->getHardwareInfo();
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
EXPECT_EQ(event.isWaitForTimestampsEnabled(), hwHelper.isTimestampWaitSupportedForEvents(hwInfo));
const auto &productHelper = mockDevice->getRootDeviceEnvironment().getHelper<ProductHelper>();
EXPECT_EQ(event.isWaitForTimestampsEnabled(), productHelper.isTimestampWaitSupportedForEvents());
}
{

View File

@ -60,7 +60,6 @@ class HwHelper {
static uint32_t getHighestEnabledSlice(const HardwareInfo &hwInfo);
virtual bool timestampPacketWriteSupported() const = 0;
virtual bool isTimestampWaitSupportedForQueues() const = 0;
virtual bool isTimestampWaitSupportedForEvents(const HardwareInfo &hwInfo) const = 0;
virtual bool isUpdateTaskCountFromWaitSupported() const = 0;
virtual size_t getRenderSurfaceStateSize() const = 0;
virtual void setRenderSurfaceStateForScratchResource(const RootDeviceEnvironment &rootDeviceEnvironment,
@ -222,9 +221,6 @@ class HwHelperHw : public HwHelper {
bool timestampPacketWriteSupported() const override;
bool isTimestampWaitSupportedForQueues() const override;
bool isTimestampWaitSupportedForEvents(const HardwareInfo &hwInfo) const override;
bool isUpdateTaskCountFromWaitSupported() const override;
bool is1MbAlignmentSupported(const HardwareInfo &hwInfo, bool isCompressionEnabled) const override;

View File

@ -45,11 +45,6 @@ bool HwHelperHw<GfxFamily>::isTimestampWaitSupportedForQueues() const {
return false;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isTimestampWaitSupportedForEvents(const HardwareInfo &hwInfo) const {
return false;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isUpdateTaskCountFromWaitSupported() const {
return false;

View File

@ -60,11 +60,6 @@ bool HwHelperHw<GfxFamily>::isTimestampWaitSupportedForQueues() const {
return false;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isTimestampWaitSupportedForEvents(const HardwareInfo &hwInfo) const {
return false;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isUpdateTaskCountFromWaitSupported() const {
return false;

View File

@ -406,11 +406,6 @@ bool HwHelperHw<Family>::isTimestampWaitSupportedForQueues() const {
return true;
}
template <>
bool HwHelperHw<Family>::isTimestampWaitSupportedForEvents(const HardwareInfo &hwInfo) const {
return true;
}
template <>
uint64_t HwHelperHw<Family>::getPatIndex(CacheRegion cacheRegion, CachePolicy cachePolicy) const {
/*

View File

@ -25,6 +25,11 @@ bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return true;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isTimestampWaitSupportedForEvents() const {
return true;
}
template <>
std::pair<bool, bool> HwInfoConfigHw<gfxProduct>::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs) const {
auto isBasicWARequired = false;

View File

@ -142,12 +142,6 @@ bool HwHelperHw<Family>::disableL3CacheForDebug(const HardwareInfo &hwInfo) cons
return isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo);
}
template <>
bool HwHelperHw<Family>::isTimestampWaitSupportedForEvents(const HardwareInfo &hwInfo) const {
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
return hwInfoConfig.isTimestampWaitSupportedForEvents();
}
template class HwHelperHw<Family>;
template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;

View File

@ -41,6 +41,7 @@ using IsXeHpcOrXeHpgCore = IsAnyGfxCores<IGFX_XE_HPC_CORE, IGFX_XE_HPG_CORE>;
using IsNotXeHpOrXeHpgCore = IsNotAnyGfxCores<IGFX_XE_HP_CORE, IGFX_XE_HPG_CORE>;
using IsNotXeHpOrXeHpcCore = IsNotAnyGfxCores<IGFX_XE_HP_CORE, IGFX_XE_HPC_CORE>;
using IsNotXeHpgOrXeHpcCore = IsNotAnyGfxCores<IGFX_XE_HPG_CORE, IGFX_XE_HPC_CORE>;
using IsSKL = IsProduct<IGFX_SKYLAKE>;
using IsKBL = IsProduct<IGFX_KABYLAKE>;

View File

@ -10,6 +10,7 @@
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/unified_memory/usm_memory_support.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/gtest_helpers.h"
#include "shared/test/common/helpers/mock_hw_info_config_hw.h"
@ -21,6 +22,7 @@
#include "gtest/gtest.h"
using namespace NEO;
using ProductHelperTest = Test<DeviceFixture>;
HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) {
DebugManagerStateRestore restore;
@ -405,9 +407,9 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPatIndexProgrammingSuppor
EXPECT_FALSE(hwInfoConfig.isVmBindPatIndexProgrammingSupported());
}
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfIsTimestampWaitSupportedForEventsThenFalseIsReturned, IsNotXeHpgCore) {
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
EXPECT_FALSE(hwInfoConfig.isTimestampWaitSupportedForEvents());
HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTimestampWaitSupportedForEventsThenFalseIsReturned, IsNotXeHpgOrXeHpcCore) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_FALSE(productHelper.isTimestampWaitSupportedForEvents());
}
HWTEST_F(HwInfoConfigTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) {

View File

@ -65,7 +65,13 @@ XE_HPC_CORETEST_F(HwHelperXeHpcCoreTest, givenHwHelperWhenGettingIfRevisionSpeci
XE_HPC_CORETEST_F(HwHelperXeHpcCoreTest, givenHwHelperWhenCheckTimestampWaitSupportThenReturnTrue) {
auto &helper = HwHelper::get(renderCoreFamily);
EXPECT_TRUE(helper.isTimestampWaitSupportedForQueues());
EXPECT_TRUE(helper.isTimestampWaitSupportedForEvents(*defaultHwInfo));
}
using ProductHelperTestXeHpcCore = Test<DeviceFixture>;
XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenProductHelperWhenCheckTimestampWaitSupportForEventsThenReturnTrue) {
auto &helper = getHelper<ProductHelper>();
EXPECT_TRUE(helper.isTimestampWaitSupportedForEvents());
}
XE_HPC_CORETEST_F(HwHelperXeHpcCoreTest, givenXeHPCPlatformWhenCheckAssignEngineRoundRobinSupportedThenReturnTrue) {

View File

@ -29,3 +29,4 @@ HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKe
HWTEST_EXCLUDE_PRODUCT(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy_IsAtLeastXeHpgCore, IGFX_DG2);
HWTEST_EXCLUDE_PRODUCT(XeHpgSbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBPL1CachePolicy, IGFX_DG2);
HWTEST_EXCLUDE_PRODUCT(HwHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned, IGFX_DG2);
HWTEST_EXCLUDE_PRODUCT(ProductHelperTestXeHpgCore, givenProductHelperWhenCheckTimestampWaitSupportForEventsThenReturnFalse, IGFX_DG2);

View File

@ -19,6 +19,7 @@
using namespace NEO;
using HwInfoConfigTestDg2 = Test<DeviceFixture>;
using ProductHelperTestDg2 = Test<DeviceFixture>;
DG2TEST_F(HwInfoConfigTestDg2, givenDg2ConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo = *defaultHwInfo;
@ -412,13 +413,9 @@ DG2TEST_F(HwInfoConfigTestDg2, givenNotEnabledSliceWhenComputeUnitsUsedForScratc
EXPECT_THROW(hwHelper.getComputeUnitsUsedForScratch(&hwInfo), std::exception);
}
HWTEST_EXCLUDE_PRODUCT(HwHelperTestXeHpgCore, givenHwHelperWhenCheckTimestampWaitSupportThenReturnFalse, IGFX_DG2);
DG2TEST_F(HwInfoConfigTestDg2, givenDG2WhenCheckingIsTimestampWaitSupportedForEventsThenReturnTrue) {
HardwareInfo hwInfo = *defaultHwInfo;
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
EXPECT_TRUE(hwInfoConfig.isTimestampWaitSupportedForEvents());
EXPECT_TRUE(hwHelper.isTimestampWaitSupportedForEvents(hwInfo));
DG2TEST_F(ProductHelperTestDg2, givenDG2WhenCheckingIsTimestampWaitSupportedForEventsThenReturnTrue) {
auto &helper = getHelper<ProductHelper>();
EXPECT_TRUE(helper.isTimestampWaitSupportedForEvents());
}
DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdsWhenConfigIsCheckedThenCorrectValueIsReturned) {

View File

@ -18,6 +18,7 @@
#include "hw_cmds_xe_hpg_core_base.h"
using HwHelperTestXeHpgCore = HwHelperTest;
using ProductHelperTestXeHpgCore = Test<DeviceFixture>;
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForCompression) {
DebugManagerStateRestore restore;
@ -154,10 +155,14 @@ XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenXeHPAndLaterPlatformWhenCheckAssig
EXPECT_FALSE(hwHelper.isAssignEngineRoundRobinSupported(*defaultHwInfo));
}
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenHwHelperWhenCheckTimestampWaitSupportThenReturnFalse) {
auto &helper = HwHelper::get(renderCoreFamily);
XE_HPG_CORETEST_F(ProductHelperTestXeHpgCore, givenProductHelperWhenCheckTimestampWaitSupportForEventsThenReturnFalse) {
auto &helper = getHelper<ProductHelper>();
EXPECT_FALSE(helper.isTimestampWaitSupportedForEvents());
}
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenCoreHelperWhenCheckTimestampWaitSupportForQueuesThenReturnFalse) {
auto &helper = getHelper<CoreHelper>();
EXPECT_FALSE(helper.isTimestampWaitSupportedForQueues());
EXPECT_FALSE(helper.isTimestampWaitSupportedForEvents(*defaultHwInfo));
}
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenDisablePipeControlFlagIsEnabledWhenLocalMemoryIsEnabledThenReturnTrueAndProgramPipeControl) {