diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index 740e9705fd..c9b80ab192 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -230,6 +230,8 @@ void CommandList::synchronizeEventList(uint32_t numWaitEvents, ze_event_handle_t } NEO::CommandStreamReceiver *CommandList::getCsr(bool copyOffload) const { - return copyOffload ? static_cast(this->cmdQImmediateCopyOffload)->getCsr() : static_cast(this->cmdQImmediate)->getCsr(); + auto queue = (getCopyOffloadModeForOperation(copyOffload) == CopyOffloadModes::dualStream) ? this->cmdQImmediateCopyOffload : this->cmdQImmediate; + + return static_cast(queue)->getCsr(); } } // namespace L0 diff --git a/level_zero/core/source/cmdlist/cmdlist.h b/level_zero/core/source/cmdlist/cmdlist.h index 5937dabeef..01c1a5f55a 100644 --- a/level_zero/core/source/cmdlist/cmdlist.h +++ b/level_zero/core/source/cmdlist/cmdlist.h @@ -277,7 +277,8 @@ struct CommandList : _ze_command_list_handle_t { bool isCopyOnly(bool copyOffloadOperation) const { return NEO::EngineHelper::isCopyOnlyEngineType(engineGroupType) || (copyOffloadOperation && this->isCopyOffloadEnabled()); } - bool isCopyOffloadEnabled() const { return copyOperationOffloadEnabled; } + bool isCopyOffloadEnabled() const { return copyOffloadMode != CopyOffloadModes::disabled; } + CopyOffloadMode getCopyOffloadModeForOperation(bool offloadAllowed) const { return offloadAllowed ? copyOffloadMode : CopyOffloadModes::disabled; } bool isInternal() const { return internalUsage; @@ -482,6 +483,7 @@ struct CommandList : _ze_command_list_handle_t { std::optional ordinal = std::nullopt; CommandListType cmdListType = CommandListType::typeRegular; + CopyOffloadMode copyOffloadMode = CopyOffloadModes::disabled; uint32_t partitionCount = 1; uint32_t defaultMocsIndex = 0; int32_t defaultPipelinedThreadArbitrationPolicy = NEO::ThreadArbitrationPolicy::NotPresent; @@ -522,7 +524,6 @@ struct CommandList : _ze_command_list_handle_t { bool requiresDcFlushForDcMitigation = false; bool statelessBuiltinsEnabled = false; bool localDispatchSupport = false; - bool copyOperationOffloadEnabled = false; bool l3FlushAfterPostSyncRequired = false; bool closedCmdList = false; }; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.h b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.h index f3114f41ed..0bc72d6690 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.h @@ -49,6 +49,7 @@ struct CommandListCoreFamilyImmediate : public CommandListCoreFamily dependenciesPresent{false}; bool latestFlushIsHostVisible = false; - bool latestFlushIsCopyOffload = false; + bool latestFlushIsDualCopyOffload = false; bool keepRelaxedOrderingEnabled = false; }; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl index f04ea08cce..00f5b52609 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl @@ -426,7 +426,8 @@ ze_result_t CommandListCoreFamilyImmediate::executeCommandListImm bool copyOffloadSubmission, bool requireTaskCountUpdate, MutexLock *outerLock, std::unique_lock *outerLockForIndirect) { - return executeCommandListImmediateWithFlushTaskImpl(performMigration, hasStallingCmds, hasRelaxedOrderingDependencies, appendOperation, requireTaskCountUpdate, getCmdQImmediate(copyOffloadSubmission), outerLock, outerLockForIndirect); + const auto copyOffloadModeForOperation = getCopyOffloadModeForOperation(copyOffloadSubmission); + return executeCommandListImmediateWithFlushTaskImpl(performMigration, hasStallingCmds, hasRelaxedOrderingDependencies, appendOperation, requireTaskCountUpdate, getCmdQImmediate(copyOffloadModeForOperation), outerLock, outerLockForIndirect); } template @@ -1125,13 +1126,15 @@ ze_result_t CommandListCoreFamilyImmediate::hostSynchronize(uint6 bool mainStorageCleanupNeeded = !mainInternalAllocStorage->getTemporaryAllocations().peekIsEmpty(); bool copyOffloadStorageCleanupNeeded = false; - if (isCopyOffloadEnabled()) { + const bool dualStreamCopyOffload = (getCopyOffloadModeForOperation(isCopyOffloadEnabled()) == CopyOffloadModes::dualStream); + + if (dualStreamCopyOffload) { copyOffloadTaskCount = this->cmdQImmediateCopyOffload->getTaskCount(); copyOffloadCsr = getCsr(true); copyOffloadInternalAllocStorage = copyOffloadCsr->getInternalAllocationStorage(); copyOffloadStorageCleanupNeeded = !copyOffloadInternalAllocStorage->getTemporaryAllocations().peekIsEmpty(); - if (this->latestFlushIsCopyOffload) { + if (this->latestFlushIsDualCopyOffload) { waitQueue = this->cmdQImmediateCopyOffload; } } @@ -1165,7 +1168,7 @@ ze_result_t CommandListCoreFamilyImmediate::hostSynchronize(uint6 if (this->isTbxMode && (status == ZE_RESULT_SUCCESS)) { mainQueueCsr->downloadAllocations(true); - if (isCopyOffloadEnabled()) { + if (dualStreamCopyOffload) { copyOffloadCsr->downloadAllocations(true); } } @@ -1173,7 +1176,7 @@ ze_result_t CommandListCoreFamilyImmediate::hostSynchronize(uint6 if (handlePostWaitOperations) { if (status == ZE_RESULT_SUCCESS) { this->cmdQImmediate->unregisterCsrClient(); - if (isCopyOffloadEnabled()) { + if (dualStreamCopyOffload) { this->cmdQImmediateCopyOffload->unregisterCsrClient(); } @@ -1211,8 +1214,8 @@ ze_result_t CommandListCoreFamilyImmediate::hostSynchronize(uint6 } template -CommandQueue *CommandListCoreFamilyImmediate::getCmdQImmediate(bool copyOffloadOperation) const { - return copyOffloadOperation ? this->cmdQImmediateCopyOffload : this->cmdQImmediate; +CommandQueue *CommandListCoreFamilyImmediate::getCmdQImmediate(CopyOffloadMode copyOffloadMode) const { + return (copyOffloadMode == CopyOffloadModes::dualStream) ? this->cmdQImmediateCopyOffload : this->cmdQImmediate; } template @@ -1234,8 +1237,9 @@ ze_result_t CommandListCoreFamilyImmediate::flushImmediate(ze_res std::unique_lock *outerLockForIndirect) { auto signalEvent = Event::fromHandle(hSignalEvent); - auto queue = getCmdQImmediate(copyOffloadSubmission); - this->latestFlushIsCopyOffload = copyOffloadSubmission; + const auto copyOffloadModeForOperation = getCopyOffloadModeForOperation(copyOffloadSubmission); + auto queue = getCmdQImmediate(copyOffloadModeForOperation); + this->latestFlushIsDualCopyOffload = (copyOffloadModeForOperation == CopyOffloadModes::dualStream); if (NEO::debugManager.flags.DeferStateInitSubmissionToFirstRegularUsage.get() == 1) { static_cast(queue)->getCsr()->ensurePrimaryCsrInitialized(*this->device->getNEODevice()); @@ -1257,7 +1261,7 @@ ze_result_t CommandListCoreFamilyImmediate::flushImmediate(ze_res if (signalEvent) { signalEvent->setCsr(static_cast(queue)->getCsr(), isInOrderExecutionEnabled()); - this->latestFlushIsHostVisible |= signalEvent->isSignalScope(ZE_EVENT_SCOPE_FLAG_HOST) && !copyOffloadSubmission; + this->latestFlushIsHostVisible |= signalEvent->isSignalScope(ZE_EVENT_SCOPE_FLAG_HOST) && !this->latestFlushIsDualCopyOffload; } return inputRet; @@ -1609,6 +1613,8 @@ void CommandListCoreFamilyImmediate::checkAssert() { template bool CommandListCoreFamilyImmediate::isRelaxedOrderingDispatchAllowed(uint32_t numWaitEvents, bool copyOffload) { + const auto copyOffloadModeForOperation = getCopyOffloadModeForOperation(copyOffload); + auto csr = getCsr(copyOffload); if (!csr->directSubmissionRelaxedOrderingEnabled()) { return false; @@ -1619,7 +1625,7 @@ bool CommandListCoreFamilyImmediate::isRelaxedOrderingDispatchAll if (NEO::debugManager.flags.DirectSubmissionRelaxedOrderingCounterHeuristic.get() != 0) { uint32_t relaxedOrderingCounterThreshold = csr->getDirectSubmissionRelaxedOrderingQueueDepth(); - auto queueTaskCount = getCmdQImmediate(copyOffload)->getTaskCount(); + auto queueTaskCount = getCmdQImmediate(copyOffloadModeForOperation)->getTaskCount(); auto csrTaskCount = csr->peekTaskCount(); bool skipTaskCountCheck = (csrTaskCount - queueTaskCount == 1) && csr->isLatestFlushIsTaskCountUpdateOnly(); diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index 35d2831adb..119735151f 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -273,6 +273,16 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device } void CommandListImp::enableCopyOperationOffload(uint32_t productFamily, Device *device, const ze_command_queue_desc_t *desc) { + this->copyOffloadMode = CopyOffloadModes::dualStream; + + if (NEO::debugManager.flags.OverrideCopyOffloadMode.get() != -1) { + this->copyOffloadMode = static_cast(NEO::debugManager.flags.OverrideCopyOffloadMode.get()); + } + + if (this->copyOffloadMode != CopyOffloadModes::dualStream) { + return; + } + NEO::CommandStreamReceiver *copyCsr = nullptr; uint32_t ordinal = static_cast(device)->getCopyEngineOrdinal(); @@ -289,7 +299,6 @@ void CommandListImp::enableCopyOperationOffload(uint32_t productFamily, Device * UNRECOVERABLE_IF(!offloadCommandQueue); this->cmdQImmediateCopyOffload = offloadCommandQueue; - this->copyOperationOffloadEnabled = true; } void CommandListImp::setStreamPropertiesDefaultSettings(NEO::StreamProperties &streamProperties) { diff --git a/level_zero/core/source/cmdlist/cmdlist_launch_params.h b/level_zero/core/source/cmdlist/cmdlist_launch_params.h index 68d86bb195..40b2b124a3 100644 --- a/level_zero/core/source/cmdlist/cmdlist_launch_params.h +++ b/level_zero/core/source/cmdlist/cmdlist_launch_params.h @@ -8,6 +8,7 @@ #pragma once #include "shared/source/helpers/definitions/command_encoder_args.h" +#include "shared/source/helpers/extendable_enum.h" #include #include @@ -86,4 +87,15 @@ struct CmdListMemoryCopyParams { bool forceDisableCopyOnlyInOrderSignaling = false; bool copyOffloadAllowed = false; }; + +struct CopyOffloadMode : ExtendableEnum { + public: + constexpr CopyOffloadMode(uint32_t val) : ExtendableEnum(val) {} +}; + +namespace CopyOffloadModes { +static constexpr CopyOffloadMode disabled = 0; +static constexpr CopyOffloadMode dualStream = 1; +} // namespace CopyOffloadModes + } // namespace L0 diff --git a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h index 4d0c5d522c..446097c647 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -61,8 +61,8 @@ struct WhiteBox<::L0::CommandListCoreFamily> using BaseClass::compactL3FlushEventPacket; using BaseClass::containsAnyKernel; using BaseClass::containsCooperativeKernelsFlag; + using BaseClass::copyOffloadMode; using BaseClass::copyOperationFenceSupported; - using BaseClass::copyOperationOffloadEnabled; using BaseClass::currentBindingTablePoolBaseAddress; using BaseClass::currentDynamicStateBaseAddress; using BaseClass::currentIndirectObjectBaseAddress; @@ -199,8 +199,8 @@ struct WhiteBox> using BaseClass::commandsToPatch; using BaseClass::compactL3FlushEvent; using BaseClass::compactL3FlushEventPacket; + using BaseClass::copyOffloadMode; using BaseClass::copyOperationFenceSupported; - using BaseClass::copyOperationOffloadEnabled; using BaseClass::dcFlushSupport; using BaseClass::device; using BaseClass::disablePatching; @@ -229,6 +229,7 @@ struct WhiteBox> using BaseClass::isQwordInOrderCounter; using BaseClass::isSyncModeQueue; using BaseClass::isTbxMode; + using BaseClass::latestFlushIsDualCopyOffload; using BaseClass::latestFlushIsHostVisible; using BaseClass::latestOperationHasOptimizedCbEvent; using BaseClass::latestOperationRequiredNonWalkerInOrderCmdsChaining; @@ -292,7 +293,7 @@ struct WhiteBox<::L0::CommandListImp> : public ::L0::CommandListImp { using BaseClass::commandListPreemptionMode; using BaseClass::commandsToPatch; using BaseClass::compactL3FlushEventPacket; - using BaseClass::copyOperationOffloadEnabled; + using BaseClass::copyOffloadMode; using BaseClass::copyThroughLockedPtrEnabled; using BaseClass::currentBindingTablePoolBaseAddress; using BaseClass::currentDynamicStateBaseAddress; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp index 64fcb9e05a..f7d8099323 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp @@ -2258,7 +2258,7 @@ HWTEST2_F(InOrderCmdListTests, givenCounterHeuristicForRelaxedOrderingEnabledWhe ultCsr->directSubmission.reset(directSubmission); auto immCmdList = createImmCmdList(); - auto queue = immCmdList->getCmdQImmediate(false); + auto queue = immCmdList->getCmdQImmediate(CopyOffloadModes::disabled); EXPECT_EQ(0u, queue->getTaskCount()); EXPECT_EQ(0u, immCmdList->relaxedOrderingCounter); @@ -2291,7 +2291,7 @@ HWTEST2_F(InOrderCmdListTests, givenCounterHeuristicForRelaxedOrderingEnabledWhe }; auto immCmdList0 = createImmCmdList(); - auto queue0 = immCmdList0->getCmdQImmediate(false); + auto queue0 = immCmdList0->getCmdQImmediate(CopyOffloadModes::disabled); EXPECT_EQ(0u, queue0->getTaskCount()); EXPECT_EQ(0u, immCmdList0->relaxedOrderingCounter); @@ -2306,7 +2306,7 @@ HWTEST2_F(InOrderCmdListTests, givenCounterHeuristicForRelaxedOrderingEnabledWhe verifyFlags(false, immCmdList0, 3); auto immCmdList1 = createImmCmdList(); - auto queue1 = immCmdList1->getCmdQImmediate(false); + auto queue1 = immCmdList1->getCmdQImmediate(CopyOffloadModes::disabled); EXPECT_EQ(0u, queue1->getTaskCount()); EXPECT_EQ(0u, immCmdList1->relaxedOrderingCounter); @@ -2371,7 +2371,7 @@ HWTEST2_F(InOrderCmdListTests, givenCounterHeuristicForRelaxedOrderingEnabledWit EXPECT_EQ(1u, ultCsr->peekTaskCount()); auto immCmdList0 = createImmCmdList(); - auto queue0 = immCmdList0->getCmdQImmediate(false); + auto queue0 = immCmdList0->getCmdQImmediate(CopyOffloadModes::disabled); EXPECT_EQ(0u, queue0->getTaskCount()); EXPECT_EQ(0u, immCmdList0->relaxedOrderingCounter); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp index 0dff8bbe07..9308baff2f 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_2.cpp @@ -43,9 +43,64 @@ struct CopyOffloadInOrderTests : public InOrderCmdListFixture { uint32_t copyData1 = 0; uint32_t copyData2 = 0; + const CopyOffloadMode nonDualStreamMode = CopyOffloadModes::dualStream + 1; std::unique_ptr> backupHwInfo; }; +HWTEST_F(CopyOffloadInOrderTests, givenCopyOffloadWhenAskingForOperationModeThenReturnCorrectValue) { + auto immCmdList = createImmCmdListWithOffload(); + + EXPECT_NE(CopyOffloadModes::disabled, immCmdList->copyOffloadMode); + + EXPECT_TRUE(immCmdList->isCopyOffloadEnabled()); + EXPECT_EQ(immCmdList->copyOffloadMode, immCmdList->getCopyOffloadModeForOperation(true)); + EXPECT_EQ(CopyOffloadModes::disabled, immCmdList->getCopyOffloadModeForOperation(false)); + + if (immCmdList->copyOffloadMode == CopyOffloadModes::dualStream) { + EXPECT_EQ(immCmdList->cmdQImmediateCopyOffload, immCmdList->getCmdQImmediate(immCmdList->copyOffloadMode)); + } else { + EXPECT_EQ(immCmdList->cmdQImmediate, immCmdList->getCmdQImmediate(immCmdList->copyOffloadMode)); + } + + immCmdList->copyOffloadMode = CopyOffloadModes::disabled; + EXPECT_FALSE(immCmdList->isCopyOffloadEnabled()); + EXPECT_EQ(CopyOffloadModes::disabled, immCmdList->getCopyOffloadModeForOperation(true)); + EXPECT_EQ(CopyOffloadModes::disabled, immCmdList->getCopyOffloadModeForOperation(false)); + + immCmdList->copyOffloadMode = nonDualStreamMode; + EXPECT_TRUE(immCmdList->isCopyOffloadEnabled()); + EXPECT_EQ(nonDualStreamMode, immCmdList->getCopyOffloadModeForOperation(true)); + EXPECT_EQ(CopyOffloadModes::disabled, immCmdList->getCopyOffloadModeForOperation(false)); + EXPECT_EQ(immCmdList->cmdQImmediate, immCmdList->getCmdQImmediate(immCmdList->copyOffloadMode)); +} + +HWTEST_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenOverrideOffloadMode) { + debugManager.flags.OverrideCopyOffloadMode.set(1234); + auto immCmdList = createImmCmdListWithOffload(); + + EXPECT_NE(0x1234u, immCmdList->copyOffloadMode); +} + +HWTEST2_F(CopyOffloadInOrderTests, givenNonDualStreamModeWhenSubmittedThenUseDefaultQueue, IsAtLeastXeHpCore) { + debugManager.flags.OverrideCopyOffloadMode.set(nonDualStreamMode); + auto immCmdList = createImmCmdListWithOffload(); + + auto eventPool = createEvents(1, true); + auto eventHandle = events[0]->toHandle(); + + EXPECT_TRUE(immCmdList->isCopyOffloadEnabled()); + EXPECT_EQ(nullptr, immCmdList->cmdQImmediateCopyOffload); + + auto csr = static_cast *>(immCmdList->getCsr(false)); + auto taskCount = csr->taskCount.load(); + + immCmdList->appendMemoryCopy(©Data1, ©Data2, 1, eventHandle, 0, nullptr, copyParams); + EXPECT_EQ(taskCount + 1, csr->taskCount.load()); + + EXPECT_FALSE(immCmdList->latestFlushIsDualCopyOffload); + EXPECT_TRUE(immCmdList->latestFlushIsHostVisible); +} + HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnableCopyOffload, IsAtLeastXeHpCore) { NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.set(1); @@ -63,11 +118,10 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); if (dcFlushRequired) { - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); } else { - - EXPECT_TRUE(cmdList->copyOperationOffloadEnabled); + EXPECT_NE(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload); auto queue = static_cast *>(cmdList->cmdQImmediateCopyOffload); @@ -88,10 +142,10 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); if (dcFlushRequired) { - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); } else { - EXPECT_TRUE(cmdList->copyOperationOffloadEnabled); + EXPECT_NE(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload); auto queue = static_cast *>(cmdList->cmdQImmediateCopyOffload); @@ -112,7 +166,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle)); auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); zeCommandListDestroy(cmdListHandle); @@ -125,7 +179,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle)); auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); zeCommandListDestroy(cmdListHandle); @@ -138,7 +192,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle)); auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); zeCommandListDestroy(cmdListHandle); @@ -167,10 +221,10 @@ HWTEST2_F(CopyOffloadInOrderTests, givenQueueDescriptorWhenCreatingCmdListThenEn auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); if (dcFlushRequired) { - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); } else { - EXPECT_TRUE(cmdList->copyOperationOffloadEnabled); + EXPECT_NE(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload); } @@ -182,7 +236,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenQueueDescriptorWhenCreatingCmdListThenEn EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle)); auto cmdList = static_cast> *>(CommandList::fromHandle(cmdListHandle)); - EXPECT_FALSE(cmdList->copyOperationOffloadEnabled); + EXPECT_EQ(CopyOffloadModes::disabled, cmdList->copyOffloadMode); EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload); zeCommandListDestroy(cmdListHandle); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 400d938720..03477eba1f 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -315,6 +315,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, PipelinedEuThreadArbitration, -1, "-1: default. DECLARE_DEBUG_VARIABLE(bool, ForceUseOnlyGlobalTimestamps, 0, "0- default disabled, 1: enable use only global timestamp") DECLARE_DEBUG_VARIABLE(int32_t, GetSipBinaryFromExternalLib, -1, "-1: default, 0: disabled, 1: enabled. If enabled, then retrieve Sip from external library") DECLARE_DEBUG_VARIABLE(int32_t, EnablePidFdOrSocketsForIpc, -1, "-1: default, 0: disabled (default), 1: enabled. If enabled, L0 IPC handles are opaque and pidfd or sockets are used for IPC exchange") +DECLARE_DEBUG_VARIABLE(int32_t, OverrideCopyOffloadMode, -1, "-1: default, 0: disabled, >=1: if enabled, override to any value from CopyOffloadModes enum") /*LOGGING FLAGS*/ DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level") diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index e152b8b5f5..3038181992 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -670,4 +670,5 @@ ExperimentalUSMAllocationReuseLimitThreshold = -1 UseIgcAsFcl = 0 EnablePidFdOrSocketsForIpc = -1 ExposeSingleDevice=-1 +OverrideCopyOffloadMode = -1 # Please don't edit below this line