Enable flush task for immediate command lists

Enabling for all platforms

Related-To: LOCI-3379

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2022-10-17 23:50:15 +00:00
committed by Compute-Runtime-Automation
parent 565d820933
commit a4eb78d524
6 changed files with 14 additions and 21 deletions

View File

@@ -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);

View File

@@ -1093,16 +1093,15 @@ HWTEST2_F(CommandListCreate, GivenGpuHangOnExecutingCommandListsWhenCreatingImme
ASSERT_EQ(static_cast<DeviceImp *>(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csr);
MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
Mock<CommandQueue> 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<DeviceImp *>(device)->getNEODevice()->getDefaultEngine().commandStreamReceiver, eventObject->csr);
MockCommandStreamReceiver mockCommandStreamReceiver(*neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
Mock<CommandQueue> 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) {

View File

@@ -262,7 +262,7 @@ HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenXeHPCommandListIsIniti
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue));
EXPECT_EQ(false, commandList->isFlushTaskSubmissionEnabled);
EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled);
}
using MatchXeHpc = IsGfxCore<IGFX_XE_HPC_CORE>;
@@ -279,7 +279,7 @@ HWTEST2_F(CommandListImmediateFlushTaskComputeTests, givenCommandListIsInititali
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> 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) {

View File

@@ -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 {

View File

@@ -345,7 +345,7 @@ bool HwInfoConfigHw<gfxProduct>::getUuid(Device *device, std::array<uint8_t, HwI
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return false;
return true;
}
template <PRODUCT_FAMILY gfxProduct>

View File

@@ -79,10 +79,5 @@ uint32_t HwInfoConfigHw<gfxProduct>::getDeviceMemoryMaxClkRate(const HardwareInf
return 2800u;
}
template <>
bool HwInfoConfigHw<gfxProduct>::isFlushTaskAllowed() const {
return false;
}
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO