Rename compression flags and helpers

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-12-03 13:52:16 +00:00
committed by Compute-Runtime-Automation
parent 5c266f9ab0
commit 68aea5bf62
68 changed files with 257 additions and 256 deletions

View File

@@ -30,7 +30,7 @@ class ClHwHelper {
virtual bool requiresNonAuxMode(const ArgDescPointer &argAsPtr, const HardwareInfo &hwInfo) const = 0;
virtual bool requiresAuxResolves(const KernelInfo &kernelInfo, const HardwareInfo &hwInfo) const = 0;
virtual bool allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const = 0;
virtual bool allowCompressionForContext(const ClDevice &clDevice, const Context &context) const = 0;
virtual cl_command_queue_capabilities_intel getAdditionalDisabledQueueFamilyCapabilities(EngineGroupType type) const = 0;
virtual bool getQueueFamilyName(std::string &name, EngineGroupType type) const = 0;
virtual cl_ulong getKernelPrivateMemSize(const KernelInfo &kernelInfo) const = 0;
@@ -61,7 +61,7 @@ class ClHwHelperHw : public ClHwHelper {
bool requiresNonAuxMode(const ArgDescPointer &argAsPtr, const HardwareInfo &hwInfo) const override;
bool requiresAuxResolves(const KernelInfo &kernelInfo, const HardwareInfo &hwInfo) const override;
bool allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const override;
bool allowCompressionForContext(const ClDevice &clDevice, const Context &context) const override;
cl_command_queue_capabilities_intel getAdditionalDisabledQueueFamilyCapabilities(EngineGroupType type) const override;
bool getQueueFamilyName(std::string &name, EngineGroupType type) const override;
cl_ulong getKernelPrivateMemSize(const KernelInfo &kernelInfo) const override;

View File

@@ -34,7 +34,7 @@ inline bool ClHwHelperHw<GfxFamily>::hasStatelessAccessToBuffer(const KernelInfo
}
template <typename GfxFamily>
inline bool ClHwHelperHw<GfxFamily>::allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const {
inline bool ClHwHelperHw<GfxFamily>::allowCompressionForContext(const ClDevice &clDevice, const Context &context) const {
return true;
}

View File

@@ -254,7 +254,7 @@ cl_int Kernel::initialize() {
auto &clHwHelper = ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
auxTranslationRequired = !program->getIsBuiltIn() && HwHelper::renderCompressedBuffersSupported(hwInfo) && clHwHelper.requiresAuxResolves(kernelInfo, hwInfo);
auxTranslationRequired = !program->getIsBuiltIn() && HwHelper::compressedBuffersSupported(hwInfo) && clHwHelper.requiresAuxResolves(kernelInfo, hwInfo);
if (DebugManager.flags.ForceAuxTranslationEnabled.get() != -1) {
auxTranslationRequired &= !!DebugManager.flags.ForceAuxTranslationEnabled.get();

View File

@@ -187,8 +187,8 @@ Buffer *Buffer::create(Context *context,
auto hwInfo = (&memoryManager->peekExecutionEnvironment())->rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(HwHelper::renderCompressedBuffersSupported(*hwInfo), memoryProperties, *context,
HwHelper::get(hwInfo->platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size, *hwInfo));
bool compressionEnabled = MemObjHelper::isSuitableForCompression(HwHelper::compressedBuffersSupported(*hwInfo), memoryProperties, *context,
HwHelper::get(hwInfo->platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(size, *hwInfo));
allocationInfo[rootDeviceIndex].allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, *context, compressionEnabled,
memoryManager->isLocalMemorySupported(rootDeviceIndex));
@@ -776,7 +776,7 @@ void Buffer::setSurfaceState(const Device *device,
}
void Buffer::provideCompressionHint(bool compressionEnabled, Context *context, Buffer *buffer) {
if (context->isProvidingPerformanceHints() && HwHelper::renderCompressedBuffersSupported(context->getDevice(0)->getHardwareInfo())) {
if (context->isProvidingPerformanceHints() && HwHelper::compressedBuffersSupported(context->getDevice(0)->getHardwareInfo())) {
if (compressionEnabled) {
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, BUFFER_IS_COMPRESSED, buffer);
} else {

View File

@@ -200,8 +200,8 @@ Image *Image::create(Context *context,
auto &clHwHelper = ClHwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily);
imgInfo.linearStorage = !defaultHwHelper.tilingAllowed(context->isSharedContext, Image::isImage1d(*imageDesc),
memoryProperties.flags.forceLinearStorage);
bool preferCompression = MemObjHelper::isSuitableForRenderCompression(!imgInfo.linearStorage, memoryProperties,
*context, true);
bool preferCompression = MemObjHelper::isSuitableForCompression(!imgInfo.linearStorage, memoryProperties,
*context, true);
preferCompression &= clHwHelper.allowImageCompression(surfaceFormat->OCLImageFormat);
preferCompression &= !clHwHelper.isFormatRedescribable(surfaceFormat->OCLImageFormat);
@@ -386,7 +386,7 @@ Image *Image::create(Context *context,
auto &hwInfo = *memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
if (context->isProvidingPerformanceHints() && HwHelper::renderCompressedImagesSupported(hwInfo)) {
if (context->isProvidingPerformanceHints() && HwHelper::compressedImagesSupported(hwInfo)) {
if (allocationInfo[rootDeviceIndex].memory->isCompressionEnabled()) {
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, IMAGE_IS_COMPRESSED, image);
} else {

View File

@@ -101,8 +101,8 @@ SVMAllocsManager::SvmAllocationProperties MemObjHelper::getSvmAllocationProperti
return svmProperties;
}
bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressedBuffers, const MemoryProperties &properties, Context &context, bool preferCompression) {
if (!renderCompressedBuffers) {
bool MemObjHelper::isSuitableForCompression(bool compressionSupported, const MemoryProperties &properties, Context &context, bool preferCompression) {
if (!compressionSupported) {
return false;
}
if (context.getRootDeviceIndices().size() > 1u) {
@@ -112,7 +112,7 @@ bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressedBuffers,
auto rootDeviceIndex = pClDevice->getRootDeviceIndex();
auto &hwInfo = pClDevice->getHardwareInfo();
auto &clHwHelper = ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (!clHwHelper.allowRenderCompressionForContext(*pClDevice, context)) {
if (!clHwHelper.allowCompressionForContext(*pClDevice, context)) {
return false;
}

View File

@@ -38,8 +38,8 @@ class MemObjHelper {
const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty);
static bool checkMemFlagsForSubBuffer(cl_mem_flags flags);
static SVMAllocsManager::SvmAllocationProperties getSvmAllocationProperties(cl_mem_flags flags);
static bool isSuitableForRenderCompression(bool renderCompressed, const MemoryProperties &properties, Context &context,
bool preferCompression);
static bool isSuitableForCompression(bool compressionSupported, const MemoryProperties &properties, Context &context,
bool preferCompression);
protected:
static bool validateExtraMemoryProperties(const MemoryProperties &memoryProperties, cl_mem_flags flags,

View File

@@ -9,7 +9,7 @@
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
switch (properties.allocationType) {
case GraphicsAllocation::AllocationType::GLOBAL_SURFACE:
case GraphicsAllocation::AllocationType::CONSTANT_SURFACE:

View File

@@ -45,7 +45,7 @@ bool ClHwHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo, con
}
template <>
inline bool ClHwHelperHw<Family>::allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const {
inline bool ClHwHelperHw<Family>::allowCompressionForContext(const ClDevice &clDevice, const Context &context) const {
auto rootDeviceIndex = clDevice.getRootDeviceIndex();
auto &hwInfo = clDevice.getHardwareInfo();
if (context.containsMultipleSubDevices(rootDeviceIndex) && HwHelperHw<Family>::get().isWorkaroundRequired(REVISION_A0, REVISION_A1, hwInfo)) {