@@ -630,8 +630,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemory(void *
630630 ze_group_count_t functionArgs{pSrcRegion->width / groupSizeX, pSrcRegion->height / groupSizeY,
631631 pSrcRegion->depth / groupSizeZ};
632632
633+ auto dstAllocationType = allocationStruct.alloc ->getAllocationType ();
633634 CmdListKernelLaunchParams launchParams = {};
634635 launchParams.isBuiltInKernel = true ;
636+ launchParams.isDestinationAllocationInSystemMemory =
637+ (dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
638+ (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
635639 auto ret = CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel (builtinKernel->toHandle (), &functionArgs,
636640 hEvent, numWaitEvents, phWaitEvents, launchParams);
637641
@@ -862,9 +866,15 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernelWithGA(v
862866 uint32_t groups = static_cast <uint32_t >((size + ((static_cast <uint64_t >(groupSizeX) * elementSize) - 1 )) / (static_cast <uint64_t >(groupSizeX) * elementSize));
863867 ze_group_count_t dispatchFuncArgs{groups, 1u , 1u };
864868
869+ auto dstAllocationType = dstPtrAlloc->getAllocationType ();
865870 CmdListKernelLaunchParams launchParams = {};
866871 launchParams.isKernelSplitOperation = true ;
867872 launchParams.isBuiltInKernel = true ;
873+ launchParams.isDestinationAllocationInSystemMemory =
874+ (dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
875+ (dstAllocationType == NEO::AllocationType::SVM_CPU) ||
876+ (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
877+
868878 return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit (builtinFunction->toHandle (), &dispatchFuncArgs, hSignalEvent, launchParams);
869879}
870880
@@ -1298,8 +1308,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernel3d(Align
12981308 builtinFunction->setArgumentValue (4 , sizeof (srcPitches), &srcPitches);
12991309 builtinFunction->setArgumentValue (5 , sizeof (dstPitches), &dstPitches);
13001310
1311+ auto dstAllocationType = dstAlignedAllocation->alloc ->getAllocationType ();
13011312 CmdListKernelLaunchParams launchParams = {};
13021313 launchParams.isBuiltInKernel = true ;
1314+ launchParams.isDestinationAllocationInSystemMemory =
1315+ (dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
1316+ (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
13031317 return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel (builtinFunction->toHandle (), &dispatchFuncArgs, hSignalEvent, numWaitEvents,
13041318 phWaitEvents, launchParams);
13051319}
@@ -1354,8 +1368,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernel2d(Align
13541368 builtinFunction->setArgumentValue (4 , sizeof (srcPitch), &srcPitch);
13551369 builtinFunction->setArgumentValue (5 , sizeof (dstPitch), &dstPitch);
13561370
1371+ auto dstAllocationType = dstAlignedAllocation->alloc ->getAllocationType ();
13571372 CmdListKernelLaunchParams launchParams = {};
13581373 launchParams.isBuiltInKernel = true ;
1374+ launchParams.isDestinationAllocationInSystemMemory =
1375+ (dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
1376+ (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
13591377 return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel (builtinFunction->toHandle (),
13601378 &dispatchFuncArgs, hSignalEvent,
13611379 numWaitEvents,
@@ -1429,6 +1447,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
14291447 CmdListKernelLaunchParams launchParams = {};
14301448 launchParams.isKernelSplitOperation = true ;
14311449 launchParams.isBuiltInKernel = true ;
1450+ launchParams.isDestinationAllocationInSystemMemory = hostPointerNeedsFlush;
14321451
14331452 if (patternSize == 1 ) {
14341453 Kernel *builtinFunction = nullptr ;
@@ -2129,8 +2148,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendQueryKernelTimestamps(
21292148 builtinFunction->setArgBufferWithAlloc (0u , static_cast <uintptr_t >(timestampsGPUData->getGpuAddress ()), timestampsGPUData);
21302149 builtinFunction->setArgBufferWithAlloc (1 , dstValPtr, dstPtrAllocationStruct.alloc );
21312150
2151+ auto dstAllocationType = dstPtrAllocationStruct.alloc ->getAllocationType ();
21322152 CmdListKernelLaunchParams launchParams = {};
21332153 launchParams.isBuiltInKernel = true ;
2154+ launchParams.isDestinationAllocationInSystemMemory =
2155+ (dstAllocationType == NEO::AllocationType::BUFFER_HOST_MEMORY) ||
2156+ (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
21342157 auto appendResult = appendLaunchKernel (builtinFunction->toHandle (), &dispatchFuncArgs, hSignalEvent, numWaitEvents,
21352158 phWaitEvents, launchParams);
21362159 if (appendResult != ZE_RESULT_SUCCESS) {
0 commit comments