mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
feature: copy offload signaling depends on useAdditionalBlitProperties
Related-To: NEO-7067 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
86e7d5b276
commit
46a5c266b7
@@ -1572,15 +1572,13 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(Ali
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
const bool copyOnly = isCopyOnly(dualStreamCopyOffload);
|
||||
|
||||
auto &rootDeviceEnvironment = device->getNEODevice()->getRootDeviceEnvironmentRef();
|
||||
bool copyRegionPreferred = NEO::BlitCommandsHelper<GfxFamily>::isCopyRegionPreferred(copySizeModified, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
|
||||
size_t nBlits = copyRegionPreferred ? NEO::BlitCommandsHelper<GfxFamily>::getNumberOfBlitsForCopyRegion(blitProperties.copySize, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed) : NEO::BlitCommandsHelper<GfxFamily>::getNumberOfBlitsForCopyPerRow(blitProperties.copySize, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
|
||||
bool useAdditionalTimestamp = nBlits > 1;
|
||||
if (useAdditionalBlitProperties) {
|
||||
setAdditionalBlitProperties(blitProperties, signalEvent, useAdditionalTimestamp);
|
||||
} else if (copyOnly) {
|
||||
} else {
|
||||
appendEventForProfiling(signalEvent, nullptr, true, false, false, true);
|
||||
}
|
||||
|
||||
@@ -1596,7 +1594,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(Ali
|
||||
}
|
||||
dummyBlitWa.isWaRequired = true;
|
||||
|
||||
if (!useAdditionalBlitProperties && copyOnly) {
|
||||
if (!useAdditionalBlitProperties) {
|
||||
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, false, false, true);
|
||||
}
|
||||
return ZE_RESULT_SUCCESS;
|
||||
@@ -1613,7 +1611,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::Graph
|
||||
Event *signalEvent, uint32_t numWaitEvents,
|
||||
ze_event_handle_t *phWaitEvents, CmdListMemoryCopyParams &memoryCopyParams) {
|
||||
const bool dualStreamCopyOffloadOperation = isDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed);
|
||||
const bool isCopyOnlySignaling = isCopyOnly(dualStreamCopyOffloadOperation) && !useAdditionalBlitProperties;
|
||||
|
||||
auto ret = addEventsToCmdList(numWaitEvents, phWaitEvents, nullptr, memoryCopyParams.relaxedOrderingDispatch, false, true, false, dualStreamCopyOffloadOperation);
|
||||
if (ret != ZE_RESULT_SUCCESS) {
|
||||
@@ -1642,9 +1639,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::Graph
|
||||
bool useAdditionalTimestamp = blitProperties.copySize.z > 1;
|
||||
if (useAdditionalBlitProperties) {
|
||||
setAdditionalBlitProperties(blitProperties, signalEvent, useAdditionalTimestamp);
|
||||
}
|
||||
|
||||
if (isCopyOnlySignaling) {
|
||||
} else {
|
||||
appendEventForProfiling(signalEvent, nullptr, true, false, false, true);
|
||||
}
|
||||
blitProperties.transform1DArrayTo2DArrayIfNeeded();
|
||||
@@ -1656,7 +1651,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::Graph
|
||||
}
|
||||
dummyBlitWa.isWaRequired = true;
|
||||
|
||||
if (isCopyOnlySignaling) {
|
||||
if (!useAdditionalBlitProperties) {
|
||||
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, false, false, true);
|
||||
if (this->isInOrderExecutionEnabled()) {
|
||||
appendSignalInOrderDependencyCounter(signalEvent, false, false, false);
|
||||
@@ -1839,10 +1834,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopy(void *dstptr,
|
||||
|
||||
launchParams.pipeControlSignalling = (signalEvent && singlePipeControlPacket) || getDcFlushRequired(dstAllocationStruct.needsFlush);
|
||||
|
||||
if (!isNonDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed)) {
|
||||
if (!useAdditionalBlitProperties || !isCopyOnlyEnabled) {
|
||||
appendEventForProfilingAllWalkers(signalEvent, nullptr, nullptr, true, singlePipeControlPacket, false, isCopyOnlyEnabled);
|
||||
}
|
||||
if (!useAdditionalBlitProperties || !isCopyOnlyEnabled) {
|
||||
appendEventForProfilingAllWalkers(signalEvent, nullptr, nullptr, true, singlePipeControlPacket, false, isCopyOnlyEnabled);
|
||||
}
|
||||
|
||||
if (isCopyOnlyEnabled) {
|
||||
@@ -1915,10 +1908,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopy(void *dstptr,
|
||||
|
||||
appendCopyOperationFence(signalEvent, srcAllocationStruct.alloc, dstAllocationStruct.alloc, isCopyOnlyEnabled);
|
||||
|
||||
if (!isNonDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed)) {
|
||||
if (!useAdditionalBlitProperties || !isCopyOnlyEnabled) {
|
||||
appendEventForProfilingAllWalkers(signalEvent, nullptr, nullptr, false, singlePipeControlPacket, false, isCopyOnlyEnabled);
|
||||
}
|
||||
if (!useAdditionalBlitProperties || !isCopyOnlyEnabled) {
|
||||
appendEventForProfilingAllWalkers(signalEvent, nullptr, nullptr, false, singlePipeControlPacket, false, isCopyOnlyEnabled);
|
||||
}
|
||||
|
||||
bool l3flushInPipeControl = !l3FlushAfterPostSyncRequired || isSplitOperation;
|
||||
@@ -1926,7 +1917,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopy(void *dstptr,
|
||||
|
||||
addToMappedEventList(signalEvent);
|
||||
|
||||
if (this->isInOrderExecutionEnabled() && !isNonDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed)) {
|
||||
if (this->isInOrderExecutionEnabled()) {
|
||||
bool emitPipeControl = !isCopyOnlyEnabled && launchParams.pipeControlSignalling;
|
||||
|
||||
if ((!useAdditionalBlitProperties || !isCopyOnlyEnabled) &&
|
||||
@@ -2005,8 +1996,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyRegion(void *d
|
||||
|
||||
memoryCopyParams.copyOffloadAllowed = isCopyOffloadAllowed(*srcAllocationStruct.alloc, *dstAllocationStruct.alloc);
|
||||
const bool isCopyOnlyEnabled = isCopyOnly(memoryCopyParams.copyOffloadAllowed);
|
||||
const bool inOrderCopyOnlySignalingAllowed = this->isInOrderExecutionEnabled() && !memoryCopyParams.forceDisableCopyOnlyInOrderSignaling &&
|
||||
isCopyOnlyEnabled && !isNonDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed);
|
||||
const bool inOrderCopyOnlySignalingAllowed = this->isInOrderExecutionEnabled() && !memoryCopyParams.forceDisableCopyOnlyInOrderSignaling && isCopyOnlyEnabled;
|
||||
|
||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||
if (isCopyOnlyEnabled) {
|
||||
|
||||
@@ -126,6 +126,7 @@ struct WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>
|
||||
using BaseClass::updateStreamProperties;
|
||||
using BaseClass::updateStreamPropertiesForFlushTaskDispatchFlags;
|
||||
using BaseClass::updateStreamPropertiesForRegularCommandLists;
|
||||
using BaseClass::useAdditionalBlitProperties;
|
||||
|
||||
WhiteBox() : ::L0::CommandListCoreFamily<gfxCoreFamily>(BaseClass::defaultNumIddsPerBlock) {}
|
||||
|
||||
@@ -249,6 +250,7 @@ struct WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>>
|
||||
using BaseClass::synchronizedDispatchMode;
|
||||
using BaseClass::synchronizeInOrderExecution;
|
||||
using BaseClass::updateInOrderExecInfo;
|
||||
using BaseClass::useAdditionalBlitProperties;
|
||||
|
||||
WhiteBox() : BaseClass(BaseClass::defaultNumIddsPerBlock) {}
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ HWTEST_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenOverri
|
||||
HWTEST2_F(CopyOffloadInOrderTests, givenNonDualStreamModeWhenSubmittedThenUseDefaultQueue, IsAtLeastXeHpCore) {
|
||||
debugManager.flags.OverrideCopyOffloadMode.set(nonDualStreamMode);
|
||||
auto immCmdList = createImmCmdListWithOffload<FamilyType::gfxCoreFamily>();
|
||||
immCmdList->useAdditionalBlitProperties = true;
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(1, true);
|
||||
auto eventHandle = events[0]->toHandle();
|
||||
@@ -106,7 +107,9 @@ HWTEST2_F(CopyOffloadInOrderTests, givenNonDualStreamModeWhenSubmittedThenDontPr
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
debugManager.flags.OverrideCopyOffloadMode.set(nonDualStreamMode);
|
||||
auto immCmdList0 = createImmCmdListWithOffload<FamilyType::gfxCoreFamily>();
|
||||
immCmdList0->useAdditionalBlitProperties = true;
|
||||
auto immCmdList1 = createImmCmdListWithOffload<FamilyType::gfxCoreFamily>();
|
||||
immCmdList1->useAdditionalBlitProperties = true;
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(2, true);
|
||||
auto eventHandle0 = events[0]->toHandle();
|
||||
@@ -137,6 +140,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenNonDualStreamModeAndProfilingEventWithRe
|
||||
debugManager.flags.OverrideCopyOffloadMode.set(nonDualStreamMode);
|
||||
|
||||
auto immCmdList = createImmCmdListWithOffload<FamilyType::gfxCoreFamily>();
|
||||
immCmdList->useAdditionalBlitProperties = true;
|
||||
|
||||
auto mainQueueCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(immCmdList->getCsr(false));
|
||||
auto copyQueueCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(immCmdList->getCsr(true));
|
||||
@@ -541,6 +545,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenNonDualStreamOffloadWhenImageCopyCalledT
|
||||
debugManager.flags.OverrideCopyOffloadMode.set(nonDualStreamMode);
|
||||
|
||||
auto immCmdList = createImmCmdListWithOffload<FamilyType::gfxCoreFamily>();
|
||||
immCmdList->useAdditionalBlitProperties = true;
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(1, true);
|
||||
|
||||
@@ -593,6 +598,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenNonDualStreamOffloadWhenFillCalledThenSk
|
||||
debugManager.flags.OverrideCopyOffloadMode.set(nonDualStreamMode);
|
||||
|
||||
auto immCmdList = createImmCmdListWithOffload<FamilyType::gfxCoreFamily>();
|
||||
immCmdList->useAdditionalBlitProperties = true;
|
||||
|
||||
auto eventPool = createEvents<FamilyType>(1, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user