diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index 8930e11f22..217b2af826 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -134,6 +134,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device if (NEO::DebugManager.flags.EnableFlushTaskSubmission.get() != -1) { commandList->isFlushTaskSubmissionEnabled = !!NEO::DebugManager.flags.EnableFlushTaskSubmission.get(); } + PRINT_DEBUG_STRING(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Flush Task for Immediate command list : %s\n", commandList->isFlushTaskSubmissionEnabled ? "Enabled" : "Disabled"); commandList->immediateCmdListHeapSharing = L0HwHelper::enableImmediateCmdListHeapSharing(hwInfo, commandList->isFlushTaskSubmissionEnabled); } returnValue = commandList->initialize(device, engineGroupType, desc->flags); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp index 81340363a3..15eaf7b474 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp @@ -1093,16 +1093,15 @@ HWTEST2_F(CommandListCreate, GivenGpuHangOnExecutingCommandListsWhenCreatingImme ASSERT_EQ(static_cast(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csr); MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield()); - Mock mockCommandQueue(device, &mockCommandStreamReceiver, &desc); - mockCommandQueue.executeCommandListsResult = ZE_RESULT_ERROR_DEVICE_LOST; + mockCommandStreamReceiver.waitForCompletionWithTimeoutReturnValue = WaitStatus::GpuHang; - auto oldCommandQueue = commandList->cmdQImmediate; - commandList->cmdQImmediate = &mockCommandQueue; + const auto oldCsr = commandList->csr; + commandList->csr = &mockCommandStreamReceiver; returnValue = commandList->appendWaitOnEvents(1, &event); EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, returnValue); - commandList->cmdQImmediate = oldCommandQueue; + commandList->csr = oldCsr; } TEST_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceForImmediateCommandThenNextCommandBufferIsUsed) { @@ -1167,16 +1166,14 @@ HWTEST2_F(CommandListCreate, GivenGpuHangOnSynchronizingWhenCreatingImmediateCom ASSERT_EQ(static_cast(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csr); MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield()); - Mock mockCommandQueue(device, &mockCommandStreamReceiver, &desc); - mockCommandQueue.synchronizeResult = ZE_RESULT_ERROR_DEVICE_LOST; - - auto oldCommandQueue = commandList->cmdQImmediate; - commandList->cmdQImmediate = &mockCommandQueue; + mockCommandStreamReceiver.waitForCompletionWithTimeoutReturnValue = WaitStatus::GpuHang; + const auto oldCsr = commandList->csr; + commandList->csr = &mockCommandStreamReceiver; returnValue = commandList->appendWaitOnEvents(1, &event); EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, returnValue); - commandList->cmdQImmediate = oldCommandQueue; + commandList->csr = oldCsr; } HWTEST_F(CommandListCreate, GivenGpuHangWhenCreatingImmediateCommandListAndAppendingEventResetThenDeviceLostIsReturned) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp index 2b2ac174ab..d628b27f77 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp @@ -262,7 +262,7 @@ HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenXeHPCommandListIsIniti ze_result_t returnValue; std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); - EXPECT_EQ(false, commandList->isFlushTaskSubmissionEnabled); + EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled); } using MatchXeHpc = IsGfxCore; @@ -279,7 +279,7 @@ HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenCommandListIsInititali ze_result_t returnValue; std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue)); - EXPECT_EQ(false, commandList->isFlushTaskSubmissionEnabled); + EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled); } HWTEST_F(CommandListImmediateFlushTaskComputeTests, givenFlushTaskSubmissionDisabledWhenCommandListIsInititalizedThenFlushTaskIsSetToFalse) { diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index c25e7a7a3e..bed07465f9 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1412,9 +1412,9 @@ HWTEST2_F(HwHelperTest, givenPvcHwHelperWhenGettingIsPlatformFlushTaskEnabledThe EXPECT_TRUE(hwHelper.isPlatformFlushTaskEnabled(*defaultHwInfo)); } -HWTEST2_F(HwHelperTest, givenAtMostGen12lpHwHelperWhenGettingIsPlatformFlushTaskEnabledThenFalseIsReturned, IsAtMostGen12lp) { +HWTEST2_F(HwHelperTest, givenAtMostGen12lpHwHelperWhenGettingIsPlatformFlushTaskEnabledThenTrueIsReturned, IsAtMostGen12lp) { auto &hwHelper = NEO::HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - EXPECT_FALSE(hwHelper.isPlatformFlushTaskEnabled(*defaultHwInfo)); + EXPECT_TRUE(hwHelper.isPlatformFlushTaskEnabled(*defaultHwInfo)); } struct CoherentWANotNeeded { diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 4248c45aa4..b711947fa9 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -345,7 +345,7 @@ bool HwInfoConfigHw::getUuid(Device *device, std::array bool HwInfoConfigHw::isFlushTaskAllowed() const { - return false; + return true; } template diff --git a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp index 0a32c6eb16..7fa0ffe7fc 100644 --- a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp @@ -79,10 +79,5 @@ uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInf return 2800u; } -template <> -bool HwInfoConfigHw::isFlushTaskAllowed() const { - return false; -} - template class HwInfoConfigHw; } // namespace NEO