fix: use stateless copy kernel when append memory copy on PVC and Xe2 platforms

Related-To: NEO-6075
Resolves: NEO-12027


Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-07-22 15:37:26 +00:00
committed by Compute-Runtime-Automation
parent f61ab615e7
commit 899bda3263
2 changed files with 18 additions and 1 deletions

View File

@@ -1473,6 +1473,9 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopy(void *dstptr,
uintptr_t rightSize = 0;
uintptr_t middleSizeBytes = 0;
bool isStateless = this->cmdListHeapAddressModel == NEO::HeapAddressModel::globalStateless;
if (neoDevice->getCompilerProductHelper().isForceToStatelessRequired()) {
isStateless = true;
}
const bool isHeapless = this->isHeaplessModeEnabled();
if (!isCopyOnlyEnabled) {

View File

@@ -279,13 +279,27 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenQueryKernelTimestampsCalledWith
EXPECT_EQ(ret, ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY);
}
HWTEST2_F(CommandListAppend, givenCommandListWhenMemoryCopyCalledThenAppendMemoryCopyWithappendMemoryCopyKernelWithGACalled, IsAtLeastSkl) {
HWTEST2_F(CommandListAppend, givenCommandListWhenMemoryCopyCalledThenAppendMemoryCopyWithStatelessKernelIsCalled, IsAtLeastXeHpcCore) {
MockCommandListHw<gfxCoreFamily> cmdList;
cmdList.initialize(device, NEO::EngineGroupType::renderCompute, 0u);
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
cmdList.appendMemoryCopy(dstPtr, srcPtr, 0x1001, nullptr, 0, nullptr, false, false);
EXPECT_GT(cmdList.appendMemoryCopyKernelWithGACalledTimes, 0u);
EXPECT_GT(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u);
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, cmdList.appendMemoryCopyKernelWithGACalledTimes);
EXPECT_EQ(cmdList.appendMemoryCopyBlitCalledTimes, 0u);
}
using PrePvcCore = IsWithinGfxCore<IGFX_GEN9_CORE, IGFX_XE_HPG_CORE>;
HWTEST2_F(CommandListAppend, givenCommandListWhenMemoryCopyCalledThenAppendMemoryCopyWithoutStatelessKernelIsCalled, PrePvcCore) {
MockCommandListHw<gfxCoreFamily> cmdList;
cmdList.initialize(device, NEO::EngineGroupType::renderCompute, 0u);
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
cmdList.appendMemoryCopy(dstPtr, srcPtr, 0x1001, nullptr, 0, nullptr, false, false);
EXPECT_GT(cmdList.appendMemoryCopyKernelWithGACalledTimes, 0u);
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u);
EXPECT_EQ(cmdList.appendMemoryCopyBlitCalledTimes, 0u);
}