Move allowStatelessCompression from HwHelper to HwInfoConfig

Signed-off-by: Rafal Maziejuk <rafal.maziejuk@intel.com>
Related-To: NEO-4541
This commit is contained in:
Rafal Maziejuk
2021-09-08 15:07:46 +00:00
committed by Compute-Runtime-Automation
parent 09e8bc4eda
commit bbfbf19a02
19 changed files with 121 additions and 109 deletions

View File

@@ -7,6 +7,7 @@
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
@@ -27,8 +28,8 @@ void HwHelperHw<Family>::setExtraAllocationData(AllocationData &allocationData,
}
}
auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (helper.allowStatelessCompression(hwInfo)) {
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (hwInfoConfig.allowStatelessCompression(hwInfo)) {
if (properties.allocationType == GraphicsAllocation::AllocationType::GLOBAL_SURFACE ||
properties.allocationType == GraphicsAllocation::AllocationType::CONSTANT_SURFACE ||
properties.allocationType == GraphicsAllocation::AllocationType::PRINTF_SURFACE) {

View File

@@ -67,7 +67,6 @@ class HwHelper {
virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0;
virtual bool isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const = 0;
virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0;
virtual bool allowStatelessCompression(const HardwareInfo &hwInfo) const = 0;
virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0;
virtual LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0;
static bool renderCompressedBuffersSupported(const HardwareInfo &hwInfo);
@@ -312,8 +311,6 @@ class HwHelperHw : public HwHelper {
void setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const HardwareInfo &hwInfo) const override;
bool allowStatelessCompression(const HardwareInfo &hwInfo) const override;
bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const override;
LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;

View File

@@ -413,14 +413,6 @@ inline bool HwHelperHw<GfxFamily>::isSpecialWorkgroupSizeRequired(const Hardware
return false;
}
template <typename GfxFamily>
inline bool HwHelperHw<GfxFamily>::allowStatelessCompression(const HardwareInfo &hwInfo) const {
if (DebugManager.flags.EnableStatelessCompression.get() != -1) {
return static_cast<bool>(DebugManager.flags.EnableStatelessCompression.get());
}
return false;
}
template <typename GfxFamily>
inline bool HwHelperHw<GfxFamily>::isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const {
return allocation.isAllocatedInLocalMemoryPool() &&