BCS round robin adjustments

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2022-02-28 12:25:36 +00:00
committed by Compute-Runtime-Automation
parent b9d8d8c0fd
commit b096422e78
4 changed files with 222 additions and 2 deletions

View File

@@ -354,6 +354,9 @@ DECLARE_DEBUG_VARIABLE(int32_t, SetKmdWaitTimeout, -1, "-1: default (infinity),
DECLARE_DEBUG_VARIABLE(int32_t, OverrideNotifyEnableForTagUpdatePostSync, -1, "-1: default (usage determined by user fence wait call), 0: disable use of NotifyEnable flag, 1: enable use NotifyEnable flag")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindEngineAssign, -1, "-1: default, 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssign, -1, "-1: default, 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssignLimit, -1, "-1: default, >=0: round robin limit")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssignStartingValue, -1, "-1: default, >=0: round robin starting point")
DECLARE_DEBUG_VARIABLE(int32_t, ForceBCSForInternalCopyEngine, -1, "-1: default, do not force, 0: main copy engine, 1: copy engine index")
DECLARE_DEBUG_VARIABLE(int32_t, Force32BitDriverSupport, -1, "-1: default, 0: disable, 1: enable, Forces the driver to support 32 bit.")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicPipelineSelect, -1, "set SYSTOLIC MODE ENABLE in PIPELINE_SELECT cmd, -1:default, 0:disable, 1:enable")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicInComputeWalker, -1, "set SYSTOLIC MODE ENABLE in COMPUTE_WALKER cmd, -1:default, 0:disable, 1:enable")

View File

@@ -90,6 +90,10 @@ aub_stream::EngineType getBcsEngineType(const HardwareInfo &hwInfo, const Device
}
if (internalUsage) {
if (DebugManager.flags.ForceBCSForInternalCopyEngine.get() != -1) {
return DebugManager.flags.ForceBCSForInternalCopyEngine.get() == 0 ? aub_stream::EngineType::ENGINE_BCS
: static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + DebugManager.flags.ForceBCSForInternalCopyEngine.get() - 1);
}
return selectLinkCopyEngine(hwInfo, deviceBitfield, selectorCopyEngine.selector);
}
@@ -161,9 +165,40 @@ aub_stream::EngineType selectLinkCopyEngine(const HardwareInfo &hwInfo, const De
if (enableCmdQRoundRobindBcsEngineAssign) {
aub_stream::EngineType engineType;
auto bcsRoundRobinLimit = EngineHelpers::numLinkedCopyEngines;
auto engineOffset = 0u;
auto mainCE = false;
if (DebugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.get() != -1) {
engineOffset = DebugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.get();
mainCE = engineOffset == 0;
}
if (mainCE) {
bcsRoundRobinLimit++;
}
if (DebugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.get() != -1) {
bcsRoundRobinLimit = DebugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.get();
}
do {
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + (selectorCopyEngine.fetch_add(1u) % EngineHelpers::numLinkedCopyEngines));
} while (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSubDeviceEngineSupported(hwInfo, deviceBitfield, engineType) || !hwInfo.featureTable.ftrBcsInfo.test(engineType - aub_stream::EngineType::ENGINE_BCS1 + 1));
auto selectEngineValue = (selectorCopyEngine.fetch_add(1u) % bcsRoundRobinLimit) + engineOffset;
if (mainCE) {
if (selectEngineValue == 0u) {
engineType = aub_stream::EngineType::ENGINE_BCS;
} else {
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + selectEngineValue - 1);
}
} else {
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + selectEngineValue);
}
} while (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSubDeviceEngineSupported(hwInfo, deviceBitfield, engineType) || !hwInfo.featureTable.ftrBcsInfo.test(engineType == aub_stream::EngineType::ENGINE_BCS
? 0
: engineType - aub_stream::EngineType::ENGINE_BCS1 + 1));
return engineType;
}