diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index e60dca529dd6b..09c22366b6530 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -185,7 +185,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device csr->initDirectSubmission(); returnValue = commandList->initialize(device, engineGroupType, desc->flags); - if (NEO::DebugManager.flags.ForceInOrderImmediateCmdListExecution.get() == 1) { + if ((desc->flags & ZE_COMMAND_QUEUE_FLAG_IN_ORDER) || (NEO::DebugManager.flags.ForceInOrderImmediateCmdListExecution.get() == 1)) { commandList->enableInOrderExecution(); } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp index 5f9735a37c10e..0c983c62dfdfa 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp @@ -782,6 +782,20 @@ struct InOrderCmdListTests : public CommandListAppendLaunchKernel { CmdListKernelLaunchParams launchParams = {}; }; +HWTEST2_F(InOrderCmdListTests, givenQueueFlagWhenCreatingCmdListThenEnableRelaxedOrdering, IsAtLeastXeHpCore) { + NEO::DebugManager.flags.ForceInOrderImmediateCmdListExecution.set(-1); + + ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; + cmdQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_IN_ORDER; + + ze_command_list_handle_t cmdList; + EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdList)); + + EXPECT_TRUE(static_cast *>(cmdList)->isInOrderExecutionEnabled()); + + EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListDestroy(cmdList)); +} + HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenResetEventCalledThenResetEventState, IsAtLeastXeHpCore) { auto immCmdList = createImmCmdList();