Enable stateless compression on xehp

Related-To: NEO-5107

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-08-03 08:24:06 +00:00
committed by Compute-Runtime-Automation
parent 2dd0e67e65
commit e5237c2368
11 changed files with 88 additions and 1 deletions

View File

@ -9,6 +9,10 @@
#include "shared/source/helpers/api_specific_config.h"
namespace NEO {
bool ApiSpecificConfig::isStatelessCompressionSupported() {
return false;
}
bool ApiSpecificConfig::getHeapConfiguration() {
return DebugManager.flags.UseExternalAllocatorForSshAndDsh.get();
}

View File

@ -635,6 +635,11 @@ TEST_F(DeviceTest, givenCallToDevicePropertiesThenMaximumMemoryToBeAllocatedIsCo
EXPECT_EQ(deviceProperties.maxMemAllocSize, expectedSize);
}
TEST_F(DeviceTest, whenCheckingIfStatelessCompressionIsSupportedThenReturnFalse) {
auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
EXPECT_FALSE(hwHelper.allowStatelessCompression(*defaultHwInfo));
}
struct DeviceHwInfoTest : public ::testing::Test {
void SetUp() override {
executionEnvironment = new NEO::ExecutionEnvironment();

View File

@ -19,4 +19,8 @@ TEST(ApiSpecificConfigL0Tests, WhenGettingAUBPrefixByApiTypeL0IsReturned) {
EXPECT_EQ(0, strcmp("l0_", ApiSpecificConfig::getAubPrefixForSpecificApi()));
}
TEST(ApiSpecificConfigL0Tests, WhenCheckingIfStatelessCompressionIsSupportedThenReturnFalse) {
EXPECT_FALSE(ApiSpecificConfig::isStatelessCompressionSupported());
}
} // namespace NEO

View File

@ -9,9 +9,14 @@
#include "shared/source/helpers/api_specific_config.h"
namespace NEO {
bool ApiSpecificConfig::isStatelessCompressionSupported() {
return true;
}
bool ApiSpecificConfig::getHeapConfiguration() {
return false;
}
bool ApiSpecificConfig::getBindlessConfiguration() {
if (DebugManager.flags.UseBindlessMode.get() != -1) {
return DebugManager.flags.UseBindlessMode.get();
@ -19,6 +24,7 @@ bool ApiSpecificConfig::getBindlessConfiguration() {
return false;
}
}
ApiSpecificConfig::ApiType ApiSpecificConfig::getApiType() {
return ApiSpecificConfig::OCL;
}

View File

@ -19,4 +19,8 @@ TEST(ApiSpecificConfigL0Tests, WhenGettingAUBPrefixByApiTypeOCLIsReturned) {
EXPECT_EQ(0, strcmp("ocl_", ApiSpecificConfig::getAubPrefixForSpecificApi()));
}
TEST(ApiSpecificConfigL0Tests, WhenCheckingIfStatelessCompressionIsSupportedThenReturnTrue) {
EXPECT_TRUE(ApiSpecificConfig::isStatelessCompressionSupported());
}
} // namespace NEO

View File

@ -265,6 +265,7 @@ ForceMemoryBankIndexOverride = -1
ExperimentalSynchronizeWithSemaphores = -1
ExperimentalForceCrossAtomicSynchronization = -1
EnableStatelessCompression = -1
EnableMultiTileCompression = -1
EnablePrivateScratchSlot1 = -1
DisablePipeControlPrecedingPostSyncCommand = -1
UseClearColorAllocationForBlitter = false

View File

@ -61,6 +61,46 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXE_HP_COREWhenEnableStatelessComp
EXPECT_FALSE(clHwHelper.requiresAuxResolves(kernelInfo, *defaultHwInfo));
}
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenGenHelperWhenRevisionIsAtLeastBThenAllowStatelessCompression) {
DebugManagerStateRestore restore;
DebugManager.flags.CreateMultipleSubDevices.set(1);
auto &hwHelper = HwHelper::get(renderCoreFamily);
auto hwInfo = *defaultHwInfo;
for (auto revision : {REVISION_A0, REVISION_A1, REVISION_B}) {
hwInfo.platform.usRevId = hwHelper.getHwRevIdFromStepping(revision, hwInfo);
if (revision < REVISION_B) {
EXPECT_FALSE(hwHelper.allowStatelessCompression(hwInfo));
} else {
EXPECT_TRUE(hwHelper.allowStatelessCompression(hwInfo));
}
}
}
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenGenHelperWhenCreateMultipleSubDevicesThenDontAllowStatelessCompression) {
DebugManagerStateRestore restore;
DebugManager.flags.CreateMultipleSubDevices.set(2);
auto &hwHelper = HwHelper::get(renderCoreFamily);
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = hwHelper.getHwRevIdFromStepping(REVISION_B, hwInfo);
EXPECT_FALSE(hwHelper.allowStatelessCompression(hwInfo));
}
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenGenHelperWhenCreateMultipleSubDevicesAndEnableMultitileCompressionThenAllowStatelessCompression) {
DebugManagerStateRestore restore;
DebugManager.flags.CreateMultipleSubDevices.set(4);
DebugManager.flags.EnableMultiTileCompression.set(1);
auto &hwHelper = HwHelper::get(renderCoreFamily);
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = hwHelper.getHwRevIdFromStepping(REVISION_B, hwInfo);
EXPECT_TRUE(hwHelper.allowStatelessCompression(hwInfo));
}
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForRenderCompression) {
DebugManagerStateRestore restore;
DebugManager.flags.EnableStatelessCompression.set(1);

View File

@ -152,7 +152,8 @@ DECLARE_DEBUG_VARIABLE(int32_t, ForceExecutionTile, -1, "-1: default, 0+: given
DECLARE_DEBUG_VARIABLE(int32_t, OverrideTimestampPacketSize, -1, "-1: default, >0: size in bytes. 4 and 8 supported for experiments")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideMaxWorkGroupCount, -1, "-1: default, >0: Max WG size")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideCmdQueueSynchronousMode, -1, "Overrides all command queues synchronous mode: -1: do not override, 0: implicit driver behavior, 1: synchronous, 2: asynchronous")
DECLARE_DEBUG_VARIABLE(int64_t, EnableStatelessCompression, -1, "-1: default, 0: disable, 1: Enable E2EC in SBA for all stateless accesses")
DECLARE_DEBUG_VARIABLE(int32_t, EnableStatelessCompression, -1, "-1: default, 0: disable, 1: Enable E2EC in SBA for all stateless accesses")
DECLARE_DEBUG_VARIABLE(int32_t, EnableMultiTileCompression, -1, "-1: default, 0: disable, 1: enable, Enables compression in multi tile scenarios.")
/*LOGGING FLAGS*/
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")

