fix: update unit tests for command list primary batch buffer

Related-To: NEO-7807

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-04-27 20:58:30 +00:00
committed by Compute-Runtime-Automation
parent 1dcab07300
commit b6b331fbe2
27 changed files with 205 additions and 35 deletions

View File

@@ -29,11 +29,6 @@ bool L0GfxCoreHelperHw<Family>::alwaysAllocateEventInLocalMem() const {
return true;
}
template <>
bool L0GfxCoreHelperHw<Family>::platformSupportsRayTracing() const {
return true;
}
template class L0GfxCoreHelperHw<Family>;
} // namespace L0

View File

@@ -265,6 +265,13 @@ void AppendFillFixture::tearDown() {
void CommandListEventUsedPacketSignalFixture::setUp() {
NEO::DebugManager.flags.SignalAllEventPackets.set(0);
NEO::DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
CommandListFixture::setUp();
}
void CommandListSecondaryBatchBufferFixture::setUp() {
NEO::DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
CommandListFixture::setUp();
}

View File

@@ -239,6 +239,12 @@ struct CommandListEventUsedPacketSignalFixture : public CommandListFixture {
DebugManagerStateRestore restorer;
};
struct CommandListSecondaryBatchBufferFixture : public CommandListFixture {
void setUp();
DebugManagerStateRestore restorer;
};
struct TbxImmediateCommandListFixture : public ModuleMutableCommandListFixture {
using EventFieldType = uint64_t;

View File

@@ -2064,6 +2064,8 @@ TEST_F(CommandListCreate, givenInvalidProductFamilyThenReturnsNullPointer) {
HWCMDTEST_F(IGFX_GEN8_CORE, CommandListCreate, whenCommandListIsCreatedThenPCAndStateBaseAddressCmdsAreAddedAndCorrectlyProgrammed) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.UseBindlessMode.set(0);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
@@ -2120,6 +2122,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandListCreate, whenCommandListIsCreatedThenPCAnd
HWCMDTEST_F(IGFX_GEN8_CORE, CommandListCreate, whenBindlessModeEnabledWhenCommandListIsCreatedThenStateBaseAddressCmdsIsNotAdded) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.UseBindlessMode.set(1);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;

View File

@@ -1313,6 +1313,9 @@ HWTEST2_F(CommandListAppendMemoryCopyBlit, whenAppendMemoryCopyBlitIsAppendedAnd
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
DebugManagerStateRestore restorer;
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
uint64_t size = 1024;
ze_result_t res = ZE_RESULT_SUCCESS;

View File

@@ -1009,6 +1009,8 @@ HWTEST2_F(CommandListStateBaseAddressGlobalStatelessTest, givenGlobalStatelessWh
auto ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(commandListImmediate->csr);
ultCsr->storeMakeResidentAllocations = true;
commandList->close();
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
auto result = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);

View File

@@ -25,6 +25,7 @@ namespace ult {
using CommandListAppendEventReset = Test<CommandListFixture>;
using CommandListAppendUsedPacketSignalEvent = Test<CommandListEventUsedPacketSignalFixture>;
using CommandListAppendEventResetSecondaryBatchBuffer = Test<CommandListSecondaryBatchBufferFixture>;
HWTEST_F(CommandListAppendEventReset, givenCmdlistWhenResetEventAppendedThenStoreDataImmIsGenerated) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
@@ -126,7 +127,7 @@ HWTEST_F(CommandListAppendEventReset, givenCmdlistWhenResetEventWithTimeStampIsA
EXPECT_EQ(1u, postSyncFound);
}
HWTEST_F(CommandListAppendEventReset, whenResetEventIsAppendedAndNoSpaceIsAvailableThenNextCommandBufferIsCreated) {
HWTEST_F(CommandListAppendEventResetSecondaryBatchBuffer, whenResetEventIsAppendedAndNoSpaceIsAvailableThenNextCommandBufferIsCreated) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;

View File

@@ -159,6 +159,10 @@ HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithThreadArbitrationPolicySe
HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenAppendingKernelThenBbEndIsAddedAndNewCmdBufferAllocated, IsAtLeastSkl) {
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
DebugManagerStateRestore restorer;
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
createKernel();
ze_result_t returnValue;

View File

@@ -1487,7 +1487,11 @@ HWTEST2_F(MultiTileCommandListAppendLaunchKernelXeHpCoreTest,
auto itorBbStart = find<MI_BATCH_BUFFER_START *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itorBbStart);
auto cmdBbStart = genCmdCast<MI_BATCH_BUFFER_START *>(*itorBbStart);
EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_SECOND_LEVEL_BATCH, cmdBbStart->getSecondLevelBatchBuffer());
if (commandList->dispatchCmdListBatchBufferAsPrimary) {
EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_FIRST_LEVEL_BATCH, cmdBbStart->getSecondLevelBatchBuffer());
} else {
EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_SECOND_LEVEL_BATCH, cmdBbStart->getSecondLevelBatchBuffer());
}
}
} // namespace ult

View File

@@ -26,6 +26,7 @@ namespace ult {
using CommandListAppendWaitOnEvent = Test<CommandListFixture>;
using CommandListAppendWaitOnUsedPacketSignalEvent = Test<CommandListEventUsedPacketSignalFixture>;
using CommandListAppendWaitOnSecondaryBatchBufferEvent = Test<CommandListSecondaryBatchBufferFixture>;
HWTEST_F(CommandListAppendWaitOnEvent, WhenAppendingWaitOnEventThenSemaphoreWaitCmdIsGenerated) {
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
@@ -521,7 +522,7 @@ HWTEST2_F(CommandListAppendWaitOnEvent, givenCommandListWhenAppendWriteGlobalTim
ASSERT_TRUE(postSyncFound);
}
HWTEST_F(CommandListAppendWaitOnEvent, givenCommandBufferIsEmptyWhenAppendingWaitOnEventThenAllocateNewCommandBuffer) {
HWTEST_F(CommandListAppendWaitOnSecondaryBatchBufferEvent, givenCommandBufferIsEmptyWhenAppendingWaitOnEventThenAllocateNewCommandBuffer) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;

View File

@@ -33,6 +33,7 @@ using CommandListTests = Test<DeviceFixture>;
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandListTests, whenCommandListIsCreatedThenPCAndStateBaseAddressCmdsAreAddedAndCorrectlyProgrammed) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableStateBaseAddressTracking.set(0);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
@@ -96,6 +97,7 @@ HWTEST2_F(CommandListTests, whenCommandListIsCreatedAndProgramExtendedPipeContro
DebugManagerStateRestore restorer;
DebugManager.flags.EnableStateBaseAddressTracking.set(0);
DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(1);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
@@ -164,6 +166,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, MultiTileCommandListTests, givenPartitionedCommandL
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableStateBaseAddressTracking.set(0);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));

View File

@@ -310,6 +310,9 @@ HWTEST_F(CommandQueueCreate, given100CmdListsWhenExecutingThenCommandStreamIsNot
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
const ze_command_queue_desc_t desc = {};
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
@@ -332,6 +335,8 @@ HWTEST_F(CommandQueueCreate, given100CmdListsWhenExecutingThenCommandStreamIsNot
CmdListKernelLaunchParams launchParams = {};
commandList->appendLaunchKernel(kernel.toHandle(), &dispatchKernelArguments, nullptr, 0, nullptr, launchParams, false);
commandList->close();
const size_t numHandles = 100;
ze_command_list_handle_t cmdListHandles[numHandles];
for (size_t i = 0; i < numHandles; i++) {
@@ -382,6 +387,7 @@ HWTEST2_F(CommandQueueCreate, givenLogicalStateHelperWhenExecutingThenMergeState
ze_group_count_t dispatchKernelArguments{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
commandList->appendLaunchKernel(kernel.toHandle(), &dispatchKernelArguments, nullptr, 0, nullptr, launchParams, false);
commandList->close();
ze_command_list_handle_t cmdListHandles = commandList->toHandle();
@@ -406,7 +412,7 @@ HWTEST2_F(CommandQueueCreate, givenLogicalStateHelperAndImmediateCmdListWhenExec
&desc,
false,
false,
false,
true,
returnValue));
auto ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(commandQueue->getCsr());
ultCsr->logicalStateHelper.reset(mockCsrLogicalStateHelper);
@@ -446,6 +452,7 @@ HWTEST2_F(CommandQueueCreate, givenOutOfHostMemoryErrorFromSubmitBatchBufferWhen
ze_group_count_t dispatchFunctionArguments{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
commandList->appendLaunchKernel(kernel.toHandle(), &dispatchFunctionArguments, nullptr, 0, nullptr, launchParams, false);
commandList->close();
ze_command_list_handle_t cmdListHandles[1] = {commandList->toHandle()};
@@ -469,6 +476,7 @@ HWTEST2_F(CommandQueueCreate, givenGpuHangInReservingLinearStreamWhenExecutingCo
ze_group_count_t dispatchKernelArguments{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
commandList->appendLaunchKernel(kernel.toHandle(), &dispatchKernelArguments, nullptr, 0, nullptr, launchParams, false);
commandList->close();
ze_command_list_handle_t cmdListHandles[1] = {commandList->toHandle()};
@@ -536,7 +544,7 @@ HWTEST2_F(CommandQueueCreate, GivenDispatchTaskCountPostSyncRequiredWhenExecuteC
auto commandList = std::unique_ptr<CommandList>(whiteboxCast(
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
ASSERT_NE(nullptr, commandList);
commandList->close();
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandQueue->dispatchTaskCountPostSyncRequired = false;
commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false);
@@ -574,6 +582,7 @@ HWTEST_F(CommandQueueCreate, givenUpdateTaskCountFromWaitAndRegularCmdListWhenDi
auto commandList = std::unique_ptr<CommandList>(whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
ASSERT_NE(nullptr, commandList);
commandList->close();
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false);
@@ -610,7 +619,7 @@ HWTEST_F(CommandQueueCreate, givenUpdateTaskCountFromWaitAndImmediateCmdListWhen
&desc,
false,
false,
false,
true,
returnValue));
auto commandList = CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::RenderCompute, returnValue);
@@ -797,6 +806,7 @@ TEST_F(CommandQueueCreate, givenCmdQueueWithBlitCopyWhenExecutingNonCopyBlitComm
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue));
ASSERT_NE(nullptr, commandList);
commandList->close();
auto commandListHandle = commandList->toHandle();
auto status = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -821,6 +831,7 @@ TEST_F(CommandQueueCreate, givenCmdQueueWithBlitCopyWhenExecutingCopyBlitCommand
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Copy, 0u, returnValue));
ASSERT_NE(nullptr, commandList);
commandList->close();
auto commandListHandle = commandList->toHandle();
auto status = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -1176,6 +1187,7 @@ HWTEST2_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenConta
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
commandList->setCommandListPerThreadScratchSize(100u);
auto commandListHandle = commandList->toHandle();
commandList->close();
void *alloc = alignedMalloc(0x100, 0x100);
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
@@ -1215,6 +1227,7 @@ HWTEST2_F(ExecuteCommandListTests, givenOutOfMemorySubmitBatchBufferThenExecuteC
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
auto res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY, res);
@@ -1234,6 +1247,7 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndScratchW
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
commandList->setCommandListPerThreadScratchSize(100u);
auto commandListHandle = commandList->toHandle();
commandList->close();
void *alloc = alignedMalloc(0x100, 0x100);
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
@@ -1260,6 +1274,7 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndPrivateS
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
commandList->setCommandListPerThreadPrivateScratchSize(100u);
auto commandListHandle = commandList->toHandle();
commandList->close();
void *alloc = alignedMalloc(0x100, 0x100);
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
@@ -1290,6 +1305,7 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithWhenBindlessEn
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
commandList->setCommandListPerThreadScratchSize(100u);
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -1309,6 +1325,7 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenExecuteComma
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
auto res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, res);
@@ -1330,6 +1347,7 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenResetGraphic
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
void *alloc = alignedMalloc(0x100, 0x100);
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
@@ -1360,6 +1378,7 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenResetGraphic
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
void *alloc = alignedMalloc(0x100, 0x100);
NEO::GraphicsAllocation graphicsAllocation1(0, NEO::AllocationType::BUFFER, alloc, 0u, 0u, 1u, MemoryPool::System4KBPages, 1u);
@@ -1388,6 +1407,8 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenWaitForCompl
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
TaskCountType flushedTaskCountPrior = csr->peekTaskCount();
csr->setLatestFlushedTaskCount(flushedTaskCountPrior);
auto res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -1409,6 +1430,7 @@ HWTEST2_F(ExecuteCommandListTests, givenSuccessfulSubmitBatchBufferThenExecuteCo
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
auto res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
@@ -1437,7 +1459,9 @@ HWTEST2_F(ExecuteCommandListTests, givenCommandQueueHavingTwoB2BCommandListsThen
commandList1->initialize(device, NEO::EngineGroupType::Compute, 0u);
commandList1->setCommandListPerThreadScratchSize(0u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
EXPECT_EQ(true, csr->getMediaVFEStateDirty());
EXPECT_EQ(true, csr->getGSBAStateDirty());
@@ -1474,7 +1498,9 @@ HWTEST2_F(ExecuteCommandListTests, givenCommandQueueHavingTwoB2BCommandListsThen
auto commandList1 = std::unique_ptr<CommandList>(whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
commandList1->setCommandListPerThreadScratchSize(0u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
ASSERT_NE(nullptr, commandQueue);
@@ -1516,7 +1542,9 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->setCommandListPerThreadScratchSize(512u);
commandList1->setCommandListPerThreadScratchSize(0u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
commandQueue->executeCommandLists(1, &commandListHandle0, nullptr, false);
EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize());
@@ -1537,8 +1565,10 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->reset();
commandList0->setCommandListPerThreadScratchSize(0u);
commandList0->close();
commandList1->reset();
commandList1->setCommandListPerThreadScratchSize(0u);
commandList1->close();
auto commandQueue1 = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1590,7 +1620,9 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->setCommandListPerThreadScratchSize(0u);
commandList1->setCommandListPerThreadScratchSize(512u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
commandQueue->executeCommandLists(1, &commandListHandle0, nullptr, false);
EXPECT_EQ(0u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize());
@@ -1611,8 +1643,10 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->reset();
commandList0->setCommandListPerThreadScratchSize(512u);
commandList0->close();
commandList1->reset();
commandList1->setCommandListPerThreadScratchSize(0u);
commandList1->close();
auto commandQueue1 = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1664,7 +1698,9 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->setCommandListPerThreadScratchSize(512u);
commandList1->setCommandListPerThreadScratchSize(512u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
commandQueue->executeCommandLists(1, &commandListHandle0, nullptr, false);
EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize());
@@ -1685,8 +1721,10 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->reset();
commandList0->setCommandListPerThreadScratchSize(1024u);
commandList0->close();
commandList1->reset();
commandList1->setCommandListPerThreadScratchSize(1024u);
commandList1->close();
auto commandQueue1 = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1738,7 +1776,9 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->setCommandListPerThreadScratchSize(0u);
commandList1->setCommandListPerThreadScratchSize(512u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
commandQueue->executeCommandLists(1, &commandListHandle0, nullptr, false);
EXPECT_EQ(0u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize());
@@ -1759,8 +1799,10 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->reset();
commandList0->setCommandListPerThreadScratchSize(1024u);
commandList0->close();
commandList1->reset();
commandList1->setCommandListPerThreadScratchSize(2048u);
commandList1->close();
auto commandQueue1 = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1810,7 +1852,9 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->setCommandListPerThreadPrivateScratchSize(0u);
commandList1->setCommandListPerThreadPrivateScratchSize(512u);
auto commandListHandle0 = commandList0->toHandle();
commandList0->close();
auto commandListHandle1 = commandList1->toHandle();
commandList1->close();
commandQueue->executeCommandLists(1, &commandListHandle0, nullptr, false);
EXPECT_EQ(0u, csr->getScratchSpaceController()->getPerThreadPrivateScratchSize());
@@ -1829,8 +1873,10 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
commandList0->reset();
commandList0->setCommandListPerThreadPrivateScratchSize(1024u);
commandList0->close();
commandList1->reset();
commandList1->setCommandListPerThreadPrivateScratchSize(2048u);
commandList1->close();
auto commandQueue1 = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1877,6 +1923,7 @@ HWTEST_F(ExecuteCommandListTests, givenDirectSubmissionEnabledWhenExecutingCmdLi
auto commandList = std::unique_ptr<CommandList>(whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
commandList->setCommandListPerThreadPrivateScratchSize(0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
@@ -1920,6 +1967,7 @@ HWTEST_F(ExecuteCommandListTests, givenDirectSubmissionEnabledAndDebugFlagSetWhe
auto commandList = std::unique_ptr<CommandList>(whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
commandList->setCommandListPerThreadPrivateScratchSize(0u);
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);

View File

@@ -129,6 +129,8 @@ HWTEST_TEMPLATED_F(AubCsrTest, givenAubCsrWhenCallingExecuteCommandListsThenPoll
ASSERT_NE(nullptr, commandList);
auto commandListHandle = commandList->toHandle();
commandList->close();
queue->executeCommandLists(1, &commandListHandle, nullptr, false);
EXPECT_EQ(aubCsr->pollForCompletionCalled, 1u);
@@ -324,6 +326,8 @@ HWTEST2_F(MultiTileCommandQueueSynchronizeTest, givenMultiplePartitionCountWhenC
commandList->partitionCount = 2;
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandList->close();
returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false);
EXPECT_EQ(returnValue, ZE_RESULT_SUCCESS);
@@ -364,6 +368,8 @@ HWTEST2_F(MultiTileCommandQueueSynchronizeTest, givenCsrHasMultipleActivePartiti
ASSERT_NE(nullptr, commandList);
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false);
EXPECT_EQ(returnValue, ZE_RESULT_SUCCESS);
@@ -393,6 +399,8 @@ HWTEST_F(CommandQueueSynchronizeTest, givenSingleTileCsrWhenExecutingMultiTileCo
commandList->partitionCount = 2;
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandList->close();
returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false);
EXPECT_EQ(returnValue, ZE_RESULT_ERROR_INVALID_COMMAND_LIST_TYPE);
@@ -443,6 +451,7 @@ HWTEST_F(CommandQueueSynchronizeTest, givenSynchronousCommandQueueWhenTagUpdateF
DebugManagerStateRestore restore;
NEO::DebugManager.flags.UpdateTaskCountFromWait.set(3);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
size_t expectedSize = sizeof(MI_BATCH_BUFFER_START);
if (neoDevice->getDefaultEngine().commandStreamReceiver->isAnyDirectSubmissionEnabled()) {
@@ -473,6 +482,8 @@ HWTEST_F(CommandQueueSynchronizeTest, givenSynchronousCommandQueueWhenTagUpdateF
// 1st execute provides all preamble commands
ze_command_list_handle_t cmdListHandle = commandList->toHandle();
commandList->close();
returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
@@ -757,6 +768,7 @@ HWTEST2_F(DeviceWithDualStorage, givenCmdListWithAppendedKernelAndUsmTransferAnd
CmdListKernelLaunchParams launchParams = {};
commandList->appendLaunchKernel(kernel.toHandle(), &dispatchKernelArguments, nullptr, 0, nullptr, launchParams, false);
auto deviceImp = static_cast<DeviceImp *>(device);
commandList->close();
auto pageFaultCmdQueue = whiteboxCast(whiteboxCast(deviceImp->pageFaultCommandList)->cmdQImmediate);

View File

@@ -282,6 +282,8 @@ HWTEST_F(CommandQueueCommandsSingleTile, givenCommandQueueWhenExecutingCommandLi
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Copy, 0u, returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
auto status = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
auto globalFence = csr.getGlobalFenceAllocation();
@@ -312,6 +314,8 @@ HWTEST_F(CommandQueueCommandsSingleTile, givenCommandQueueWhenExecutingCommandLi
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Copy, 0u, returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
auto status = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
auto kernelArgsBufferAllocation = csr.getKernelArgsBufferAllocation();
@@ -357,6 +361,8 @@ HWTEST2_F(CommandQueueCommandsMultiTile, givenCommandQueueOnMultiTileWhenExecuti
ASSERT_NE(nullptr, commandQueue);
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
commandList->close();
auto commandListHandle = commandList->toHandle();
auto workPartitionAllocation = csr.getWorkPartitionAllocation();
csr.expectedGa = workPartitionAllocation;
@@ -446,7 +452,7 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDebugModeToTreatIndirectAllocatio
std::end(commandList->getCmdContainer().getResidencyContainer()),
gpuAlloc);
EXPECT_EQ(itorEvent, std::end(commandList->getCmdContainer().getResidencyContainer()));
commandList->close();
auto commandListHandle = commandList->toHandle();
EXPECT_FALSE(gpuAlloc->isResident(csr.getOsContext().getContextId()));
@@ -510,7 +516,7 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDeviceThatSupportsSubmittingIndir
std::end(commandList->getCmdContainer().getResidencyContainer()),
gpuAlloc);
EXPECT_EQ(itorEvent, std::end(commandList->getCmdContainer().getResidencyContainer()));
commandList->close();
auto commandListHandle = commandList->toHandle();
EXPECT_FALSE(gpuAlloc->isResident(csr.getOsContext().getContextId()));
@@ -710,7 +716,7 @@ HWTEST2_F(EngineInstancedDeviceExecuteTests, givenEngineInstancedDeviceWhenExecu
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, l0Device, csr, &desc, false, false, false, returnValue));
auto commandList = std::unique_ptr<CommandList>(whiteboxCast(CommandList::create(productFamily, l0Device, NEO::EngineGroupType::Compute, 0u, returnValue)));
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
GenCmdList cmdList;
@@ -761,7 +767,7 @@ HWTEST2_F(EngineInstancedDeviceExecuteTests, givenEngineInstancedDeviceWithFabri
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, l0Device, csr, &desc, false, false, false, returnValue));
auto commandList = std::unique_ptr<CommandList>(whiteboxCast(CommandList::create(productFamily, l0Device, NEO::EngineGroupType::Compute, 0u, returnValue)));
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
GenCmdList cmdList;
@@ -804,6 +810,8 @@ HWTEST2_F(CommandQueueIndirectAllocations, givenCtxWithIndirectAccessWhenExecuti
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
auto cmdListHandle = commandList->toHandle();
commandList->close();
auto ctx = typename MockCommandQueueHandleIndirectAllocs<gfxCoreFamily>::CommandListExecutionContext{&cmdListHandle,
1,
csr->getPreemptionMode(),
@@ -826,6 +834,7 @@ HWTEST2_F(CommandQueueIndirectAllocations, givenCtxWitNohIndirectAccessWhenExecu
commandQueue->initialize(false, false, false);
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
commandList->close();
auto cmdListHandle = commandList.get()->toHandle();
auto ctx = typename MockCommandQueueHandleIndirectAllocs<gfxCoreFamily>::CommandListExecutionContext{&cmdListHandle,
@@ -1083,6 +1092,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
CmdListKernelLaunchParams launchParams = {};
commandListA->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, launchParams);
commandListA->close();
auto commandListBB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListBB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
@@ -1090,6 +1100,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
launchParams.isCooperative = true;
commandListBB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, launchParams);
commandListBB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, launchParams);
commandListBB->close();
auto commandListAB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListAB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
@@ -1099,6 +1110,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
launchParams.isCooperative = true;
commandListAB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, launchParams);
commandListAB->close();
auto commandListBA = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListBA->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
@@ -1106,6 +1118,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
launchParams.isCooperative = false;
commandListBA->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, launchParams);
commandListBA->close();
auto commandListBAB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListBAB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
@@ -1118,6 +1131,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
launchParams.isCooperative = true;
commandListBAB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, launchParams);
commandListBAB->close();
auto commandListAAB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListAAB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
@@ -1128,9 +1142,11 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
launchParams.isCooperative = true;
commandListAAB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, launchParams);
commandListAAB->close();
auto commandListEmpty = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListEmpty->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
commandListEmpty->close();
size_t singleFrontEndCmdSize = commandQueue->estimateFrontEndCmdSize();
@@ -1226,6 +1242,7 @@ HWTEST2_F(CommandQueueTest, givenRegularKernelScheduledAsCooperativeWhenExecuteC
CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = true;
commandList->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, launchParams);
commandList->close();
EXPECT_EQ(-1, csr->getStreamProperties().frontEndState.computeDispatchAllWalkerEnable.value);
@@ -1269,12 +1286,14 @@ HWTEST2_F(CommandQueueTest, givenTwoCommandQueuesUsingOneCsrWhenExecuteCommandLi
CmdListKernelLaunchParams launchParams = {};
commandListA->appendLaunchKernelWithParams(&defaultKernel, &threadGroupDimensions, nullptr, launchParams);
commandListA->close();
auto commandListB = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
commandListB->initialize(device, NEO::EngineGroupType::CooperativeCompute, 0u);
launchParams.isCooperative = true;
commandListB->appendLaunchKernelWithParams(&cooperativeKernel, &threadGroupDimensions, nullptr, launchParams);
commandListB->close();
ze_command_list_handle_t commandListsA[] = {commandListA->toHandle()};
ze_command_list_handle_t commandListsB[] = {commandListB->toHandle()};

View File

@@ -29,8 +29,10 @@
namespace L0 {
namespace ult {
struct CommandQueueExecuteCommandLists : public Test<DeviceFixture> {
void SetUp() override {
struct CommandQueueExecuteCommandListsFixture : DeviceFixture {
void setUp() {
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
DeviceFixture::setUp();
ze_result_t returnValue;
@@ -43,7 +45,7 @@ struct CommandQueueExecuteCommandLists : public Test<DeviceFixture> {
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
}
void TearDown() override {
void tearDown() {
auto tagAddress = device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getTagAddress();
*tagAddress = std::numeric_limits<TagAddressType>::max();
@@ -58,13 +60,19 @@ struct CommandQueueExecuteCommandLists : public Test<DeviceFixture> {
template <typename FamilyType>
void twoCommandListCommandPreemptionTest(bool preemptionCmdProgramming);
DebugManagerStateRestore restorer;
const static uint32_t numCommandLists = 2;
ze_command_list_handle_t commandLists[numCommandLists];
};
struct MultiDeviceCommandQueueExecuteCommandLists : public Test<MultiDeviceFixture> {
void SetUp() override {
using CommandQueueExecuteCommandLists = Test<CommandQueueExecuteCommandListsFixture>;
struct MultiDeviceCommandQueueExecuteCommandListsFixture : public MultiDeviceFixture {
void setUp() {
DebugManager.flags.EnableWalkerPartition.set(1);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
numRootDevices = 1u;
MultiDeviceFixture::setUp();
@@ -86,7 +94,7 @@ struct MultiDeviceCommandQueueExecuteCommandLists : public Test<MultiDeviceFixtu
EXPECT_EQ(2u, CommandList::fromHandle(commandLists[1])->getPartitionCount());
}
void TearDown() override {
void tearDown() {
for (auto i = 0u; i < numCommandLists; i++) {
auto commandList = CommandList::fromHandle(commandLists[i]);
commandList->destroy();
@@ -100,6 +108,8 @@ struct MultiDeviceCommandQueueExecuteCommandLists : public Test<MultiDeviceFixtu
ze_command_list_handle_t commandLists[numCommandLists];
};
using MultiDeviceCommandQueueExecuteCommandLists = Test<MultiDeviceCommandQueueExecuteCommandListsFixture>;
HWTEST_F(CommandQueueExecuteCommandLists, whenACommandListExecutedRequiresUncachedMOCSThenSuccessisReturned) {
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
@@ -660,7 +670,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsImplicitScalingDisabled, givenCommandLi
}
template <typename FamilyType>
void CommandQueueExecuteCommandLists::twoCommandListCommandPreemptionTest(bool preemptionCmdProgramming) {
void CommandQueueExecuteCommandListsFixture::twoCommandListCommandPreemptionTest(bool preemptionCmdProgramming) {
ze_command_queue_desc_t desc = {};
desc.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC;
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
@@ -1002,9 +1012,10 @@ HWTEST_F(CommandQueueExecuteCommandLists, GivenCopyCommandQueueWhenExecutingCopy
commandQueue->destroy();
}
struct CommandQueueExecuteCommandListSWTagsTests : public Test<DeviceFixture> {
void SetUp() override {
struct CommandQueueExecuteCommandListSWTagsTestsFixture : public DeviceFixture {
void setUp() {
DebugManager.flags.EnableSWTags.set(true);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
DeviceFixture::setUp();
ze_result_t returnValue;
@@ -1025,7 +1036,7 @@ struct CommandQueueExecuteCommandListSWTagsTests : public Test<DeviceFixture> {
ASSERT_NE(nullptr, commandQueue);
}
void TearDown() override {
void tearDown() {
commandQueue->destroy();
for (auto i = 0u; i < numCommandLists; i++) {
@@ -1042,6 +1053,8 @@ struct CommandQueueExecuteCommandListSWTagsTests : public Test<DeviceFixture> {
L0::ult::CommandQueue *commandQueue;
};
using CommandQueueExecuteCommandListSWTagsTests = Test<CommandQueueExecuteCommandListSWTagsTestsFixture>;
HWTEST_F(CommandQueueExecuteCommandListSWTagsTests, givenEnableSWTagsWhenExecutingCommandListThenHeapAddressesAreInserted) {
using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
using PARSE = typename FamilyType::PARSE;

View File

@@ -32,6 +32,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, GivenSynchronousModeWhenExe
ze_result_t returnValue;
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
CommandList::fromHandle(commandLists[0])->close();
mockCmdQ->executeCommandLists(1, commandLists, nullptr, true);
EXPECT_EQ(mockCmdQ->synchronizedCalled, 1u);
CommandList::fromHandle(commandLists[0])->destroy();
@@ -49,7 +50,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, GivenSynchronousModeAndDevi
ze_result_t returnValue;
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
CommandList::fromHandle(commandLists[0])->close();
const auto result = mockCmdQ->executeCommandLists(1, commandLists, nullptr, true);
EXPECT_EQ(mockCmdQ->synchronizedCalled, 1u);
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, result);
@@ -66,6 +67,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, GivenAsynchronousModeWhenEx
ze_result_t returnValue;
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
CommandList::fromHandle(commandLists[0])->close();
mockCmdQ->executeCommandLists(1, commandLists, nullptr, true);
EXPECT_EQ(mockCmdQ->synchronizedCalled, 0u);
CommandList::fromHandle(commandLists[0])->destroy();
@@ -93,6 +95,8 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, whenUsingFenceThenLastPipeC
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle(),
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
CommandList::fromHandle(commandLists[0])->close();
CommandList::fromHandle(commandLists[1])->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, fenceHandle, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
@@ -143,6 +147,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, givenTwoCommandQueuesUsingS
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandQueue);
CommandList::fromHandle(commandList)->close();
auto usedSpaceBefore = commandQueue->commandStream.getUsed();
returnValue = commandQueue->executeCommandLists(1, &commandList, nullptr, false);
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
@@ -205,6 +210,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, givenTwoCommandQueuesUsingS
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
ASSERT_NE(nullptr, commandQueue);
CommandList::fromHandle(commandList)->close();
auto usedSpaceBefore = commandQueue->commandStream.getUsed();
returnValue = commandQueue->executeCommandLists(1, &commandList, nullptr, false);
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);

View File

@@ -626,6 +626,7 @@ HWTEST_F(ContextMakeMemoryResidentAndMigrationTests,
0u,
returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
@@ -728,6 +729,8 @@ HWTEST_F(ContextMakeMemoryResidentAndMigrationTests,
0u,
returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);

View File

@@ -99,6 +99,10 @@ HWTEST_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledWhenCommandL
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
for (auto i = 0u; i < numCommandLists; i++) {
auto commandList = CommandList::fromHandle(commandLists[i]);
commandList->close();
}
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
@@ -449,6 +453,7 @@ HWTEST_F(L0DebuggerSimpleTest, givenUseCsrImmediateSubmissionEnabledForRegularCo
auto commandList = CommandList::fromHandle(commandLists[0]);
result = commandList->appendMemoryFill(dstPtr, reinterpret_cast<void *>(&pattern), sizeof(pattern), 4096u, nullptr, 0, nullptr, false);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
commandList->close();
result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -484,6 +489,7 @@ HWTEST_F(L0DebuggerSimpleTest, givenUseCsrImmediateSubmissionDisabledForRegularC
auto commandList = CommandList::fromHandle(commandLists[0]);
result = commandList->appendMemoryFill(dstPtr, reinterpret_cast<void *>(&pattern), sizeof(pattern), 4096u, nullptr, 0, nullptr, false);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
commandList->close();
result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);

View File

@@ -368,6 +368,7 @@ HWTEST2_P(L0DebuggerWithBlitterTest, givenUseCsrImmediateSubmissionEnabledForReg
auto commandList = CommandList::fromHandle(commandLists[0]);
auto result = commandList->appendMemoryCopyRegion(dstPtr, &dr, 0, 0, srcPtr, &sr, 0, 0, nullptr, 0, nullptr, false);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
commandList->close();
result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -437,12 +438,13 @@ HWTEST2_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenInternalCmdQIsUsed
ze_command_queue_desc_t queueDesc = {};
std::unique_ptr<MockCommandQueueHw<gfxCoreFamily>, Deleter> commandQueue(new MockCommandQueueHw<gfxCoreFamily>(device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc));
commandQueue->initialize(false, true, false);
commandQueue->initialize(false, true, true);
EXPECT_TRUE(commandQueue->internalUsage);
ze_result_t returnValue;
ze_command_list_handle_t commandLists[] = {
CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
auto commandList = CommandList::fromHandle(commandLists[0]);
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -472,7 +474,6 @@ HWTEST2_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenInternalCmdQIsUsed
EXPECT_EQ(0u, getMockDebuggerL0Hw<FamilyType>()->captureStateBaseAddressCount);
EXPECT_EQ(0u, getMockDebuggerL0Hw<FamilyType>()->getSbaTrackingCommandsSizeCount);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->destroy();
}
@@ -505,6 +506,7 @@ HWTEST_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenCommandListIsExecut
char dest[8];
auto result = commandList->appendMemoryCopy(dest, src, 8, nullptr, 0, nullptr, false);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
commandList->close();
result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);

View File

@@ -139,6 +139,7 @@ HWTEST2_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledAndRequired
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
CommandList::fromHandle(commandLists[0])->setCommandListPerThreadScratchSize(4096);
CommandList::fromHandle(commandLists[0])->close();
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
@@ -190,6 +191,8 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledAndDebuggerLogsWhenCommandQueueIs
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
const uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -203,7 +206,6 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledAndDebuggerLogsWhenCommandQueueIs
pos = output.find("Debugger: SBA ssh");
EXPECT_NE(std::string::npos, pos);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->destroy();
commandQueue->destroy();
@@ -226,6 +228,8 @@ HWTEST2_F(L0DebuggerSimpleTest, givenNullL0DebuggerAndDebuggerLogsWhenCommandQue
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
const uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -236,7 +240,6 @@ HWTEST2_F(L0DebuggerSimpleTest, givenNullL0DebuggerAndDebuggerLogsWhenCommandQue
size_t pos = output.find("Debugger: SBA");
EXPECT_EQ(std::string::npos, pos);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->destroy();
commandQueue->destroy();
@@ -257,6 +260,8 @@ HWTEST2_F(L0DebuggerTest, givenL0DebuggerAndDebuggerLogsDisabledWhenCommandQueue
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
const uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -267,7 +272,6 @@ HWTEST2_F(L0DebuggerTest, givenL0DebuggerAndDebuggerLogsDisabledWhenCommandQueue
size_t pos = output.find("Debugger: SBA");
EXPECT_EQ(std::string::npos, pos);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->destroy();
commandQueue->destroy();
@@ -316,6 +320,8 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenSbaB
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -330,7 +336,6 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenSbaB
}
EXPECT_TRUE(sbaFound);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->destroy();
}
@@ -392,6 +397,8 @@ HWTEST2_F(L0DebuggerSingleAddressSpace, givenDebuggingEnabledWhenCommandListIsEx
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
auto commandList = CommandList::fromHandle(commandLists[0]);
commandList->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);

View File

@@ -39,6 +39,10 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, deviceL0, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
for (auto i = 0u; i < numCommandLists; i++) {
auto commandList = CommandList::fromHandle(commandLists[i]);
commandList->close();
}
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
@@ -88,6 +92,10 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, deviceL0, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
for (auto i = 0u; i < numCommandLists; i++) {
auto commandList = CommandList::fromHandle(commandLists[i]);
commandList->close();
}
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
@@ -168,7 +176,7 @@ HWTEST2_F(SLDebuggerInternalUsageTest, givenDebuggingEnabledWhenInternalCmdQIsUs
device->setPreemptionMode(NEO::PreemptionMode::Disabled);
std::unique_ptr<MockCommandQueueHw<gfxCoreFamily>, Deleter> commandQueue(new MockCommandQueueHw<gfxCoreFamily>(deviceL0, device->getDefaultEngine().commandStreamReceiver, &queueDesc));
commandQueue->initialize(false, true, false);
commandQueue->initialize(false, true, true);
EXPECT_TRUE(commandQueue->internalUsage);
ze_result_t returnValue;
ze_command_list_handle_t commandLists[] = {

View File

@@ -140,6 +140,8 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenForceMemoryPrefetchForKmdMigra
ze_command_list_handle_t commandListHandle = CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle();
auto commandList = CommandList::fromHandle(commandListHandle);
commandList->close();
auto commandQueue = CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, false, returnValue);
result = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, true);
@@ -425,6 +427,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenAppendMemoryPrefetchForKmdMigr
CmdListKernelLaunchParams launchParams = {};
result = commandList->appendLaunchKernel(kernel->toHandle(), &groupCount, event->toHandle(), 0, nullptr, launchParams, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
commandList->close();
result = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, true);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -463,7 +466,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenAppendMemoryPrefetchForKmdMigr
ze_command_list_handle_t commandListHandle = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Copy, returnValue)->toHandle();
auto commandList = CommandList::fromHandle(commandListHandle);
auto commandQueue = CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, commandList->isCopyOnly(), false, false, returnValue);
auto commandQueue = CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, commandList->isCopyOnly(), false, true, returnValue);
ze_event_pool_desc_t eventPoolDesc = {};
eventPoolDesc.count = 1;

View File

@@ -40,6 +40,8 @@ HWTEST2_F(CommandQueueCommandsXeHpc, givenCommandQueueWhenExecutingCommandListsT
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
auto globalFence = csr.getGlobalFenceAllocation();
@@ -66,6 +68,8 @@ HWTEST2_F(CommandQueueCommandsXeHpc, givenCommandQueueWhenExecutingCommandListsT
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
auto globalFence = csr->getGlobalFenceAllocation();
@@ -95,6 +99,8 @@ HWTEST2_F(CommandQueueCommandsXeHpc, givenCommandQueueWhenExecutingCommandListsF
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
auto commandListHandle = commandList->toHandle();
commandList->close();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
auto usedSpaceAfter1stExecute = commandQueue->commandStream.getUsed();
commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -80,6 +80,7 @@ void CommandListStatePrefetchXeHpcCore::checkIfCommandBufferIsExhaustedWhenPrefe
using MI_BATCH_BUFFER_END = typename XeHpcCoreFamily::MI_BATCH_BUFFER_END;
DebugManagerStateRestore restore;
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<IGFX_XE_HPC_CORE>>>();
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);

View File

@@ -25,6 +25,7 @@ HWTEST2_F(CommandListTests, givenDG2WithBSteppingWhenCreatingCommandListThenAddi
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableStateBaseAddressTracking.set(0);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
ze_result_t returnValue;
auto &hwInfo = *neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();

View File

@@ -34,6 +34,7 @@ HWTEST2_F(CommandListCreate, WhenCreatingCommandListThenBindingTablePoolAllocAdd
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableStateBaseAddressTracking.set(0);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));

View File

@@ -38,6 +38,8 @@ XE_HPG_CORETEST_F(CommandQueueExecuteCommandListsXeHpgCore, WhenExecutingCmdList
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
CommandList::fromHandle(commandLists[0])->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
@@ -82,6 +84,8 @@ XE_HPG_CORETEST_F(CommandQueueExecuteCommandListsXeHpgCore, WhenExecutingCmdList
ze_command_list_handle_t commandLists[] = {
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
CommandList::fromHandle(commandLists[0])->close();
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);