[9/n] L0 immediate commandlist improvements

Add HwInfo utility for more fine-grained flush task enablement
Related-To: LOCI-1988

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2022-02-17 21:44:55 +00:00
committed by Compute-Runtime-Automation
parent 315769424d
commit 16f2fbbc37
16 changed files with 47 additions and 34 deletions

View File

@ -136,7 +136,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
}
if (this->cmdListType == CommandListType::TYPE_IMMEDIATE && !isCopyOnly() && !isInternal()) {
this->isFlushTaskSubmissionEnabled = NEO::HwHelper::get(device->getHwInfo().platform.eRenderCoreFamily).isPlatformFlushTaskEnabled();
const auto &hwInfo = device->getHwInfo();
this->isFlushTaskSubmissionEnabled = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily).isPlatformFlushTaskEnabled(hwInfo);
if (NEO::DebugManager.flags.EnableFlushTaskSubmission.get() != -1) {
this->isFlushTaskSubmissionEnabled = !!NEO::DebugManager.flags.EnableFlushTaskSubmission.get();
}

View File

@ -244,8 +244,7 @@ class CommandListImmediateFlushTaskTests : public DeviceFixture {
};
using CommandListImmediateFlushTaskComputeTests = Test<CommandListImmediateFlushTaskTests>;
using ATSOrDG2 = IsWithinGfxCore<IGFX_XE_HP_CORE, IGFX_XE_HPG_CORE>;
HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenATSOrDG2CommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled, ATSOrDG2) {
HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenDG2CommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled, IsDG2) {
ze_command_queue_desc_t queueDesc = {};
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue));

View File

@ -1422,14 +1422,19 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenGettingIfRevisionSpecificBinaryBuiltinIs
EXPECT_FALSE(hwHelper.isRevisionSpecificBinaryBuiltinRequired());
}
HWTEST2_F(HwHelperTest, givenAtsOrDg2HwHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned, ATSOrDG2) {
HWTEST2_F(HwHelperTest, givenDG2HwHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned, IsDG2) {
auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_TRUE(hwHelper.isPlatformFlushTaskEnabled());
EXPECT_TRUE(hwHelper.isPlatformFlushTaskEnabled(*defaultHwInfo));
}
HWTEST2_F(HwHelperTest, givenNotAtsOrDg2HwHelperWhenGettingIsPlatformFlushTaskEnabledThenFalseIsReturned, IsAtMostGen12lp) {
HWTEST2_F(HwHelperTest, givenPvcHwHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned, IsPVC) {
auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_FALSE(hwHelper.isPlatformFlushTaskEnabled());
EXPECT_TRUE(hwHelper.isPlatformFlushTaskEnabled(*defaultHwInfo));
}
HWTEST2_F(HwHelperTest, givenAtMostGen12lpHwHelperWhenGettingIsPlatformFlushTaskEnabledThenFalseIsReturned, IsAtMostGen12lp) {
auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_FALSE(hwHelper.isPlatformFlushTaskEnabled(*defaultHwInfo));
}
struct CoherentWANotNeeded {

View File

@ -157,7 +157,7 @@ class HwHelper {
virtual bool isLinuxCompletionFenceSupported() const = 0;
virtual size_t getBatchBufferEndSize() const = 0;
virtual const void *getBatchBufferEndReference() const = 0;
virtual bool isPlatformFlushTaskEnabled() const = 0;
virtual bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const = 0;
protected:
HwHelper() = default;
@ -396,7 +396,7 @@ class HwHelperHw : public HwHelper {
bool isLinuxCompletionFenceSupported() const override;
size_t getBatchBufferEndSize() const override;
const void *getBatchBufferEndReference() const override;
bool isPlatformFlushTaskEnabled() const override;
bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const override;
protected:
static const AuxTranslationMode defaultAuxTranslationMode;

View File

@ -719,7 +719,8 @@ const void *HwHelperHw<GfxFamily>::getBatchBufferEndReference() const {
return reinterpret_cast<const void *>(&GfxFamily::cmdInitBatchBufferEnd);
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isPlatformFlushTaskEnabled() const {
return false;
bool HwHelperHw<GfxFamily>::isPlatformFlushTaskEnabled(const HardwareInfo &hwInfo) const {
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
return hwInfoConfig.isFlushTaskAllowed();
}
} // namespace NEO

View File

@ -84,6 +84,7 @@ class HwInfoConfig {
virtual bool isDcFlushAllowed() const = 0;
virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0;
virtual bool getUuid(Device *device, std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) const = 0;
virtual bool isFlushTaskAllowed() const = 0;
MOCKABLE_VIRTUAL ~HwInfoConfig() = default;
protected:
@ -152,6 +153,7 @@ class HwInfoConfigHw : public HwInfoConfig {
bool isDcFlushAllowed() const override;
uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override;
bool getUuid(Device *device, std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) const override;
bool isFlushTaskAllowed() const override;
protected:
HwInfoConfigHw() = default;

View File

@ -287,4 +287,9 @@ template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::getUuid(Device *device, std::array<uint8_t, HwInfoConfig::uuidSize> &uuid) const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return false;
}
} // namespace NEO

View File

@ -149,11 +149,6 @@ bool HwHelperHw<Family>::disableL3CacheForDebug(const HardwareInfo &) const {
return true;
}
template <>
bool HwHelperHw<Family>::isPlatformFlushTaskEnabled() const {
return true;
}
template class HwHelperHw<Family>;
template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -76,5 +76,10 @@ uint32_t HwInfoConfigHw<gfxProduct>::getDeviceMemoryMaxClkRate(const HardwareInf
return 2800u;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return true;
}
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@ -421,11 +421,6 @@ bool HwHelperHw<Family>::isRevisionSpecificBinaryBuiltinRequired() const {
return true;
}
template <>
bool HwHelperHw<Family>::isPlatformFlushTaskEnabled() const {
return true;
}
} // namespace NEO
#include "shared/source/helpers/hw_helper_pvc_and_later.inl"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*

View File

@ -116,3 +116,8 @@ template <>
bool HwInfoConfigHw<gfxProduct>::isDcFlushAllowed() const {
return false;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return true;
}

View File

@ -114,11 +114,6 @@ inline bool HwHelperHw<Family>::isLinuxCompletionFenceSupported() const {
return true;
}
template <>
bool HwHelperHw<Family>::isPlatformFlushTaskEnabled() const {
return true;
}
template class HwHelperHw<Family>;
template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;

View File

@ -167,3 +167,8 @@ template <>
void HwInfoConfigHw<gfxProduct>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData) {
timestampData >>= 1;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return true;
}

View File

@ -277,4 +277,9 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::getUuid(Device *device, std::array<uint8_t, H
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isFlushTaskAllowed() const {
return false;
}
} //namespace NEO

View File

@ -62,9 +62,4 @@ XE_HPC_CORETEST_F(HwHelperXeHpcCoreTest, givenHwHelperWhenGettingISAPaddingThenC
XE_HPC_CORETEST_F(HwHelperXeHpcCoreTest, givenHwHelperWhenGettingIfRevisionSpecificBinaryBuiltinIsRequiredThenTrueIsReturned) {
auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_TRUE(hwHelper.isRevisionSpecificBinaryBuiltinRequired());
}
XE_HPC_CORETEST_F(HwHelperXeHpcCoreTest, givenHwHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned) {
auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_TRUE(hwHelper.isPlatformFlushTaskEnabled());
}
}