performance: enable idle csr detection in ULLS controller

Related-To: NEO-12991

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-10-23 09:45:15 +00:00
committed by Compute-Runtime-Automation
parent e60f3d931b
commit fca544b178
2 changed files with 21 additions and 4 deletions

View File

@@ -676,7 +676,6 @@ struct TagUpdateMockCommandStreamReceiver : public MockCommandStreamReceiver {
struct DirectSubmissionIdleDetectionTests : public ::testing::Test {
void SetUp() override {
debugManager.flags.DirectSubmissionControllerIdleDetection.set(true);
controller = std::make_unique<DirectSubmissionControllerMock>();
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.initializeMemoryManager();
@@ -699,8 +698,6 @@ struct DirectSubmissionIdleDetectionTests : public ::testing::Test {
controller->unregisterDirectSubmission(csr.get());
}
DebugManagerStateRestore restorer;
MockExecutionEnvironment executionEnvironment;
std::unique_ptr<OsContext> osContext;
std::unique_ptr<TagUpdateMockCommandStreamReceiver> csr;
@@ -749,4 +746,24 @@ TEST_F(DirectSubmissionIdleDetectionTests, givenLatestFlushedTaskLowerThanTaskCo
EXPECT_EQ(1u, csr->flushTagUpdateCalledTimes);
}
TEST_F(DirectSubmissionIdleDetectionTests, givenDebugFlagSetWhenTaskCountNotUpdatedAndGpuBusyThenTerminateDirectSubmission) {
DebugManagerStateRestore restorer;
debugManager.flags.DirectSubmissionControllerIdleDetection.set(false);
controller->unregisterDirectSubmission(csr.get());
controller = std::make_unique<DirectSubmissionControllerMock>();
controller->timeoutElapsedReturnValue.store(true);
controller->registerDirectSubmission(csr.get());
csr->taskCount.store(10u);
controller->checkNewSubmissions();
csr->setLatestFlushedTaskCount(10u);
csr->isBusyReturnValue = true;
controller->checkNewSubmissions();
EXPECT_TRUE(controller->directSubmissions[csr.get()].isStopped);
EXPECT_EQ(controller->directSubmissions[csr.get()].taskCount, 10u);
EXPECT_EQ(1u, csr->stopDirectSubmissionCalledTimes);
EXPECT_EQ(0u, csr->flushTagUpdateCalledTimes);
}
} // namespace NEO