LoopAtPlatformInitialize renamed to LoopAtDriverInit and triggers earlier
Related-To: NEO-4526 Change-Id: I13067badfbaf9f46c993b08126fb35e53d68f6d3
This commit is contained in:
parent
acfa007d30
commit
fd195f0967
|
@ -1,5 +1,5 @@
|
||||||
#!groovy
|
#!groovy
|
||||||
dependenciesRevision='e567b2628eb89b67c064470d719f694138cd0873-1407'
|
dependenciesRevision='e567b2628eb89b67c064470d719f694138cd0873-1407'
|
||||||
strategy='EQUAL'
|
strategy='EQUAL'
|
||||||
allowedCD=246
|
allowedCD=247
|
||||||
allowedF=20
|
allowedF=20
|
||||||
|
|
|
@ -113,11 +113,6 @@ bool Platform::initialize(std::vector<std::unique_ptr<Device>> devices) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DebugManager.flags.LoopAtPlatformInitialize.get()) {
|
|
||||||
while (DebugManager.flags.LoopAtPlatformInitialize.get())
|
|
||||||
this->initializationLoopHelper();
|
|
||||||
}
|
|
||||||
|
|
||||||
state = StateIniting;
|
state = StateIniting;
|
||||||
|
|
||||||
DEBUG_BREAK_IF(this->platformInfo);
|
DEBUG_BREAK_IF(this->platformInfo);
|
||||||
|
|
|
@ -67,7 +67,6 @@ class Platform : public BaseObject<_cl_platform_id> {
|
||||||
};
|
};
|
||||||
cl_uint state = StateNone;
|
cl_uint state = StateNone;
|
||||||
void fillGlobalDispatchTable();
|
void fillGlobalDispatchTable();
|
||||||
MOCKABLE_VIRTUAL void initializationLoopHelper(){};
|
|
||||||
std::unique_ptr<PlatformInfo> platformInfo;
|
std::unique_ptr<PlatformInfo> platformInfo;
|
||||||
ClDeviceVector clDevices;
|
ClDeviceVector clDevices;
|
||||||
ExecutionEnvironment &executionEnvironment;
|
ExecutionEnvironment &executionEnvironment;
|
||||||
|
|
|
@ -15,7 +15,6 @@ namespace NEO {
|
||||||
class MockPlatform : public Platform {
|
class MockPlatform : public Platform {
|
||||||
public:
|
public:
|
||||||
using Platform::fillGlobalDispatchTable;
|
using Platform::fillGlobalDispatchTable;
|
||||||
using Platform::initializationLoopHelper;
|
|
||||||
MockPlatform() : MockPlatform(*(new ExecutionEnvironment())) {}
|
MockPlatform() : MockPlatform(*(new ExecutionEnvironment())) {}
|
||||||
MockPlatform(ExecutionEnvironment &executionEnvironment) : Platform(executionEnvironment) {}
|
MockPlatform(ExecutionEnvironment &executionEnvironment) : Platform(executionEnvironment) {}
|
||||||
bool initializeWithNewDevices();
|
bool initializeWithNewDevices();
|
||||||
|
|
|
@ -358,11 +358,6 @@ TEST(PlatformConstructionTest, givenPlatformConstructorWhenItIsCalledAfterResetT
|
||||||
platformsImpl.clear();
|
platformsImpl.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PlatformInitLoopTests, givenPlatformWhenInitLoopHelperIsCalledThenItDoesNothing) {
|
|
||||||
MockPlatform platform;
|
|
||||||
platform.initializationLoopHelper();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(PlatformInitTest, givenNullptrDeviceInPassedDeviceVectorWhenInitializePlatformThenExceptionIsThrown) {
|
TEST(PlatformInitTest, givenNullptrDeviceInPassedDeviceVectorWhenInitializePlatformThenExceptionIsThrown) {
|
||||||
std::vector<std::unique_ptr<Device>> devices;
|
std::vector<std::unique_ptr<Device>> devices;
|
||||||
devices.push_back(nullptr);
|
devices.push_back(nullptr);
|
||||||
|
@ -388,23 +383,6 @@ TEST(PlatformInitTest, givenSingleDeviceWithNonZeroRootDeviceIndexInPassedDevice
|
||||||
EXPECT_EQ(2u, platform()->getClDevice(0)->getRootDeviceIndex());
|
EXPECT_EQ(2u, platform()->getClDevice(0)->getRootDeviceIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PlatformInitLoopTests, givenPlatformWithDebugSettingWhenInitIsCalledThenItEntersEndlessLoop) {
|
|
||||||
DebugManagerStateRestore stateRestore;
|
|
||||||
DebugManager.flags.LoopAtPlatformInitialize.set(true);
|
|
||||||
bool called = false;
|
|
||||||
struct mockPlatform : public MockPlatform {
|
|
||||||
mockPlatform(bool &called) : called(called){};
|
|
||||||
void initializationLoopHelper() override {
|
|
||||||
DebugManager.flags.LoopAtPlatformInitialize.set(false);
|
|
||||||
called = true;
|
|
||||||
}
|
|
||||||
bool &called;
|
|
||||||
};
|
|
||||||
mockPlatform platform(called);
|
|
||||||
platform.initializeWithNewDevices();
|
|
||||||
EXPECT_TRUE(called);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(PlatformGroupDevicesTest, whenMultipleDevicesAreCreatedThenGroupDevicesCreatesVectorPerEachProductFamily) {
|
TEST(PlatformGroupDevicesTest, whenMultipleDevicesAreCreatedThenGroupDevicesCreatesVectorPerEachProductFamily) {
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
const size_t numRootDevices = 5u;
|
const size_t numRootDevices = 5u;
|
||||||
|
|
|
@ -89,7 +89,7 @@ RebuildPrecompiledKernels = 0
|
||||||
CreateMultipleRootDevices = 0
|
CreateMultipleRootDevices = 0
|
||||||
CreateMultipleSubDevices = 0
|
CreateMultipleSubDevices = 0
|
||||||
EnableExperimentalCommandBuffer = 0
|
EnableExperimentalCommandBuffer = 0
|
||||||
LoopAtPlatformInitialize = 0
|
LoopAtDriverInit = 0
|
||||||
EnableTimestampPacket = -1
|
EnableTimestampPacket = -1
|
||||||
ReturnRawGpuTimestamps = 0
|
ReturnRawGpuTimestamps = 0
|
||||||
DoNotRegisterTrimCallback = 0
|
DoNotRegisterTrimCallback = 0
|
||||||
|
|
|
@ -33,6 +33,9 @@ DebugSettingsManager<DebugLevel>::DebugSettingsManager(const char *registryPath)
|
||||||
dumpFlags();
|
dumpFlags();
|
||||||
}
|
}
|
||||||
translateDebugSettings(flags);
|
translateDebugSettings(flags);
|
||||||
|
|
||||||
|
while (isLoopAtDriverInitEnabled())
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <DebugFunctionalityLevel DebugLevel>
|
template <DebugFunctionalityLevel DebugLevel>
|
||||||
|
|
|
@ -106,6 +106,10 @@ class DebugSettingsManager {
|
||||||
std::mutex mtx;
|
std::mutex mtx;
|
||||||
std::string logFileName;
|
std::string logFileName;
|
||||||
|
|
||||||
|
bool isLoopAtDriverInitEnabled() const {
|
||||||
|
auto loopingEnabled = flags.LoopAtDriverInit.get();
|
||||||
|
return loopingEnabled;
|
||||||
|
}
|
||||||
template <typename DataType>
|
template <typename DataType>
|
||||||
static void dumpNonDefaultFlag(const char *variableName, const DataType &variableValue, const DataType &defaultValue);
|
static void dumpNonDefaultFlag(const char *variableName, const DataType &variableValue, const DataType &defaultValue);
|
||||||
void dumpFlags() const;
|
void dumpFlags() const;
|
||||||
|
|
|
@ -54,7 +54,7 @@ DECLARE_DEBUG_VARIABLE(bool, DisableResourceRecycling, false, "when set to true
|
||||||
DECLARE_DEBUG_VARIABLE(bool, ForceDispatchScheduler, false, "dispatches scheduler kernel instead of kernel enqueued")
|
DECLARE_DEBUG_VARIABLE(bool, ForceDispatchScheduler, false, "dispatches scheduler kernel instead of kernel enqueued")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, TrackParentEvents, false, "events track their parents")
|
DECLARE_DEBUG_VARIABLE(bool, TrackParentEvents, false, "events track their parents")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, RebuildPrecompiledKernels, false, "forces driver to recompile precompiled kernels from sources")
|
DECLARE_DEBUG_VARIABLE(bool, RebuildPrecompiledKernels, false, "forces driver to recompile precompiled kernels from sources")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, LoopAtPlatformInitialize, false, "Adds endless loop in platform initalize, useful for debugging.")
|
DECLARE_DEBUG_VARIABLE(bool, LoopAtDriverInit, false, "Adds endless loop in DebugSettingsManager constructor, useful for debugging.")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, DoNotRegisterTrimCallback, false, "When set to true driver is not registering trim callback.")
|
DECLARE_DEBUG_VARIABLE(bool, DoNotRegisterTrimCallback, false, "When set to true driver is not registering trim callback.")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, OverrideInvalidEngineWithDefault, false, "When set to true driver chooses engine 0 if no engine is found.")
|
DECLARE_DEBUG_VARIABLE(bool, OverrideInvalidEngineWithDefault, false, "When set to true driver chooses engine 0 if no engine is found.")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, DisableAuxTranslation, false, "Disable aux translation when required by Kernel.")
|
DECLARE_DEBUG_VARIABLE(bool, DisableAuxTranslation, false, "Disable aux translation when required by Kernel.")
|
||||||
|
|
|
@ -116,7 +116,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThe
|
||||||
testing::internal::CaptureStdout();
|
testing::internal::CaptureStdout();
|
||||||
FullyEnabledTestDebugManager debugManager;
|
FullyEnabledTestDebugManager debugManager;
|
||||||
debugManager.flags.PrintDebugSettings.set(true);
|
debugManager.flags.PrintDebugSettings.set(true);
|
||||||
debugManager.flags.LoopAtPlatformInitialize.set(true);
|
debugManager.flags.LoopAtDriverInit.set(true);
|
||||||
debugManager.flags.Enable64kbpages.set(1);
|
debugManager.flags.Enable64kbpages.set(1);
|
||||||
debugManager.flags.TbxServer.set("192.168.0.1");
|
debugManager.flags.TbxServer.set("192.168.0.1");
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThe
|
||||||
ASSERT_NE(0u, output.size());
|
ASSERT_NE(0u, output.size());
|
||||||
|
|
||||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: TbxServer = 192.168.0.1"));
|
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: TbxServer = 192.168.0.1"));
|
||||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: LoopAtPlatformInitialize = 1"));
|
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: LoopAtDriverInit = 1"));
|
||||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: PrintDebugSettings = 1"));
|
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: PrintDebugSettings = 1"));
|
||||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: Enable64kbpages = 1"));
|
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: Enable64kbpages = 1"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue