Refactor: reduce global productHelper getter usage

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-01-04 09:45:07 +00:00
committed by Compute-Runtime-Automation
parent fca4fbb0c0
commit 0dbf92d401
59 changed files with 191 additions and 186 deletions

View File

@@ -962,7 +962,7 @@ bool ContextImp::isAllocationSuitableForCompression(const StructuresLookupTable
auto &gfxCoreHelper = device.getGfxCoreHelper(); auto &gfxCoreHelper = device.getGfxCoreHelper();
auto &l0GfxCoreHelper = device.getNEODevice()->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>(); auto &l0GfxCoreHelper = device.getNEODevice()->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
if (!l0GfxCoreHelper.usmCompressionSupported(hwInfo) || !gfxCoreHelper.isBufferSizeSuitableForCompression(allocSize, hwInfo) || structuresLookupTable.uncompressedHint) { if (!l0GfxCoreHelper.usmCompressionSupported(hwInfo) || !gfxCoreHelper.isBufferSizeSuitableForCompression(allocSize) || structuresLookupTable.uncompressedHint) {
return false; return false;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -11,7 +11,7 @@
#include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/graphics_allocation.h"
namespace NEO { namespace NEO {
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) { bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
bool preferredCompression = false; bool preferredCompression = false;
int32_t compressionEnabled = DebugManager.flags.EnableUsmCompression.get(); int32_t compressionEnabled = DebugManager.flags.EnableUsmCompression.get();
if (compressionEnabled == 1) { if (compressionEnabled == 1) {

View File

@@ -1235,11 +1235,6 @@ TEST_F(DeviceTest, givenCallToDevicePropertiesThenMaximumMemoryToBeAllocatedIsCo
EXPECT_EQ(deviceProperties.maxMemAllocSize, expectedSize); EXPECT_EQ(deviceProperties.maxMemAllocSize, expectedSize);
} }
TEST_F(DeviceTest, whenCheckingIfStatelessCompressionIsSupportedThenReturnFalse) {
auto &productHelper = device->getProductHelper();
EXPECT_FALSE(productHelper.allowStatelessCompression(*defaultHwInfo));
}
TEST_F(DeviceTest, givenNodeOrdinalFlagWhenCallAdjustCommandQueueDescThenDescOrdinalProperlySet) { TEST_F(DeviceTest, givenNodeOrdinalFlagWhenCallAdjustCommandQueueDescThenDescOrdinalProperlySet) {
DebugManagerStateRestore restore; DebugManagerStateRestore restore;
auto nodeOrdinal = EngineHelpers::remapEngineTypeToHwSpecific(aub_stream::EngineType::ENGINE_RCS, neoDevice->getRootDeviceEnvironment()); auto nodeOrdinal = EngineHelpers::remapEngineTypeToHwSpecific(aub_stream::EngineType::ENGINE_RCS, neoDevice->getRootDeviceEnvironment());

View File

@@ -368,7 +368,7 @@ HWTEST2_F(CompressionMemoryTest, givenDeviceUsmWhenAllocatingThenEnableCompressi
auto allocation = allocDeviceMem(2048); auto allocation = allocDeviceMem(2048);
EXPECT_EQ(gfxCoreHelper.isBufferSizeSuitableForCompression(2048, hwInfo), allocation->isCompressionEnabled()); EXPECT_EQ(gfxCoreHelper.isBufferSizeSuitableForCompression(2048), allocation->isCompressionEnabled());
context->freeMem(ptr); context->freeMem(ptr);
@@ -455,7 +455,7 @@ HWTEST2_F(CompressionMemoryTest, givenDeviceUsmWhenAllocatingThenEnableCompressi
auto allocation = allocDeviceMem(1); auto allocation = allocDeviceMem(1);
if (!gfxCoreHelper.isBufferSizeSuitableForCompression(1, hwInfo)) { if (!gfxCoreHelper.isBufferSizeSuitableForCompression(1)) {
EXPECT_FALSE(allocation->isCompressionEnabled()); EXPECT_FALSE(allocation->isCompressionEnabled());
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -21,7 +21,7 @@ TEST(CompressionSelectorL0Tests, GivenDefaultDebugFlagWhenProvidingUsmAllocation
deviceBitfield); deviceBitfield);
properties.flags.isUSMDeviceAllocation = 1u; properties.flags.isUSMDeviceAllocation = 1u;
EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) { TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) {
@@ -34,7 +34,7 @@ TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocatio
deviceBitfield); deviceBitfield);
properties.flags.isUSMDeviceAllocation = 1u; properties.flags.isUSMDeviceAllocation = 1u;
EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionEnabled) { TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionEnabled) {
@@ -47,7 +47,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocation
deviceBitfield); deviceBitfield);
properties.flags.isUSMDeviceAllocation = 1u; properties.flags.isUSMDeviceAllocation = 1u;
EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocationThenExpectCompressionEnabled) { TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocationThenExpectCompressionEnabled) {
@@ -59,7 +59,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocat
AllocationType::SVM_GPU, AllocationType::SVM_GPU,
deviceBitfield); deviceBitfield);
EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocationThenExpectCompressionDisabled) { TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocationThenExpectCompressionDisabled) {
@@ -71,7 +71,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocati
AllocationType::BUFFER_HOST_MEMORY, AllocationType::BUFFER_HOST_MEMORY,
deviceBitfield); deviceBitfield);
EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
} // namespace ult } // namespace ult

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -282,9 +282,8 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName,
break; break;
} }
case CL_DEVICE_FEATURE_CAPABILITIES_INTEL: { case CL_DEVICE_FEATURE_CAPABILITIES_INTEL: {
auto &hwInfo = getHardwareInfo();
auto &clGfxCoreHelper = this->getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = this->getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>();
param.bitfield = clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(hwInfo); param.bitfield = clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(this->getRootDeviceEnvironment());
src = &param.bitfield; src = &param.bitfield;
retSize = srcSize = sizeof(cl_device_feature_capabilities_intel); retSize = srcSize = sizeof(cl_device_feature_capabilities_intel);
break; break;

View File

@@ -786,7 +786,7 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
} }
} }
auto memoryCompressionState = getGpgpuCommandStreamReceiver().getMemoryCompressionState(auxTranslationRequired, device->getHardwareInfo()); auto memoryCompressionState = getGpgpuCommandStreamReceiver().getMemoryCompressionState(auxTranslationRequired);
DispatchFlags dispatchFlags( DispatchFlags dispatchFlags(
{}, // csrDependencies {}, // csrDependencies

View File

@@ -24,7 +24,7 @@ void populateFactoryTable<ClGfxCoreHelperHw<Family>>() {
} }
template <> template <>
cl_device_feature_capabilities_intel ClGfxCoreHelperHw<Family>::getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const { cl_device_feature_capabilities_intel ClGfxCoreHelperHw<Family>::getSupportedDeviceFeatureCapabilities(const RootDeviceEnvironment &rootDeviceEnvironment) const {
return CL_DEVICE_FEATURE_FLAG_DP4A_INTEL; return CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -30,8 +30,8 @@ class ClGfxCoreHelper {
public: public:
static ClGfxCoreHelper &get(GFXCORE_FAMILY gfxCore); static ClGfxCoreHelper &get(GFXCORE_FAMILY gfxCore);
virtual bool requiresNonAuxMode(const ArgDescPointer &argAsPtr, const RootDeviceEnvironment &rootDeviceEnvironment) const = 0; virtual bool requiresNonAuxMode(const ArgDescPointer &argAsPtr) const = 0;
virtual bool requiresAuxResolves(const KernelInfo &kernelInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const = 0; virtual bool requiresAuxResolves(const KernelInfo &kernelInfo) const = 0;
virtual bool allowCompressionForContext(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 cl_command_queue_capabilities_intel getAdditionalDisabledQueueFamilyCapabilities(EngineGroupType type) const = 0;
virtual bool getQueueFamilyName(std::string &name, EngineGroupType type) const = 0; virtual bool getQueueFamilyName(std::string &name, EngineGroupType type) const = 0;
@@ -40,7 +40,7 @@ class ClGfxCoreHelper {
virtual bool isSupportedKernelThreadArbitrationPolicy() const = 0; virtual bool isSupportedKernelThreadArbitrationPolicy() const = 0;
virtual std::vector<uint32_t> getSupportedThreadArbitrationPolicies() const = 0; virtual std::vector<uint32_t> getSupportedThreadArbitrationPolicies() const = 0;
virtual cl_version getDeviceIpVersion(const HardwareInfo &hwInfo) const = 0; virtual cl_version getDeviceIpVersion(const HardwareInfo &hwInfo) const = 0;
virtual cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const = 0; virtual cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
virtual bool allowImageCompression(cl_image_format format) const = 0; virtual bool allowImageCompression(cl_image_format format) const = 0;
virtual bool isFormatRedescribable(cl_image_format format) const = 0; virtual bool isFormatRedescribable(cl_image_format format) const = 0;
@@ -61,8 +61,8 @@ class ClGfxCoreHelperHw : public ClGfxCoreHelper {
return clGfxCoreHelper; return clGfxCoreHelper;
} }
bool requiresNonAuxMode(const ArgDescPointer &argAsPtr, const RootDeviceEnvironment &rootDeviceEnvironment) const override; bool requiresNonAuxMode(const ArgDescPointer &argAsPtr) const override;
bool requiresAuxResolves(const KernelInfo &kernelInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const override; bool requiresAuxResolves(const KernelInfo &kernelInfo) const override;
bool allowCompressionForContext(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; cl_command_queue_capabilities_intel getAdditionalDisabledQueueFamilyCapabilities(EngineGroupType type) const override;
bool getQueueFamilyName(std::string &name, EngineGroupType type) const override; bool getQueueFamilyName(std::string &name, EngineGroupType type) const override;
@@ -71,7 +71,7 @@ class ClGfxCoreHelperHw : public ClGfxCoreHelper {
bool isSupportedKernelThreadArbitrationPolicy() const override; bool isSupportedKernelThreadArbitrationPolicy() const override;
std::vector<uint32_t> getSupportedThreadArbitrationPolicies() const override; std::vector<uint32_t> getSupportedThreadArbitrationPolicies() const override;
cl_version getDeviceIpVersion(const HardwareInfo &hwInfo) const override; cl_version getDeviceIpVersion(const HardwareInfo &hwInfo) const override;
cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const override; cl_device_feature_capabilities_intel getSupportedDeviceFeatureCapabilities(const RootDeviceEnvironment &rootDeviceEnvironment) const override;
bool allowImageCompression(cl_image_format format) const override; bool allowImageCompression(cl_image_format format) const override;
bool isFormatRedescribable(cl_image_format format) const override; bool isFormatRedescribable(cl_image_format format) const override;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -14,12 +14,12 @@
namespace NEO { namespace NEO {
template <typename GfxFamily> template <typename GfxFamily>
inline bool ClGfxCoreHelperHw<GfxFamily>::requiresNonAuxMode(const ArgDescPointer &argAsPtr, const RootDeviceEnvironment &rootDeviceEnvironment) const { inline bool ClGfxCoreHelperHw<GfxFamily>::requiresNonAuxMode(const ArgDescPointer &argAsPtr) const {
return !argAsPtr.isPureStateful(); return !argAsPtr.isPureStateful();
} }
template <typename GfxFamily> template <typename GfxFamily>
inline bool ClGfxCoreHelperHw<GfxFamily>::requiresAuxResolves(const KernelInfo &kernelInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const { inline bool ClGfxCoreHelperHw<GfxFamily>::requiresAuxResolves(const KernelInfo &kernelInfo) const {
return hasStatelessAccessToBuffer(kernelInfo); return hasStatelessAccessToBuffer(kernelInfo);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -24,7 +24,7 @@ cl_ulong ClGfxCoreHelperHw<GfxFamily>::getKernelPrivateMemSize(const KernelInfo
} }
template <typename GfxFamily> template <typename GfxFamily>
cl_device_feature_capabilities_intel ClGfxCoreHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const { cl_device_feature_capabilities_intel ClGfxCoreHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const RootDeviceEnvironment &rootDeviceEnvironment) const {
return 0; return 0;
} }

View File

@@ -1,10 +1,11 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
*/ */
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "opencl/source/helpers/cl_hw_helper.h" #include "opencl/source/helpers/cl_hw_helper.h"
@@ -23,8 +24,9 @@ cl_ulong ClGfxCoreHelperHw<GfxFamily>::getKernelPrivateMemSize(const KernelInfo
} }
template <typename GfxFamily> template <typename GfxFamily>
cl_device_feature_capabilities_intel ClGfxCoreHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const HardwareInfo &hwInfo) const { cl_device_feature_capabilities_intel ClGfxCoreHelperHw<GfxFamily>::getSupportedDeviceFeatureCapabilities(const RootDeviceEnvironment &rootDeviceEnvironment) const {
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
if (productHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) { if (productHelper.isMatrixMultiplyAccumulateSupported(hwInfo)) {
return CL_DEVICE_FEATURE_FLAG_DPAS_INTEL | CL_DEVICE_FEATURE_FLAG_DP4A_INTEL; return CL_DEVICE_FEATURE_FLAG_DPAS_INTEL | CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -178,7 +178,7 @@ CompletionStamp &CommandComputeKernel::submit(TaskCountType taskLevel, bool term
const auto &kernelDescriptor = kernel->getKernelInfo().kernelDescriptor; const auto &kernelDescriptor = kernel->getKernelInfo().kernelDescriptor;
auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(kernel->isAuxTranslationRequired(), commandQueue.getDevice().getHardwareInfo()); auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(kernel->isAuxTranslationRequired());
DispatchFlags dispatchFlags( DispatchFlags dispatchFlags(
{}, // csrDependencies {}, // csrDependencies

View File

@@ -26,6 +26,7 @@
#include "shared/source/kernel/kernel_arg_descriptor_extended_vme.h" #include "shared/source/kernel/kernel_arg_descriptor_extended_vme.h"
#include "shared/source/kernel/local_ids_cache.h" #include "shared/source/kernel/local_ids_cache.h"
#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
@@ -255,7 +256,7 @@ cl_int Kernel::initialize() {
auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
auxTranslationRequired = !program->getIsBuiltIn() && GfxCoreHelper::compressedBuffersSupported(hwInfo) && clGfxCoreHelper.requiresAuxResolves(kernelInfo, rootDeviceEnvironment); auxTranslationRequired = !program->getIsBuiltIn() && GfxCoreHelper::compressedBuffersSupported(hwInfo) && clGfxCoreHelper.requiresAuxResolves(kernelInfo);
if (DebugManager.flags.ForceAuxTranslationEnabled.get() != -1) { if (DebugManager.flags.ForceAuxTranslationEnabled.get() != -1) {
auxTranslationRequired &= !!DebugManager.flags.ForceAuxTranslationEnabled.get(); auxTranslationRequired &= !!DebugManager.flags.ForceAuxTranslationEnabled.get();
@@ -935,7 +936,7 @@ cl_int Kernel::setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocatio
forceNonAuxMode = true; forceNonAuxMode = true;
} }
disableL3 = (argIndex == 0); disableL3 = (argIndex == 0);
} else if (svmAlloc && svmAlloc->isCompressionEnabled() && clGfxCoreHelper.requiresNonAuxMode(argAsPtr, rootDeviceEnvironment)) { } else if (svmAlloc && svmAlloc->isCompressionEnabled() && clGfxCoreHelper.requiresNonAuxMode(argAsPtr)) {
forceNonAuxMode = true; forceNonAuxMode = true;
} }
@@ -1492,7 +1493,7 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
forceNonAuxMode = true; forceNonAuxMode = true;
} }
disableL3 = (argIndex == 0); disableL3 = (argIndex == 0);
} else if (graphicsAllocation->isCompressionEnabled() && clGfxCoreHelper.requiresNonAuxMode(argAsPtr, rootDeviceEnvironment)) { } else if (graphicsAllocation->isCompressionEnabled() && clGfxCoreHelper.requiresNonAuxMode(argAsPtr)) {
forceNonAuxMode = true; forceNonAuxMode = true;
} }
@@ -1949,8 +1950,8 @@ std::unique_ptr<KernelObjsForAuxTranslation> Kernel::fillWithKernelObjsForAuxTra
} }
} }
} }
const auto &productHelper = getDevice().getProductHelper();
if (productHelper.allowStatelessCompression(getDevice().getHardwareInfo())) { if (CompressionSelector::allowStatelessCompression()) {
for (auto gfxAllocation : kernelUnifiedMemoryGfxAllocations) { for (auto gfxAllocation : kernelUnifiedMemoryGfxAllocations) {
if (gfxAllocation->isCompressionEnabled()) { if (gfxAllocation->isCompressionEnabled()) {
kernelObjsForAuxTranslation->insert({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation}); kernelObjsForAuxTranslation->insert({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation});
@@ -2273,8 +2274,7 @@ bool Kernel::requiresCacheFlushCommand(const CommandQueue &commandQueue) const {
} }
void Kernel::updateAuxTranslationRequired() { void Kernel::updateAuxTranslationRequired() {
const auto &productHelper = getDevice().getProductHelper(); if (CompressionSelector::allowStatelessCompression()) {
if (productHelper.allowStatelessCompression(getDevice().getHardwareInfo())) {
if (hasDirectStatelessAccessToHostMemory() || if (hasDirectStatelessAccessToHostMemory() ||
hasIndirectStatelessAccessToHostMemory() || hasIndirectStatelessAccessToHostMemory() ||
hasDirectStatelessAccessToSharedBuffer()) { hasDirectStatelessAccessToSharedBuffer()) {

View File

@@ -313,7 +313,7 @@ Buffer *Buffer::create(Context *context,
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
bool compressionEnabled = MemObjHelper::isSuitableForCompression(GfxCoreHelper::compressedBuffersSupported(*hwInfo), memoryProperties, *context, bool compressionEnabled = MemObjHelper::isSuitableForCompression(GfxCoreHelper::compressedBuffersSupported(*hwInfo), memoryProperties, *context,
gfxCoreHelper.isBufferSizeSuitableForCompression(size, *hwInfo)); gfxCoreHelper.isBufferSizeSuitableForCompression(size));
allocationInfo.allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, *context, compressionEnabled, allocationInfo.allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, *context, compressionEnabled,
memoryManager->isLocalMemorySupported(rootDeviceIndex)); memoryManager->isLocalMemorySupported(rootDeviceIndex));

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -11,14 +11,13 @@
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
namespace NEO { namespace NEO {
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) { bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
switch (properties.allocationType) { switch (properties.allocationType) {
case AllocationType::GLOBAL_SURFACE: case AllocationType::GLOBAL_SURFACE:
case AllocationType::CONSTANT_SURFACE: case AllocationType::CONSTANT_SURFACE:
case AllocationType::SVM_GPU: case AllocationType::SVM_GPU:
case AllocationType::PRINTF_SURFACE: { case AllocationType::PRINTF_SURFACE: {
const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); return CompressionSelector::allowStatelessCompression();
return productHelper.allowStatelessCompression(hwInfo);
} }
default: default:
return false; return false;

View File

@@ -16,6 +16,7 @@
#include "shared/source/helpers/ptr_math.h" #include "shared/source/helpers/ptr_math.h"
#include "shared/source/kernel/implicit_args.h" #include "shared/source/kernel/implicit_args.h"
#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/program/print_formatter.h" #include "shared/source/program/print_formatter.h"
@@ -88,7 +89,7 @@ bool PrintfHandler::printEnqueueOutput() {
auto printfOutputSize = static_cast<uint32_t>(printfSurface->getUnderlyingBufferSize()); auto printfOutputSize = static_cast<uint32_t>(printfSurface->getUnderlyingBufferSize());
std::unique_ptr<uint8_t[]> printfOutputDecompressed; std::unique_ptr<uint8_t[]> printfOutputDecompressed;
if (productHelper.allowStatelessCompression(hwInfo) || productHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *printfSurface)) { if (CompressionSelector::allowStatelessCompression() || productHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *printfSurface)) {
printfOutputDecompressed = std::make_unique<uint8_t[]>(printfOutputSize); printfOutputDecompressed = std::make_unique<uint8_t[]>(printfOutputSize);
printfOutputBuffer = printfOutputDecompressed.get(); printfOutputBuffer = printfOutputDecompressed.get();
auto &bcsEngine = device.getEngine(EngineHelpers::getBcsEngineType(device.getRootDeviceEnvironment(), device.getDeviceBitfield(), device.getSelectorCopyEngine(), true), EngineUsage::Regular); auto &bcsEngine = device.getEngine(EngineHelpers::getBcsEngineType(device.getRootDeviceEnvironment(), device.getDeviceBitfield(), device.getSelectorCopyEngine(), true), EngineUsage::Regular);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -25,7 +25,7 @@ void populateFactoryTable<ClGfxCoreHelperHw<Family>>() {
} }
template <> template <>
bool ClGfxCoreHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const { bool ClGfxCoreHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo) const {
return false; return false;
} }

View File

@@ -9,6 +9,7 @@
#include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/populate_factory.h" #include "shared/source/helpers/populate_factory.h"
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h" #include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h"
@@ -28,11 +29,9 @@ void populateFactoryTable<ClGfxCoreHelperHw<Family>>() {
} }
template <> template <>
bool ClGfxCoreHelperHw<Family>::requiresNonAuxMode(const ArgDescPointer &argAsPtr, const RootDeviceEnvironment &rootDeviceEnvironment) const { bool ClGfxCoreHelperHw<Family>::requiresNonAuxMode(const ArgDescPointer &argAsPtr) const {
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
if (productHelper.allowStatelessCompression(hwInfo)) { if (CompressionSelector::allowStatelessCompression()) {
return false; return false;
} else { } else {
return !argAsPtr.isPureStateful(); return !argAsPtr.isPureStateful();
@@ -40,11 +39,9 @@ bool ClGfxCoreHelperHw<Family>::requiresNonAuxMode(const ArgDescPointer &argAsPt
} }
template <> template <>
bool ClGfxCoreHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const { bool ClGfxCoreHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo) const {
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
if (productHelper.allowStatelessCompression(hwInfo)) { if (CompressionSelector::allowStatelessCompression()) {
return false; return false;
} else { } else {
return hasStatelessAccessToBuffer(kernelInfo); return hasStatelessAccessToBuffer(kernelInfo);

View File

@@ -696,7 +696,7 @@ HWTEST2_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenPrope
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get()); snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get());
auto &gfxCoreHelper = device->getGfxCoreHelper(); auto &gfxCoreHelper = device->getGfxCoreHelper();
auto compressionSupported = gfxCoreHelper.isBufferSizeSuitableForCompression(size, hwInfo) && auto compressionSupported = gfxCoreHelper.isBufferSizeSuitableForCompression(size) &&
GfxCoreHelper::compressedBuffersSupported(hwInfo); GfxCoreHelper::compressedBuffersSupported(hwInfo);
if (compressionSupported) { if (compressionSupported) {
EXPECT_TRUE(containsHint(expectedHint, userData)); EXPECT_TRUE(containsHint(expectedHint, userData));
@@ -730,7 +730,7 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo
isCompressed = MemObjHelper::isSuitableForCompression( isCompressed = MemObjHelper::isSuitableForCompression(
GfxCoreHelper::compressedBuffersSupported(hwInfo), GfxCoreHelper::compressedBuffersSupported(hwInfo),
memoryProperties, *context, memoryProperties, *context,
gfxCoreHelper.isBufferSizeSuitableForCompression(size, hwInfo)) && gfxCoreHelper.isBufferSizeSuitableForCompression(size)) &&
!is32bit && !context->isSharedContext && !is32bit && !context->isSharedContext &&
(!memoryProperties.flags.useHostPtr || context->getMemoryManager()->isLocalMemorySupported(device->getRootDeviceIndex())) && (!memoryProperties.flags.useHostPtr || context->getMemoryManager()->isLocalMemorySupported(device->getRootDeviceIndex())) &&
!memoryProperties.flags.forceHostMemory; !memoryProperties.flags.forceHostMemory;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -1125,9 +1125,8 @@ struct DeviceAttributeQueryTest : public ::testing::TestWithParam<uint32_t /*cl_
} }
case CL_DEVICE_FEATURE_CAPABILITIES_INTEL: { case CL_DEVICE_FEATURE_CAPABILITIES_INTEL: {
auto pCapabilities = reinterpret_cast<cl_device_feature_capabilities_intel *>(object.get()); auto pCapabilities = reinterpret_cast<cl_device_feature_capabilities_intel *>(object.get());
auto &hwInfo = device.getHardwareInfo();
auto &clGfxCoreHelper = device.getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = device.getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>();
EXPECT_EQ(clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(hwInfo), *pCapabilities); EXPECT_EQ(clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(device.getRootDeviceEnvironment()), *pCapabilities);
EXPECT_EQ(sizeof(cl_device_feature_capabilities_intel), sizeReturned); EXPECT_EQ(sizeof(cl_device_feature_capabilities_intel), sizeReturned);
break; break;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2022 Intel Corporation * Copyright (C) 2019-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -22,5 +22,5 @@ GEN11TEST_F(ClGfxCoreHelperTestGen11, WhenGettingDeviceIpVersionThenMakeCorrectD
GEN11TEST_F(ClGfxCoreHelperTestGen11, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) { GEN11TEST_F(ClGfxCoreHelperTestGen11, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
EXPECT_EQ(0u, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(*defaultHwInfo)); EXPECT_EQ(0u, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(getRootDeviceEnvironment()));
} }

View File

@@ -32,7 +32,7 @@ GEN12LPTEST_F(ClGfxCoreHelperTestsGen12Lp, givenTglLpThenAuxTranslationIsRequire
arg.as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = accessedUsingStatelessAddressingMode; arg.as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = accessedUsingStatelessAddressingMode;
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.push_back(std::move(arg)); kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.push_back(std::move(arg));
EXPECT_EQ(accessedUsingStatelessAddressingMode, clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment())); EXPECT_EQ(accessedUsingStatelessAddressingMode, clGfxCoreHelper.requiresAuxResolves(kernelInfo));
} }
} }
@@ -64,7 +64,7 @@ HWTEST2_F(ClGfxCoreHelperTestsGen12Lp, WhenGettingDeviceIpVersionThenMakeCorrect
GEN12LPTEST_F(ClGfxCoreHelperTestsGen12Lp, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) { GEN12LPTEST_F(ClGfxCoreHelperTestsGen12Lp, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
cl_device_feature_capabilities_intel expectedCapabilities = CL_DEVICE_FEATURE_FLAG_DP4A_INTEL; cl_device_feature_capabilities_intel expectedCapabilities = CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
EXPECT_EQ(expectedCapabilities, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(hardwareInfo)); EXPECT_EQ(expectedCapabilities, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(getRootDeviceEnvironment()));
} }
using GfxCoreHelperTestGen12Lp = GfxCoreHelperTest; using GfxCoreHelperTestGen12Lp = GfxCoreHelperTest;
@@ -98,7 +98,7 @@ GEN12LPTEST_F(GfxCoreHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheck
const size_t sizesToCheck[] = {128, 256, 512, 1023, 1024, 1025}; const size_t sizesToCheck[] = {128, 256, 512, 1023, 1024, 1025};
for (size_t size : sizesToCheck) { for (size_t size : sizesToCheck) {
EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(size, *defaultHwInfo)); EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(size));
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -25,5 +25,5 @@ GEN8TEST_F(ClGfxCoreHelperTestGen8, WhenGettingDeviceIpVersionThenMakeCorrectDev
GEN8TEST_F(ClGfxCoreHelperTestGen8, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) { GEN8TEST_F(ClGfxCoreHelperTestGen8, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
EXPECT_EQ(0u, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(*defaultHwInfo)); EXPECT_EQ(0u, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(getRootDeviceEnvironment()));
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -21,5 +21,5 @@ GEN9TEST_F(ClGfxCoreHelperTestGen9, WhenGettingDeviceIpVersionThenMakeCorrectDev
GEN9TEST_F(ClGfxCoreHelperTestGen9, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) { GEN9TEST_F(ClGfxCoreHelperTestGen9, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
EXPECT_EQ(0u, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(*defaultHwInfo)); EXPECT_EQ(0u, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(getRootDeviceEnvironment()));
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -59,7 +59,7 @@ TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingSvmG
AllocationType::SVM_GPU, AllocationType::SVM_GPU,
deviceBitfield); deviceBitfield);
EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingPrintfSurfaceThenPreferCompressedBuffer) { TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingPrintfSurfaceThenPreferCompressedBuffer) {
@@ -72,6 +72,6 @@ TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingPrin
AllocationType::PRINTF_SURFACE, AllocationType::PRINTF_SURFACE,
deviceBitfield); deviceBitfield);
EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo)); EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties));
} }
} // namespace NEO } // namespace NEO

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -114,12 +114,12 @@ HWTEST_F(ClGfxCoreHelperTest, givenKernelInfoWhenCheckingRequiresAuxResolvesThen
ArgDescriptor argDescriptorValue(ArgDescriptor::ArgType::ArgTValue); ArgDescriptor argDescriptorValue(ArgDescriptor::ArgType::ArgTValue);
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.push_back(argDescriptorValue); kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.push_back(argDescriptorValue);
EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment())); EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo));
ArgDescriptor argDescriptorPointer(ArgDescriptor::ArgType::ArgTPointer); ArgDescriptor argDescriptorPointer(ArgDescriptor::ArgType::ArgTPointer);
argDescriptorPointer.as<ArgDescPointer>().accessedUsingStatelessAddressingMode = true; argDescriptorPointer.as<ArgDescPointer>().accessedUsingStatelessAddressingMode = true;
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.push_back(argDescriptorPointer); kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.push_back(argDescriptorPointer);
EXPECT_TRUE(clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment())); EXPECT_TRUE(clGfxCoreHelper.requiresAuxResolves(kernelInfo));
} }
TEST_F(ClGfxCoreHelperTest, givenGenHelperWhenKernelArgumentIsNotPureStatefulThenRequireNonAuxMode) { TEST_F(ClGfxCoreHelperTest, givenGenHelperWhenKernelArgumentIsNotPureStatefulThenRequireNonAuxMode) {
@@ -129,7 +129,7 @@ TEST_F(ClGfxCoreHelperTest, givenGenHelperWhenKernelArgumentIsNotPureStatefulThe
ArgDescPointer argAsPtr{}; ArgDescPointer argAsPtr{};
argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful; argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful;
EXPECT_EQ(!argAsPtr.isPureStateful(), clGfxCoreHelper.requiresNonAuxMode(argAsPtr, getRootDeviceEnvironment())); EXPECT_EQ(!argAsPtr.isPureStateful(), clGfxCoreHelper.requiresNonAuxMode(argAsPtr));
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -32,5 +32,5 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ClGfxCoreHelperTestXeHpAndLater, givenCLImageFormat
HWTEST2_F(ClGfxCoreHelperTestXeHpAndLater, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue, IsAtLeastXeHpCore) { HWTEST2_F(ClGfxCoreHelperTestXeHpAndLater, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue, IsAtLeastXeHpCore) {
cl_device_feature_capabilities_intel expectedCapabilities = CL_DEVICE_FEATURE_FLAG_DPAS_INTEL | CL_DEVICE_FEATURE_FLAG_DP4A_INTEL; cl_device_feature_capabilities_intel expectedCapabilities = CL_DEVICE_FEATURE_FLAG_DPAS_INTEL | CL_DEVICE_FEATURE_FLAG_DP4A_INTEL;
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
EXPECT_EQ(expectedCapabilities, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(*defaultHwInfo)); EXPECT_EQ(expectedCapabilities, clGfxCoreHelper.getSupportedDeviceFeatureCapabilities(getRootDeviceEnvironment()));
} }

View File

@@ -512,7 +512,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver {
bool isMultiOsContextCapable() const override { return false; } bool isMultiOsContextCapable() const override { return false; }
MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const override { MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired) const override {
return MemoryCompressionState::NotApplicable; return MemoryCompressionState::NotApplicable;
} }
@@ -2542,11 +2542,11 @@ TEST(KernelTest, givenFtrRenderCompressedBuffersWhenInitializingArgsWithNonState
auto &rootDeviceEnvironment = device->getRootDeviceEnvironment(); auto &rootDeviceEnvironment = device->getRootDeviceEnvironment();
auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
EXPECT_EQ(clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo, rootDeviceEnvironment), kernel.mockKernel->isAuxTranslationRequired()); EXPECT_EQ(clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo), kernel.mockKernel->isAuxTranslationRequired());
DebugManager.flags.ForceAuxTranslationEnabled.set(-1); DebugManager.flags.ForceAuxTranslationEnabled.set(-1);
kernel.mockKernel->initialize(); kernel.mockKernel->initialize();
EXPECT_EQ(clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo, rootDeviceEnvironment), kernel.mockKernel->isAuxTranslationRequired()); EXPECT_EQ(clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo), kernel.mockKernel->isAuxTranslationRequired());
DebugManager.flags.ForceAuxTranslationEnabled.set(0); DebugManager.flags.ForceAuxTranslationEnabled.set(0);
kernel.mockKernel->initialize(); kernel.mockKernel->initialize();
@@ -2572,7 +2572,7 @@ TEST(KernelTest, WhenAuxTranslationIsRequiredThenKernelSetsRequiredResolvesInCon
auto &rootDeviceEnvironment = device->getRootDeviceEnvironment(); auto &rootDeviceEnvironment = device->getRootDeviceEnvironment();
auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
if (clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo, rootDeviceEnvironment)) { if (clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo)) {
EXPECT_TRUE(context->getResolvesRequiredInKernels()); EXPECT_TRUE(context->getResolvesRequiredInKernels());
} else { } else {
EXPECT_FALSE(context->getResolvesRequiredInKernels()); EXPECT_FALSE(context->getResolvesRequiredInKernels());
@@ -2618,7 +2618,7 @@ TEST(KernelTest, givenDebugVariableSetWhenKernelHasStatefulBufferAccessThenMarkK
auto &rootDeviceEnvironment = device->getRootDeviceEnvironment(); auto &rootDeviceEnvironment = device->getRootDeviceEnvironment();
auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
if (clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo, rootDeviceEnvironment)) { if (clGfxCoreHelper.requiresAuxResolves(kernel.kernelInfo)) {
EXPECT_TRUE(kernel.mockKernel->isAuxTranslationRequired()); EXPECT_TRUE(kernel.mockKernel->isAuxTranslationRequired());
} else { } else {
EXPECT_FALSE(kernel.mockKernel->isAuxTranslationRequired()); EXPECT_FALSE(kernel.mockKernel->isAuxTranslationRequired());

View File

@@ -707,7 +707,7 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal)); buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex()); allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex());
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
EXPECT_FALSE(buffer->isMemObjZeroCopy()); EXPECT_FALSE(buffer->isMemObjZeroCopy());
EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER); EXPECT_EQ(allocation->getAllocationType(), AllocationType::BUFFER);
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, allocation->isCompressionEnabled()); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, allocation->isCompressionEnabled());
@@ -726,7 +726,7 @@ TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationWhenSharedContextI
buffer.reset(Buffer::create(context.get(), CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); buffer.reset(Buffer::create(context.get(), CL_MEM_READ_WRITE, bufferSize, nullptr, retVal));
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER); EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER);
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled()); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled());
} else { } else {
@@ -749,7 +749,7 @@ TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelect
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal)); buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER); EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::BUFFER);
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled()); EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled());
} else { } else {
@@ -808,7 +808,7 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenCopyFromHo
buffer.reset(Buffer::create(context.get(), CL_MEM_COPY_HOST_PTR, bufferSize, hostPtr, retVal)); buffer.reset(Buffer::create(context.get(), CL_MEM_COPY_HOST_PTR, bufferSize, hostPtr, retVal));
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex()); auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
EXPECT_TRUE(graphicsAllocation->isCompressionEnabled()); EXPECT_TRUE(graphicsAllocation->isCompressionEnabled());
EXPECT_EQ(1u, mockCmdQ->writeBufferCounter); EXPECT_EQ(1u, mockCmdQ->writeBufferCounter);
EXPECT_TRUE(mockCmdQ->writeBufferBlocking); EXPECT_TRUE(mockCmdQ->writeBufferBlocking);
@@ -849,7 +849,7 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenNonCompressedBufferWhenCopyFro
TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenWriteBufferFailsThenReturnErrorCode) { TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenWriteBufferFailsThenReturnErrorCode) {
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper(); auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
if (is32bit || !gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) { if (is32bit || !gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
return; return;
} }
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true; hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;

View File

@@ -42,5 +42,5 @@ bool TestChecks::supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvi
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[0].as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = true; kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[0].as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = true;
auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = rootDeviceEnvironment.getHelper<ClGfxCoreHelper>();
return clGfxCoreHelper.requiresAuxResolves(kernelInfo, rootDeviceEnvironment); return clGfxCoreHelper.requiresAuxResolves(kernelInfo);
} }

View File

@@ -32,7 +32,7 @@ XE_HPC_CORETEST_F(ClGfxCoreHelperTestsXeHpcCore, givenXeHpcThenAuxTranslationIsN
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
KernelInfo kernelInfo{}; KernelInfo kernelInfo{};
EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment())); EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo));
} }
XE_HPC_CORETEST_F(ClGfxCoreHelperTestsXeHpcCore, WhenCheckingPreferenceForBlitterForLocalToLocalTransfersThenReturnFalse) { XE_HPC_CORETEST_F(ClGfxCoreHelperTestsXeHpcCore, WhenCheckingPreferenceForBlitterForLocalToLocalTransfersThenReturnFalse) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -39,7 +39,7 @@ XE_HPG_CORETEST_F(ClGfxCoreHelperTestsXeHpgCore, givenGenHelperWhenKernelArgumen
ArgDescPointer argAsPtr{}; ArgDescPointer argAsPtr{};
argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful; argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful;
EXPECT_EQ(!argAsPtr.isPureStateful(), clGfxCoreHelper.requiresNonAuxMode(argAsPtr, getRootDeviceEnvironment())); EXPECT_EQ(!argAsPtr.isPureStateful(), clGfxCoreHelper.requiresNonAuxMode(argAsPtr));
} }
} }
@@ -52,7 +52,7 @@ XE_HPG_CORETEST_F(ClGfxCoreHelperTestsXeHpgCore, givenGenHelperWhenEnableStatele
for (auto isPureStateful : ::testing::Bool()) { for (auto isPureStateful : ::testing::Bool()) {
ArgDescPointer argAsPtr{}; ArgDescPointer argAsPtr{};
argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful; argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful;
EXPECT_FALSE(clGfxCoreHelper.requiresNonAuxMode(argAsPtr, getRootDeviceEnvironment())); EXPECT_FALSE(clGfxCoreHelper.requiresNonAuxMode(argAsPtr));
} }
} }
@@ -63,7 +63,7 @@ XE_HPG_CORETEST_F(ClGfxCoreHelperTestsXeHpgCore, givenGenHelperWhenCheckAuxTrans
KernelInfo kernelInfo{}; KernelInfo kernelInfo{};
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.resize(1); kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.resize(1);
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[0].as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = !isPureStateful; kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[0].as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = !isPureStateful;
EXPECT_EQ(!isPureStateful, clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment())); EXPECT_EQ(!isPureStateful, clGfxCoreHelper.requiresAuxResolves(kernelInfo));
} }
} }
@@ -74,7 +74,7 @@ XE_HPG_CORETEST_F(ClGfxCoreHelperTestsXeHpgCore, givenGenHelperWhenEnableStatele
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>(); auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
KernelInfo kernelInfo{}; KernelInfo kernelInfo{};
EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment())); EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo));
} }
XE_HPG_CORETEST_F(ClGfxCoreHelperTestsXeHpgCore, givenDifferentCLImageFormatsWhenCallingAllowImageCompressionThenCorrectValueReturned) { XE_HPG_CORETEST_F(ClGfxCoreHelperTestsXeHpgCore, givenDifferentCLImageFormatsWhenCallingAllowImageCompressionThenCorrectValueReturned) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -36,13 +36,13 @@ XE_HPG_CORETEST_F(CommandStreamReceiverHwTestXeHpgCore, givenEnableStatelessComp
DebugManager.flags.EnableStatelessCompression.set(0); DebugManager.flags.EnableStatelessCompression.set(0);
for (bool auxTranslationRequired : {false, true}) { for (bool auxTranslationRequired : {false, true}) {
auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired, pDevice->getHardwareInfo()); auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired);
EXPECT_EQ(MemoryCompressionState::NotApplicable, memoryCompressionState); EXPECT_EQ(MemoryCompressionState::NotApplicable, memoryCompressionState);
} }
DebugManager.flags.EnableStatelessCompression.set(1); DebugManager.flags.EnableStatelessCompression.set(1);
for (bool auxTranslationRequired : {false, true}) { for (bool auxTranslationRequired : {false, true}) {
auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired, pDevice->getHardwareInfo()); auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired);
if (auxTranslationRequired) { if (auxTranslationRequired) {
EXPECT_EQ(MemoryCompressionState::Disabled, memoryCompressionState); EXPECT_EQ(MemoryCompressionState::Disabled, memoryCompressionState);
} else { } else {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -226,7 +226,7 @@ class CommandStreamReceiver {
virtual bool isMultiOsContextCapable() const = 0; virtual bool isMultiOsContextCapable() const = 0;
virtual MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const = 0; virtual MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired) const = 0;
void setLatestSentTaskCount(TaskCountType latestSentTaskCount) { void setLatestSentTaskCount(TaskCountType latestSentTaskCount) {
this->latestSentTaskCount = latestSentTaskCount; this->latestSentTaskCount = latestSentTaskCount;

View File

@@ -110,7 +110,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
bool isMultiOsContextCapable() const override; bool isMultiOsContextCapable() const override;
MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const override; MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired) const override;
bool isDirectSubmissionEnabled() const override { bool isDirectSubmissionEnabled() const override {
return directSubmission.get() != nullptr; return directSubmission.get() != nullptr;

View File

@@ -1425,7 +1425,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::updateTagFromWait() {
} }
template <typename GfxFamily> template <typename GfxFamily>
inline MemoryCompressionState CommandStreamReceiverHw<GfxFamily>::getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const { inline MemoryCompressionState CommandStreamReceiverHw<GfxFamily>::getMemoryCompressionState(bool auxTranslationRequired) const {
return MemoryCompressionState::NotApplicable; return MemoryCompressionState::NotApplicable;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2022 Intel Corporation * Copyright (C) 2019-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -68,7 +68,7 @@ bool GfxCoreHelperHw<Family>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) c
} }
template <> template <>
bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const { bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size) const {
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) { if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get(); return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -8,6 +8,7 @@
#include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/helpers/local_memory_access_modes.h"
#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
namespace NEO { namespace NEO {
@@ -37,7 +38,7 @@ void GfxCoreHelperHw<Family>::setExtraAllocationData(AllocationData &allocationD
allocationData.flags.requiresCpuAccess = true; allocationData.flags.requiresCpuAccess = true;
} }
if (productHelper.allowStatelessCompression(hwInfo)) { if (CompressionSelector::allowStatelessCompression()) {
if (properties.allocationType == AllocationType::GLOBAL_SURFACE || if (properties.allocationType == AllocationType::GLOBAL_SURFACE ||
properties.allocationType == AllocationType::CONSTANT_SURFACE || properties.allocationType == AllocationType::CONSTANT_SURFACE ||
properties.allocationType == AllocationType::PRINTF_SURFACE) { properties.allocationType == AllocationType::PRINTF_SURFACE) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -58,7 +58,7 @@ class GfxCoreHelper {
virtual const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const = 0; virtual const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const = 0;
virtual bool hvAlign4Required() const = 0; virtual bool hvAlign4Required() const = 0;
virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0;
virtual bool isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool isBufferSizeSuitableForCompression(const size_t size) const = 0;
virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) const = 0; virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) const = 0;
static bool compressedBuffersSupported(const HardwareInfo &hwInfo); static bool compressedBuffersSupported(const HardwareInfo &hwInfo);
static bool compressedImagesSupported(const HardwareInfo &hwInfo); static bool compressedImagesSupported(const HardwareInfo &hwInfo);
@@ -221,7 +221,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
bool hvAlign4Required() const override; bool hvAlign4Required() const override;
bool isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const override; bool isBufferSizeSuitableForCompression(const size_t size) const override;
bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) const override; bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) const override;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2022 Intel Corporation * Copyright (C) 2019-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -30,7 +30,7 @@ template <typename Family>
const AuxTranslationMode GfxCoreHelperHw<Family>::defaultAuxTranslationMode = AuxTranslationMode::Builtin; const AuxTranslationMode GfxCoreHelperHw<Family>::defaultAuxTranslationMode = AuxTranslationMode::Builtin;
template <typename Family> template <typename Family>
bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const { bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size) const {
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) { if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get(); return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
} }

View File

@@ -15,6 +15,7 @@ set(NEO_CORE_MEMORY_MANAGER
${CMAKE_CURRENT_SOURCE_DIR}/alignment_selector.h ${CMAKE_CURRENT_SOURCE_DIR}/alignment_selector.h
${CMAKE_CURRENT_SOURCE_DIR}/allocation_properties.h ${CMAKE_CURRENT_SOURCE_DIR}/allocation_properties.h
${CMAKE_CURRENT_SOURCE_DIR}/compression_selector.h ${CMAKE_CURRENT_SOURCE_DIR}/compression_selector.h
${CMAKE_CURRENT_SOURCE_DIR}/compression_selector.cpp
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.h ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.h
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.cpp ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/api_specific_config.h"
namespace NEO {
bool CompressionSelector::allowStatelessCompression() {
if (!NEO::ApiSpecificConfig::isStatelessCompressionSupported()) {
return false;
}
if (DebugManager.flags.EnableStatelessCompression.get() != -1) {
return static_cast<bool>(DebugManager.flags.EnableStatelessCompression.get());
}
return false;
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -10,11 +10,11 @@
namespace NEO { namespace NEO {
struct AllocationProperties; struct AllocationProperties;
struct HardwareInfo;
class CompressionSelector { class CompressionSelector {
public: public:
static bool preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo); static bool preferCompressedAllocation(const AllocationProperties &properties);
static bool allowStatelessCompression();
}; };
} // namespace NEO } // namespace NEO

View File

@@ -342,9 +342,9 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
UNRECOVERABLE_IF(hostPtr == nullptr && !properties.flags.allocateMemory); UNRECOVERABLE_IF(hostPtr == nullptr && !properties.flags.allocateMemory);
UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN); UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN);
auto &rootDeviceEnvironments = *executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex]; auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[properties.rootDeviceIndex];
auto &hwInfo = *rootDeviceEnvironments.getHardwareInfo(); auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto &helper = rootDeviceEnvironments.getHelper<GfxCoreHelper>(); auto &helper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
bool allow64KbPages = false; bool allow64KbPages = false;
bool allow32Bit = false; bool allow32Bit = false;
@@ -477,7 +477,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
allocationData.flags.flushL3 = allocationData.flags.flushL3 =
(mayRequireL3Flush ? properties.flags.flushL3RequiredForRead | properties.flags.flushL3RequiredForWrite : 0u); (mayRequireL3Flush ? properties.flags.flushL3RequiredForRead | properties.flags.flushL3RequiredForWrite : 0u);
allocationData.flags.preferCompressed = properties.flags.preferCompressed; allocationData.flags.preferCompressed = properties.flags.preferCompressed;
allocationData.flags.preferCompressed |= CompressionSelector::preferCompressedAllocation(properties, hwInfo); allocationData.flags.preferCompressed |= CompressionSelector::preferCompressedAllocation(properties);
allocationData.flags.multiOsContextCapable = properties.flags.multiOsContextCapable; allocationData.flags.multiOsContextCapable = properties.flags.multiOsContextCapable;
allocationData.usmInitialPlacement = properties.usmInitialPlacement; allocationData.usmInitialPlacement = properties.usmInitialPlacement;

View File

@@ -15,6 +15,7 @@
#include "shared/source/helpers/api_specific_config.h" #include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/memory_properties_helpers.h" #include "shared/source/helpers/memory_properties_helpers.h"
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/page_fault_manager/cpu_page_fault_manager.h" #include "shared/source/page_fault_manager/cpu_page_fault_manager.h"
@@ -668,8 +669,7 @@ AllocationType SVMAllocsManager::getGraphicsAllocationTypeAndCompressionPreferen
allocationType = AllocationType::WRITE_COMBINED; allocationType = AllocationType::WRITE_COMBINED;
} else { } else {
UNRECOVERABLE_IF(nullptr == unifiedMemoryProperties.device); UNRECOVERABLE_IF(nullptr == unifiedMemoryProperties.device);
const auto &productHelper = *ProductHelper::get(unifiedMemoryProperties.device->getHardwareInfo().platform.eProductFamily); if (CompressionSelector::allowStatelessCompression()) {
if (productHelper.allowStatelessCompression(unifiedMemoryProperties.device->getHardwareInfo())) {
compressionEnabled = true; compressionEnabled = true;
} }
allocationType = AllocationType::BUFFER; allocationType = AllocationType::BUFFER;

View File

@@ -90,7 +90,6 @@ class ProductHelper {
virtual std::string getDeviceMemoryName() const = 0; virtual std::string getDeviceMemoryName() const = 0;
virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0; virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0;
virtual bool allowCompression(const HardwareInfo &hwInfo) const = 0; virtual bool allowCompression(const HardwareInfo &hwInfo) const = 0;
virtual bool allowStatelessCompression(const HardwareInfo &hwInfo) const = 0;
virtual LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0; virtual LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0;
virtual bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0;
virtual bool isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const = 0;
@@ -235,7 +234,6 @@ class ProductHelperHw : public ProductHelper {
std::string getDeviceMemoryName() const override; std::string getDeviceMemoryName() const override;
bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override; bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override;
bool allowCompression(const HardwareInfo &hwInfo) const override; bool allowCompression(const HardwareInfo &hwInfo) const override;
bool allowStatelessCompression(const HardwareInfo &hwInfo) const override;
LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override; LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const override; bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const override;
bool isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const override; bool isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const override;

View File

@@ -238,17 +238,6 @@ bool ProductHelperHw<gfxProduct>::allowCompression(const HardwareInfo &hwInfo) c
return true; return true;
} }
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::allowStatelessCompression(const HardwareInfo &hwInfo) const {
if (!NEO::ApiSpecificConfig::isStatelessCompressionSupported()) {
return false;
}
if (DebugManager.flags.EnableStatelessCompression.get() != -1) {
return static_cast<bool>(DebugManager.flags.EnableStatelessCompression.get());
}
return false;
}
template <PRODUCT_FAMILY gfxProduct> template <PRODUCT_FAMILY gfxProduct>
LocalMemoryAccessMode ProductHelperHw<gfxProduct>::getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const { LocalMemoryAccessMode ProductHelperHw<gfxProduct>::getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const {
return LocalMemoryAccessMode::Default; return LocalMemoryAccessMode::Default;

View File

@@ -1,10 +1,11 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
*/ */
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h" #include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h"
#include "shared/source/xe_hpg_core/hw_info.h" #include "shared/source/xe_hpg_core/hw_info.h"
@@ -33,10 +34,10 @@ void populateFactoryTable<CommandStreamReceiverHw<Family>>() {
} }
template <> template <>
MemoryCompressionState CommandStreamReceiverHw<Family>::getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const { MemoryCompressionState CommandStreamReceiverHw<Family>::getMemoryCompressionState(bool auxTranslationRequired) const {
auto memoryCompressionState = MemoryCompressionState::NotApplicable; auto memoryCompressionState = MemoryCompressionState::NotApplicable;
const auto &productHelper = getProductHelper();
if (productHelper.allowStatelessCompression(hwInfo)) { if (CompressionSelector::allowStatelessCompression()) {
memoryCompressionState = auxTranslationRequired ? MemoryCompressionState::Disabled : MemoryCompressionState::Enabled; memoryCompressionState = auxTranslationRequired ? MemoryCompressionState::Disabled : MemoryCompressionState::Enabled;
} }
return memoryCompressionState; return memoryCompressionState;

View File

@@ -1,10 +1,11 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
*/ */
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/source/xe_hpg_core/aub_mapper.h" #include "shared/source/xe_hpg_core/aub_mapper.h"
#include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h" #include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h"
@@ -112,12 +113,12 @@ std::string GfxCoreHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) c
} }
template <> template <>
bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const { bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size) const {
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) { if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get(); return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
} }
if (ProductHelper::get(hwInfo.platform.eProductFamily)->allowStatelessCompression(hwInfo)) { if (CompressionSelector::allowStatelessCompression()) {
return true; return true;
} else { } else {
return false; return false;

View File

@@ -89,7 +89,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
} }
} }
MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const override { MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired) const override {
return MemoryCompressionState::NotApplicable; return MemoryCompressionState::NotApplicable;
}; };

View File

@@ -164,11 +164,6 @@ bool ProductHelperHw<IGFX_UNKNOWN>::allowCompression(const HardwareInfo &hwInfo)
return false; return false;
} }
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::allowStatelessCompression(const HardwareInfo &hwInfo) const {
return false;
}
template <> template <>
bool ProductHelperHw<IGFX_UNKNOWN>::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { bool ProductHelperHw<IGFX_UNKNOWN>::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const {
return false; return false;

View File

@@ -626,7 +626,7 @@ HWTEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenCallingGetMemo
CommandStreamReceiverHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); CommandStreamReceiverHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
for (bool auxTranslationRequired : {false, true}) { for (bool auxTranslationRequired : {false, true}) {
auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired, *defaultHwInfo); auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired);
EXPECT_EQ(MemoryCompressionState::NotApplicable, memoryCompressionState); EXPECT_EQ(MemoryCompressionState::NotApplicable, memoryCompressionState);
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -851,14 +851,14 @@ HWTEST_F(GfxCoreHelperTest, givenDebugFlagWhenCheckingIfBufferIsSuitableForCompr
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(0); DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(0);
EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(0, *defaultHwInfo)); EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(0));
EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB, *defaultHwInfo)); EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB));
EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB + 1, *defaultHwInfo)); EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB + 1));
DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(1); DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(1);
EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(0, *defaultHwInfo)); EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(0));
EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB, *defaultHwInfo)); EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB));
EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB + 1, *defaultHwInfo)); EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(KB + 1));
} }
HWTEST_F(GfxCoreHelperTest, WhenIsBankOverrideRequiredIsCalledThenFalseIsReturned) { HWTEST_F(GfxCoreHelperTest, WhenIsBankOverrideRequiredIsCalledThenFalseIsReturned) {

View File

@@ -1,11 +1,13 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
*/ */
#include "shared/source/memory_manager/compression_selector.h"
#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/fixtures/memory_management_fixture.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/memory_management.h" #include "shared/test/common/helpers/memory_management.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
@@ -45,6 +47,22 @@ TEST(allocation, GivenFailingAllocationOneWhenCreatingAllocationsThenOnlyOneAllo
MemoryManagement::detailedAllocationLoggingActive = false; MemoryManagement::detailedAllocationLoggingActive = false;
} }
TEST(CompressionSelector, WhenAllowStatelessCompressionIsCalledThenReturnCorrectValue) {
DebugManagerStateRestore restore;
EXPECT_FALSE(CompressionSelector::allowStatelessCompression());
for (auto enable : {-1, 0, 1}) {
DebugManager.flags.EnableStatelessCompression.set(enable);
if (enable > 0) {
EXPECT_TRUE(CompressionSelector::allowStatelessCompression());
} else {
EXPECT_FALSE(CompressionSelector::allowStatelessCompression());
}
}
}
struct MemoryManagementTest : public MemoryManagementFixture, struct MemoryManagementTest : public MemoryManagementFixture,
public ::testing::Test { public ::testing::Test {
void SetUp() override { void SetUp() override {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -291,22 +291,6 @@ HWTEST_F(ProductHelperTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned
EXPECT_TRUE(productHelper->allowCompression(pInHwInfo)); EXPECT_TRUE(productHelper->allowCompression(pInHwInfo));
} }
HWTEST_F(ProductHelperTest, WhenAllowStatelessCompressionIsCalledThenReturnCorrectValue) {
DebugManagerStateRestore restore;
EXPECT_FALSE(productHelper->allowStatelessCompression(pInHwInfo));
for (auto enable : {-1, 0, 1}) {
DebugManager.flags.EnableStatelessCompression.set(enable);
if (enable > 0) {
EXPECT_TRUE(productHelper->allowStatelessCompression(pInHwInfo));
} else {
EXPECT_FALSE(productHelper->allowStatelessCompression(pInHwInfo));
}
}
}
HWTEST_F(ProductHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAccessModeThenCorrectValueIsReturned) { HWTEST_F(ProductHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAccessModeThenCorrectValueIsReturned) {
DebugManagerStateRestore restore{}; DebugManagerStateRestore restore{};

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -1108,7 +1108,7 @@ HWTEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenNotSetUseSystemMemoryWhenGr
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success; MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
allocData.flags.preferCompressed = CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo); allocData.flags.preferCompressed = CompressionSelector::preferCompressedAllocation(properties);
auto buffer = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status); auto buffer = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
ASSERT_NE(nullptr, buffer); ASSERT_NE(nullptr, buffer);
EXPECT_EQ(0u, buffer->getDefaultGmm()->resourceParams.Flags.Info.RenderCompressed); EXPECT_EQ(0u, buffer->getDefaultGmm()->resourceParams.Flags.Info.RenderCompressed);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -15,7 +15,7 @@ namespace NEO {
namespace ImplicitScaling { namespace ImplicitScaling {
bool apiSupport = false; bool apiSupport = false;
} // namespace ImplicitScaling } // namespace ImplicitScaling
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) { bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
return false; return false;
} }
void PageFaultManager::transferToCpu(void *ptr, size_t size, void *cmdQ) { void PageFaultManager::transferToCpu(void *ptr, size_t size, void *cmdQ) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -30,7 +30,7 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenDifferentBufferSizesWhenEnabl
const size_t sizesToCheck[] = {1, 128, 256, 1024, 2048}; const size_t sizesToCheck[] = {1, 128, 256, 1024, 2048};
for (size_t size : sizesToCheck) { for (size_t size : sizesToCheck) {
EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(size, *defaultHwInfo)); EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(size));
} }
} }
@@ -45,9 +45,9 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenDebugFlagWhenCheckingIfBuffer
for (size_t size : sizesToCheck) { for (size_t size : sizesToCheck) {
if (debugFlag == 1) { if (debugFlag == 1) {
EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(size, *defaultHwInfo)); EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(size));
} else { } else {
EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(size, *defaultHwInfo)); EXPECT_FALSE(gfxCoreHelper.isBufferSizeSuitableForCompression(size));
} }
} }
} }