diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 36262a66b7..ff2c7a4eed 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -135,11 +135,8 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO this->partitionCount = static_cast(this->device->getNEODevice()->getDeviceBitfield().count()); } - if ((this->cmdListType == CommandListType::TYPE_IMMEDIATE) && !(this->internalUsage)) { - this->isFlushTaskSubmissionEnabled = true; - if (!NEO::DebugManager.flags.EnableFlushTaskSubmission.get()) { - this->isFlushTaskSubmissionEnabled = false; - } + if (this->cmdListType == CommandListType::TYPE_IMMEDIATE) { + this->isFlushTaskSubmissionEnabled = NEO::DebugManager.flags.EnableFlushTaskSubmission.get(); commandContainer.setFlushTaskUsedForImmediate(this->isFlushTaskSubmissionEnabled); } diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp index afa67feb1a..9e05b670a6 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp @@ -26,33 +26,6 @@ struct L0DebuggerInternalUsageTest : public L0DebuggerTest { } }; -HWTEST_F(L0DebuggerInternalUsageTest, givenCommandListIsInititalizedThenByDefaultFlushTaskSubmissionEnabled) { - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); - - EXPECT_EQ(true, commandList->isFlushTaskSubmissionEnabled); - - commandList->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenFlushTaskSubmissionDisabledWhenCommandListIsInititalizedThenFlushTaskIsSetToFalse) { - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); - - EXPECT_EQ(false, commandList->isFlushTaskSubmissionEnabled); - - commandList->destroy(); -} - HWTEST_F(L0DebuggerInternalUsageTest, givenFlushTaskSubmissionEnabledWhenCommandListIsInititalizedOrResetThenCaptureSbaIsNotCalled) { using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; @@ -72,7 +45,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenFlushTaskSubmissionEnabledWhenCommand cmdList, commandList->commandContainer.getCommandStream()->getCpuBase(), usedSpaceAfter)); auto sbaItor = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), sbaItor); + ASSERT_EQ(cmdList.end(), sbaItor); EXPECT_EQ(0u, getMockDebuggerL0Hw()->captureStateBaseAddressCount); @@ -139,7 +112,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForIm ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; ze_group_count_t groupCount{1, 1, 1}; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendLaunchKernel(kernel.toHandle(), &groupCount, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -147,10 +120,10 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForIm commandList->destroy(); } -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledWithInternalCommandListForImmediateWhenAppendLaunchKernelThenSuccessIsReturned) { +HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateCommandListForAppendLaunchKernelThenSuccessIsReturned) { Mock<::L0::Kernel> kernel; DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); + NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; @@ -163,399 +136,6 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledWithI commandList->destroy(); } -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateCommandListForAppendLaunchKernelThenSuccessIsReturned) { - Mock<::L0::Kernel> kernel; - - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - ze_group_count_t groupCount{1, 1, 1}; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); - - auto result = commandList->appendLaunchKernel(kernel.toHandle(), &groupCount, nullptr, 0, nullptr); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateCommandListForAppendPageFaultThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - size_t size = 0x100000001; - NEO::MockGraphicsAllocation mockAllocationSrc(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, - reinterpret_cast(0x1234), size, 0, sizeof(uint32_t), - MemoryPool::System4KBPages); - NEO::MockGraphicsAllocation mockAllocationDst(0, NEO::GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, - reinterpret_cast(0x100003456), size, 0, sizeof(uint32_t), - MemoryPool::System4KBPages); - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); - - auto result = commandList->appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateWhenAppendEventResetThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendEventReset(event->toHandle()); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateWhenAppendEventResetWithTimestampThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendEventReset(event->toHandle()); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateWhenAppendEventResetWithTimestampThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendEventReset(event->toHandle()); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateWhenAppendSignalEventThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendSignalEvent(event->toHandle()); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateWhenAppendSignalEventWithTimestampThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendSignalEvent(event->toHandle()); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateWhenAppendSignalEventWithTimestampThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendSignalEvent(event->toHandle()); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateWhenAppendWaitOnEventWithTimestampThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - ze_event_handle_t hEventHandle = event->toHandle(); - result = commandList->appendWaitOnEvents(1, &hEventHandle); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateWhenAppendBarrierWithEventThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendBarrier(event->toHandle(), 0, nullptr); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateWhenAppendBarrierWithTimestampEventThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendBarrier(event->toHandle(), 0, nullptr); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateWhenAppendBarrierWithoutEventThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - auto result = commandList->appendBarrier(nullptr, 0, nullptr); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); -} - -HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForImmediateWhenAppendBarrierWithEventThenSuccessIsReturned) { - DebugManagerStateRestore restorer; - NEO::DebugManager.flags.EnableFlushTaskSubmission.set(false); - - ze_context_handle_t hContext; - ze_context_desc_t desc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC, nullptr, 0}; - ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext); - EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto context = static_cast(Context::fromHandle(hContext)); - - ze_event_pool_desc_t eventPoolDesc = {}; - eventPoolDesc.count = 1; - eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE; - - ze_event_desc_t eventDesc = {}; - eventDesc.index = 0; - eventDesc.signal = ZE_EVENT_SCOPE_FLAG_DEVICE; - - ze_result_t result = ZE_RESULT_SUCCESS; - auto eventPool = std::unique_ptr(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto event = std::unique_ptr(Event::create(eventPool.get(), &eventDesc, device)); - - ze_command_queue_desc_t queueDesc = {}; - ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::Compute, returnValue); - - result = commandList->appendBarrier(event->toHandle(), 0, nullptr); - ASSERT_EQ(ZE_RESULT_SUCCESS, result); - - commandList->destroy(); - context->destroy(); -} - HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForImmediateCommandListForAppendLaunchKernelIndirectThenSuccessIsReturned) { Mock<::L0::Kernel> kernel; DebugManagerStateRestore restorer; @@ -565,7 +145,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForIm queueDesc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS; ze_result_t returnValue = ZE_RESULT_SUCCESS; ze_group_count_t groupCount{1, 1, 1}; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendLaunchKernelIndirect(kernel.toHandle(), &groupCount, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -582,7 +162,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForI queueDesc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS; ze_result_t returnValue = ZE_RESULT_SUCCESS; ze_group_count_t groupCount{1, 1, 1}; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendLaunchKernelIndirect(kernel.toHandle(), &groupCount, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -598,7 +178,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForIm void *dstPtr = reinterpret_cast(0x2345); ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendMemoryCopy(dstPtr, srcPtr, 0x100, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -614,7 +194,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForI void *dstPtr = reinterpret_cast(0x2345); ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendMemoryCopy(dstPtr, srcPtr, 0x100, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -635,7 +215,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForIm ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendMemoryCopyRegion(dstPtr, &dr, 0, 0, srcPtr, &sr, 0, 0, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -687,7 +267,7 @@ HWTEST_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledForI ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); auto result = commandList->appendMemoryCopyRegion(dstPtr, &dstRegion, 0, 0, srcPtr, &srcRegion, 0, 0, nullptr, 0, nullptr); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -700,7 +280,7 @@ HWTEST2_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForI NEO::DebugManager.flags.EnableFlushTaskSubmission.set(true); const ze_command_queue_desc_t queueDesc = {}; - bool internalEngine = false; + bool internalEngine = true; void *srcPtr = reinterpret_cast(0x1234); void *dstPtr = reinterpret_cast(0x2345); @@ -715,6 +295,13 @@ HWTEST2_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledForI returnValue)); ASSERT_NE(nullptr, commandList0); + CommandQueueImp *cmdQueue = reinterpret_cast(commandList0->cmdQImmediate); + if (neoDevice->getInternalCopyEngine()) { + EXPECT_EQ(cmdQueue->getCsr(), neoDevice->getInternalCopyEngine()->commandStreamReceiver); + } else { + EXPECT_EQ(cmdQueue->getCsr(), neoDevice->getInternalEngine().commandStreamReceiver); + } + ze_image_desc_t desc = {}; desc.stype = ZE_STRUCTURE_TYPE_IMAGE_DESC; desc.type = ZE_IMAGE_TYPE_3D; @@ -802,7 +389,7 @@ HWTEST2_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionEnabledComm void *dstPtr = reinterpret_cast(0x2345); ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); ASSERT_NE(nullptr, commandList); for (uint32_t count = 0; count < 2048; count++) { @@ -820,7 +407,7 @@ HWTEST2_F(L0DebuggerInternalUsageTest, givenUseCsrImmediateSubmissionDisabledCom void *dstPtr = reinterpret_cast(0x2345); ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue = ZE_RESULT_SUCCESS; - auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, false, NEO::EngineGroupType::RenderCompute, returnValue); + auto commandList = CommandList::createImmediate(productFamily, device, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue); ASSERT_NE(nullptr, commandList); for (uint32_t count = 0; count < 2048; count++) { diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index e1fef6723e..7742d05ef9 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -46,7 +46,7 @@ CFEFusedEUDispatch = -1 ForceAuxTranslationMode = -1 OverrideGpuAddressSpace = -1 OverrideMaxWorkgroupSize = -1 -EnableFlushTaskSubmission = 1 +EnableFlushTaskSubmission = false DoCpuCopyOnReadBuffer = -1 DoCpuCopyOnWriteBuffer = -1 PauseOnEnqueue = -1 diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 9f0792cf55..d655884dbb 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -69,7 +69,7 @@ DECLARE_DEBUG_VARIABLE(bool, GlobalSequencerFlushOnCopyEngine, false, "false: di DECLARE_DEBUG_VARIABLE(bool, UseImmDataWriteModeOnPostSyncOperation, false, "Use IMM data write mode as post sync operation in Compute Walker") DECLARE_DEBUG_VARIABLE(bool, DisableTimestampEvents, false, "Timestamp info will not be reported and events will only perform regular synchronization functions") DECLARE_DEBUG_VARIABLE(bool, EnableResourceTags, false, "Enable resource tagging in GMM") -DECLARE_DEBUG_VARIABLE(bool, EnableFlushTaskSubmission, true, "true: driver uses csr flushTask for immediate submissions, false: driver uses legacy executeCommandList path") +DECLARE_DEBUG_VARIABLE(bool, EnableFlushTaskSubmission, false, "true: driver uses csr flushTask for immediate submissions, false: driver uses legacy executeCommandList path") DECLARE_DEBUG_VARIABLE(bool, DoNotFreeResources, false, "true: driver stops freeing resources") DECLARE_DEBUG_VARIABLE(bool, AllowMixingRegularAndCooperativeKernels, false, "true: driver allows mixing regular and cooperative kernels in a single command list and in a single execute") DECLARE_DEBUG_VARIABLE(bool, AllowPatchingVfeStateInCommandLists, false, "true: MEDIA_VFE_STATE may be programmed in a command list")