diff --git a/Jenkinsfile b/Jenkinsfile index 49b00e29e1..feed4da915 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!groovy dependenciesRevision='e567b2628eb89b67c064470d719f694138cd0873-1407' strategy='EQUAL' -allowedCD=246 +allowedCD=247 allowedF=20 diff --git a/opencl/source/platform/platform.cpp b/opencl/source/platform/platform.cpp index a10293a314..351137b1ad 100644 --- a/opencl/source/platform/platform.cpp +++ b/opencl/source/platform/platform.cpp @@ -113,11 +113,6 @@ bool Platform::initialize(std::vector> devices) { return true; } - if (DebugManager.flags.LoopAtPlatformInitialize.get()) { - while (DebugManager.flags.LoopAtPlatformInitialize.get()) - this->initializationLoopHelper(); - } - state = StateIniting; DEBUG_BREAK_IF(this->platformInfo); diff --git a/opencl/source/platform/platform.h b/opencl/source/platform/platform.h index 6e2b1b82c8..7860ea7991 100644 --- a/opencl/source/platform/platform.h +++ b/opencl/source/platform/platform.h @@ -67,7 +67,6 @@ class Platform : public BaseObject<_cl_platform_id> { }; cl_uint state = StateNone; void fillGlobalDispatchTable(); - MOCKABLE_VIRTUAL void initializationLoopHelper(){}; std::unique_ptr platformInfo; ClDeviceVector clDevices; ExecutionEnvironment &executionEnvironment; diff --git a/opencl/test/unit_test/mocks/mock_platform.h b/opencl/test/unit_test/mocks/mock_platform.h index 7ccc6ec6ee..fda8ebcd2f 100644 --- a/opencl/test/unit_test/mocks/mock_platform.h +++ b/opencl/test/unit_test/mocks/mock_platform.h @@ -15,7 +15,6 @@ namespace NEO { class MockPlatform : public Platform { public: using Platform::fillGlobalDispatchTable; - using Platform::initializationLoopHelper; MockPlatform() : MockPlatform(*(new ExecutionEnvironment())) {} MockPlatform(ExecutionEnvironment &executionEnvironment) : Platform(executionEnvironment) {} bool initializeWithNewDevices(); diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index 38c77e02f9..d496a0a2e4 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -358,11 +358,6 @@ TEST(PlatformConstructionTest, givenPlatformConstructorWhenItIsCalledAfterResetT platformsImpl.clear(); } -TEST(PlatformInitLoopTests, givenPlatformWhenInitLoopHelperIsCalledThenItDoesNothing) { - MockPlatform platform; - platform.initializationLoopHelper(); -} - TEST(PlatformInitTest, givenNullptrDeviceInPassedDeviceVectorWhenInitializePlatformThenExceptionIsThrown) { std::vector> devices; devices.push_back(nullptr); @@ -388,23 +383,6 @@ TEST(PlatformInitTest, givenSingleDeviceWithNonZeroRootDeviceIndexInPassedDevice 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) { DebugManagerStateRestore restorer; const size_t numRootDevices = 5u; diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index 84e7abc375..622a557d32 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -89,7 +89,7 @@ RebuildPrecompiledKernels = 0 CreateMultipleRootDevices = 0 CreateMultipleSubDevices = 0 EnableExperimentalCommandBuffer = 0 -LoopAtPlatformInitialize = 0 +LoopAtDriverInit = 0 EnableTimestampPacket = -1 ReturnRawGpuTimestamps = 0 DoNotRegisterTrimCallback = 0 diff --git a/shared/source/debug_settings/debug_settings_manager.cpp b/shared/source/debug_settings/debug_settings_manager.cpp index 3bf62568f9..bafc9dba61 100644 --- a/shared/source/debug_settings/debug_settings_manager.cpp +++ b/shared/source/debug_settings/debug_settings_manager.cpp @@ -33,6 +33,9 @@ DebugSettingsManager::DebugSettingsManager(const char *registryPath) dumpFlags(); } translateDebugSettings(flags); + + while (isLoopAtDriverInitEnabled()) + ; } template diff --git a/shared/source/debug_settings/debug_settings_manager.h b/shared/source/debug_settings/debug_settings_manager.h index 807b62a81b..b6386f81cf 100644 --- a/shared/source/debug_settings/debug_settings_manager.h +++ b/shared/source/debug_settings/debug_settings_manager.h @@ -106,6 +106,10 @@ class DebugSettingsManager { std::mutex mtx; std::string logFileName; + bool isLoopAtDriverInitEnabled() const { + auto loopingEnabled = flags.LoopAtDriverInit.get(); + return loopingEnabled; + } template static void dumpNonDefaultFlag(const char *variableName, const DataType &variableValue, const DataType &defaultValue); void dumpFlags() const; diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index d36ab59f6c..aa88aa5086 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -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, TrackParentEvents, false, "events track their parents") 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, 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.") diff --git a/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp b/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp index 6baa534fe8..7e855a172f 100644 --- a/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp +++ b/shared/test/unit_test/debug_settings/debug_settings_manager_tests.cpp @@ -116,7 +116,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThe testing::internal::CaptureStdout(); FullyEnabledTestDebugManager debugManager; debugManager.flags.PrintDebugSettings.set(true); - debugManager.flags.LoopAtPlatformInitialize.set(true); + debugManager.flags.LoopAtDriverInit.set(true); debugManager.flags.Enable64kbpages.set(1); debugManager.flags.TbxServer.set("192.168.0.1"); @@ -136,7 +136,7 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThe 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: 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: Enable64kbpages = 1")); }