mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
fix: Fix signalling with zero size mem operations
Related-To: NEO-13003 Signed-off-by: Bellekallu Rajkiran <bellekallu.rajkiran@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9736ab53c0
commit
c7a89f3e0a
@@ -1689,7 +1689,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(Ali
|
|||||||
}
|
}
|
||||||
dummyBlitWa.isWaRequired = true;
|
dummyBlitWa.isWaRequired = true;
|
||||||
|
|
||||||
if (!useAdditionalBlitProperties) {
|
if (!useAdditionalBlitProperties || (copySize.x * copySize.y * copySize.z == 0)) {
|
||||||
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, false, false, true);
|
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, false, false, true);
|
||||||
}
|
}
|
||||||
return ZE_RESULT_SUCCESS;
|
return ZE_RESULT_SUCCESS;
|
||||||
@@ -2261,11 +2261,11 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyRegion(void *d
|
|||||||
|
|
||||||
if (this->isInOrderExecutionEnabled()) {
|
if (this->isInOrderExecutionEnabled()) {
|
||||||
if (inOrderCopyOnlySignalingAllowed) {
|
if (inOrderCopyOnlySignalingAllowed) {
|
||||||
if (!useAdditionalBlitProperties) {
|
if (!useAdditionalBlitProperties || srcSize == 0) {
|
||||||
appendSignalInOrderDependencyCounter(signalEvent, memoryCopyParams.copyOffloadAllowed, false, false, false);
|
appendSignalInOrderDependencyCounter(signalEvent, memoryCopyParams.copyOffloadAllowed, false, false, false);
|
||||||
}
|
}
|
||||||
handleInOrderDependencyCounter(signalEvent, false, isCopyOnlyEnabled);
|
handleInOrderDependencyCounter(signalEvent, false, isCopyOnlyEnabled);
|
||||||
} else if (!useAdditionalBlitProperties && isCopyOnlyEnabled && Event::isAggregatedEvent(signalEvent)) {
|
} else if ((!useAdditionalBlitProperties || srcSize == 0) && isCopyOnlyEnabled && Event::isAggregatedEvent(signalEvent)) {
|
||||||
appendSignalAggregatedEventAtomic(*signalEvent, isCopyOnlyEnabled);
|
appendSignalAggregatedEventAtomic(*signalEvent, isCopyOnlyEnabled);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2843,7 +2843,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBlitFill(void *ptr, cons
|
|||||||
return ZE_RESULT_ERROR_INVALID_SIZE;
|
return ZE_RESULT_ERROR_INVALID_SIZE;
|
||||||
} else {
|
} else {
|
||||||
const bool dualStreamCopyOffloadOperation = isDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed);
|
const bool dualStreamCopyOffloadOperation = isDualStreamCopyOffloadOperation(memoryCopyParams.copyOffloadAllowed);
|
||||||
const bool isCopyOnlySignaling = isCopyOnly(dualStreamCopyOffloadOperation) && !useAdditionalBlitProperties;
|
const bool isCopyOnlySignaling = isCopyOnly(dualStreamCopyOffloadOperation) && (!useAdditionalBlitProperties || size == 0);
|
||||||
|
|
||||||
ze_result_t ret = addEventsToCmdList(numWaitEvents, phWaitEvents, nullptr, memoryCopyParams.relaxedOrderingDispatch, false, true, false, dualStreamCopyOffloadOperation);
|
ze_result_t ret = addEventsToCmdList(numWaitEvents, phWaitEvents, nullptr, memoryCopyParams.relaxedOrderingDispatch, false, true, false, dualStreamCopyOffloadOperation);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
@@ -1725,5 +1725,42 @@ HWTEST2_F(MultiTileAggregatedBcsSplitTests, givenBcsSplitDisabledWhenCallingZexD
|
|||||||
EXPECT_EQ(incValue, expectedTileCount);
|
EXPECT_EQ(incValue, expectedTileCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HWTEST2_F(AppendMemoryCopyTests, givenZeroSizeWhenAppendMemoryFillThenNoMemSetOrXyColorBltProgrammed, IsAtLeastXeHpcCore) {
|
||||||
|
using GfxFamily = typename NEO::GfxFamilyMapper<FamilyType::gfxCoreFamily>::GfxFamily;
|
||||||
|
using MEM_SET = typename GfxFamily::MEM_SET;
|
||||||
|
using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT;
|
||||||
|
|
||||||
|
DebugManagerStateRestore restorer;
|
||||||
|
debugManager.flags.EnableDeviceUsmAllocationPool.set(0);
|
||||||
|
debugManager.flags.EnableHostUsmAllocationPool.set(0);
|
||||||
|
|
||||||
|
MockCommandListForMemFill<FamilyType::gfxCoreFamily> commandList;
|
||||||
|
MockDriverHandle driverHandleMock;
|
||||||
|
NEO::DeviceVector neoDevices;
|
||||||
|
neoDevices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
|
||||||
|
driverHandleMock.initialize(std::move(neoDevices));
|
||||||
|
device->setDriverHandle(&driverHandleMock);
|
||||||
|
commandList.initialize(device, NEO::EngineGroupType::copy, 0u);
|
||||||
|
commandList.useAdditionalBlitProperties = true;
|
||||||
|
|
||||||
|
uint8_t pattern = 0xAB;
|
||||||
|
void *ptr = reinterpret_cast<void *>(0x1234);
|
||||||
|
|
||||||
|
commandList.appendMemoryFill(ptr, reinterpret_cast<void *>(&pattern), sizeof(pattern), 0, nullptr, 0, nullptr, copyParams);
|
||||||
|
|
||||||
|
GenCmdList cmdList;
|
||||||
|
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
|
||||||
|
cmdList, ptrOffset(commandList.getCmdContainer().getCommandStream()->getCpuBase(), 0),
|
||||||
|
commandList.getCmdContainer().getCommandStream()->getUsed()));
|
||||||
|
|
||||||
|
auto memSetItor = find<MEM_SET *>(cmdList.begin(), cmdList.end());
|
||||||
|
EXPECT_EQ(cmdList.end(), memSetItor);
|
||||||
|
|
||||||
|
auto xyColorBltItor = find<XY_COLOR_BLT *>(cmdList.begin(), cmdList.end());
|
||||||
|
EXPECT_EQ(cmdList.end(), xyColorBltItor);
|
||||||
|
|
||||||
|
device->setDriverHandle(driverHandle.get());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ult
|
} // namespace ult
|
||||||
} // namespace L0
|
} // namespace L0
|
||||||
|
|||||||
Reference in New Issue
Block a user