mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:36:09 +08:00
feature: pvc, cpu copy in program init
Use cpu copy for globals surface when allocated through svm, allocation not set as lockable but locking allocation succeeds. Related-To: NEO-7796 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b9828b543e
commit
4c891e80a5
@@ -29,7 +29,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc
|
||||
if (linkerInput != nullptr) {
|
||||
globalsAreExported = constant ? linkerInput->getTraits().exportsGlobalConstants : linkerInput->getTraits().exportsGlobalVariables;
|
||||
}
|
||||
|
||||
bool lockingSucceeded = false;
|
||||
if (globalsAreExported && (svmAllocManager != nullptr)) {
|
||||
RootDeviceIndicesContainer rootDeviceIndices;
|
||||
rootDeviceIndices.push_back(rootDeviceIndex);
|
||||
@@ -45,6 +45,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc
|
||||
auto usmAlloc = svmAllocManager->getSVMAlloc(ptr);
|
||||
UNRECOVERABLE_IF(usmAlloc == nullptr);
|
||||
gpuAllocation = usmAlloc->gpuAllocations.getGraphicsAllocation(rootDeviceIndex);
|
||||
lockingSucceeded = device.getMemoryManager()->lockResource(gpuAllocation) != nullptr;
|
||||
} else {
|
||||
auto allocationType = constant ? AllocationType::CONSTANT_SURFACE : AllocationType::GLOBAL_SURFACE;
|
||||
gpuAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex,
|
||||
@@ -64,7 +65,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc
|
||||
bool isOnlyBssData = (totalSize == zeroInitSize);
|
||||
if (false == isOnlyBssData) {
|
||||
auto initSize = totalSize - zeroInitSize;
|
||||
auto success = MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, *gpuAllocation),
|
||||
auto success = MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, *gpuAllocation, lockingSucceeded),
|
||||
device, gpuAllocation, 0, initData, initSize);
|
||||
UNRECOVERABLE_IF(!success);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user