Skip to content

Commit ec9afc5

Browse files
feature: ZE_COMMAND_QUEUE_FLAG_IN_ORDER flag support
Related-To: NEO-7966 Signed-off-by: Dunajski, Bartosz <[email protected]>
1 parent 9a53f20 commit ec9afc5

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

level_zero/core/source/cmdlist/cmdlist_imp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
185185
csr->initDirectSubmission();
186186
returnValue = commandList->initialize(device, engineGroupType, desc->flags);
187187

188-
if (NEO::DebugManager.flags.ForceInOrderImmediateCmdListExecution.get() == 1) {
188+
if ((desc->flags & ZE_COMMAND_QUEUE_FLAG_IN_ORDER) || (NEO::DebugManager.flags.ForceInOrderImmediateCmdListExecution.get() == 1)) {
189189
commandList->enableInOrderExecution();
190190
}
191191

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,20 @@ struct InOrderCmdListTests : public CommandListAppendLaunchKernel {
782782
CmdListKernelLaunchParams launchParams = {};
783783
};
784784

785+
HWTEST2_F(InOrderCmdListTests, givenQueueFlagWhenCreatingCmdListThenEnableRelaxedOrdering, IsAtLeastXeHpCore) {
786+
NEO::DebugManager.flags.ForceInOrderImmediateCmdListExecution.set(-1);
787+
788+
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
789+
cmdQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_IN_ORDER;
790+
791+
ze_command_list_handle_t cmdList;
792+
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdList));
793+
794+
EXPECT_TRUE(static_cast<CommandListCoreFamilyImmediate<gfxCoreFamily> *>(cmdList)->isInOrderExecutionEnabled());
795+
796+
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListDestroy(cmdList));
797+
}
798+
785799
HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenResetEventCalledThenResetEventState, IsAtLeastXeHpCore) {
786800
auto immCmdList = createImmCmdList<gfxCoreFamily>();
787801

0 commit comments

Comments
 (0)