forked from mindspore-Ecosystem/mindspore
Disable internal device address relationship in zero copy.
This commit is contained in:
parent
e70b601c47
commit
60853f8e2c
|
@ -669,7 +669,10 @@ void KernelRuntime::AssignStaticMemoryInput(const session::KernelGraph &graph) {
|
|||
MS_LOG(WARNING) << "It is not suggested to use a lonely weight parameter as the output of graph";
|
||||
continue;
|
||||
}
|
||||
DeviceAddressPtr device_address = GetInternalDeviceAddress(graph, item);
|
||||
// If kernel has flag kFlagEnableZeroCopyInGraph, the internal parameter and the corresponding
|
||||
// cnode cannot use the same device address.
|
||||
DeviceAddressPtr device_address =
|
||||
(graph.has_flag(kFlagEnableZeroCopyInGraph) ? nullptr : GetInternalDeviceAddress(graph, item));
|
||||
GetDeviceAddress(item, shadow_backend_node_map, index, graph, &device_address);
|
||||
AnfAlgo::SetOutputAddr(device_address, index, item.get());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue