feature: debug flag to enable/disable AIL

Related-to: NEO-8049

Signed-off-by: Wilma, Pawel <pawel.wilma@intel.com>
This commit is contained in:
Wilma, Pawel 2023-07-06 10:05:58 +00:00 committed by Compute-Runtime-Automation
parent 9524b65b51
commit 39b25abf0e
4 changed files with 62 additions and 0 deletions

View File

@ -464,6 +464,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, CompactL3FlushEventPacket, -1, "Compact COMPUTE_
DECLARE_DEBUG_VARIABLE(int32_t, UseDynamicEventPacketsCount, -1, "Use dynamic estimation for event packet count based on a given device configuration, -1: default , 0: disabled, 1: enabled")
DECLARE_DEBUG_VARIABLE(int32_t, SignalAllEventPackets, -1, "All packets of event are signaled, reset and waited/synchronized, -1: default, 0: disabled, 1: enabled")
DECLARE_DEBUG_VARIABLE(int32_t, EnableBcsSwControlWa, -1, "Enable BCS WA via BCSSWCONTROL MMIO. -1: default, 0: disabled, 1: if src in system mem, 2: if dst in system mem, 3: if src and dst in system mem, 4: always")
DECLARE_DEBUG_VARIABLE(bool, EnableAIL, true, "Enables AIL")
/* IMPLICIT SCALING */
DECLARE_DEBUG_VARIABLE(int32_t, EnableWalkerPartition, -1, "-1: default, 0: disable, 1: enable, Enables Walker Partitioning via WPARID.")

View File

@ -108,6 +108,9 @@ void RootDeviceEnvironment::prepareForCleanup() const {
}
bool RootDeviceEnvironment::initAilConfiguration() {
if (!DebugManager.flags.EnableAIL.get()) {
return true;
}
auto ailConfiguration = AILConfiguration::get(hwInfo->platform.eProductFamily);
if (ailConfiguration == nullptr) {

View File

@ -544,4 +544,5 @@ CommandListTimestampRefreshIntervalInMilliSec = -1
SynchronizeEventBeforeReset = -1
RemoveRestrictionsOnNumberOfThreadsInGpgpuThreadGroup = 0
SkipDcFlushOnBarrierWithoutEvents = -1
EnableAIL=1
# Please don't edit below this line

View File

@ -6,8 +6,10 @@
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/helpers/variable_backup.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/hw_test.h"
namespace NEO {
@ -161,4 +163,59 @@ HWTEST2_F(AILTests, givenPreGen12AndAndProcessNameIsNotResolveWhenApplyWithDavin
EXPECT_TRUE(rtTable.hostPtrTrackingEnabled);
}
class MockAILConfiguration : public AILConfiguration {
public:
bool initProcessExecutableName() override {
initCalled = true;
return true;
}
bool initCalled = false;
void modifyKernelIfRequired(std::string &kernel) override {}
bool isFallbackToPatchtokensRequired(const std::string &kernelSources) override {
return false;
}
protected:
void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override {}
};
HWTEST_F(AILTests, whenAilIsDisabledByDebugVariableThenAilIsNotInitialized) {
DebugManagerStateRestore restore;
NEO::DebugManager.flags.EnableAIL.set(false);
VariableBackup<AILConfiguration *> ailConfigurationBackup(&ailConfigurationTable[productFamily]);
MockAILConfiguration ailConfig;
ailConfigurationTable[productFamily] = &ailConfig;
HardwareInfo hwInfo{};
hwInfo.platform.eProductFamily = productFamily;
hwInfo.platform.eRenderCoreFamily = renderCoreFamily;
NEO::MockExecutionEnvironment executionEnvironment{&hwInfo, true, 1};
auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get();
rootDeviceEnvironment->initAilConfiguration();
EXPECT_EQ(false, ailConfig.initCalled);
}
HWTEST_F(AILTests, whenAilIsEnabledByDebugVariableThenAilIsInitialized) {
DebugManagerStateRestore restore;
NEO::DebugManager.flags.EnableAIL.set(true);
VariableBackup<AILConfiguration *> ailConfigurationBackup(&ailConfigurationTable[productFamily]);
MockAILConfiguration ailConfig;
ailConfigurationTable[productFamily] = &ailConfig;
HardwareInfo hwInfo{};
hwInfo.platform.eProductFamily = productFamily;
hwInfo.platform.eRenderCoreFamily = renderCoreFamily;
NEO::MockExecutionEnvironment executionEnvironment{&hwInfo, true, 1};
auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get();
rootDeviceEnvironment->initAilConfiguration();
EXPECT_EQ(true, ailConfig.initCalled);
}
} // namespace NEO