View File

@ -10,6 +10,7 @@ namespace NEO {
struct ApiSpecificConfig {
enum ApiType { OCL,
L0 };
static bool isStatelessCompressionSupported();
static bool getHeapConfiguration();
static bool getBindlessConfiguration();
static ApiType getApiType();

View File

@ -10,6 +10,7 @@
using Family = NEO::XeHpFamily;
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/extra_allocation_data_xehp_plus.inl"
#include "shared/source/helpers/flat_batch_buffer_helper_hw.inl"
@ -121,6 +122,23 @@ inline bool HwHelperHw<Family>::allowRenderCompression(const HardwareInfo &hwInf
return true;
}
template <>
inline bool HwHelperHw<Family>::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());
}
if (HwHelper::getSubDevicesCount(&hwInfo) > 1) {
return DebugManager.flags.EnableMultiTileCompression.get() > 0 ? true : false;
}
if (hwInfo.platform.usRevId < getHwRevIdFromStepping(REVISION_B, hwInfo)) {
return false;
}
return true;
}
template <>
bool HwHelperHw<Family>::isBankOverrideRequired(const HardwareInfo &hwInfo) const {

View File

@ -9,6 +9,9 @@
#include "shared/source/helpers/api_specific_config.h"
namespace NEO {
bool ApiSpecificConfig::isStatelessCompressionSupported() {
return false;
}
bool ApiSpecificConfig::getHeapConfiguration() {
return DebugManager.flags.UseExternalAllocatorForSshAndDsh.get();
}