Add new interface to HwHelper

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek 2021-05-20 11:06:19 +00:00 committed by Compute-Runtime-Automation
parent a692f1ecc5
commit 1f2c31250f
3 changed files with 14 additions and 0 deletions

View File

@ -1276,6 +1276,12 @@ TEST_F(HwHelperTest, whenGettingNumberOfCacheRegionsThenReturnZero) {
EXPECT_EQ(0u, hwHelper.getNumCacheRegions(*defaultHwInfo));
}
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, whenCheckingForSmallKernelPreferenceThenFalseIsReturned) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
EXPECT_FALSE(hwHelper.preferSmallWorkgroupSizeForKernel(0u));
EXPECT_FALSE(hwHelper.preferSmallWorkgroupSizeForKernel(20000u));
}
TEST_F(HwHelperTest, givenGenHelperWhenKernelArgumentIsNotPureStatefulThenRequireNonAuxMode) {
auto &clHwHelper = ClHwHelper::get(renderCoreFamily);

View File

@ -71,6 +71,7 @@ class HwHelper {
virtual bool isFenceAllocationRequired(const HardwareInfo &hwInfo) const = 0;
virtual const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const = 0;
virtual bool hvAlign4Required() const = 0;
virtual bool preferSmallWorkgroupSizeForKernel(const size_t size) const = 0;
virtual bool isBufferSizeSuitableForRenderCompression(const size_t size) const = 0;
virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0;
virtual FrontEndType getFrontEndType(const HardwareInfo &hwInfo) const = 0;
@ -388,6 +389,8 @@ class HwHelperHw : public HwHelper {
void applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const override;
bool preferSmallWorkgroupSizeForKernel(const size_t size) const override;
protected:
LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;

View File

@ -103,6 +103,11 @@ uint64_t HwHelperHw<GfxFamily>::getGpuTimeStampInNS(uint64_t timeStamp, double f
return static_cast<uint64_t>(timeStamp * frequency);
}
template <typename GfxFamily>
inline bool HwHelperHw<GfxFamily>::preferSmallWorkgroupSizeForKernel(const size_t size) const {
return false;
}
constexpr uint32_t planarYuvMaxHeight = 16352;
template <typename GfxFamily>