Skip to content

Commit f1e235e

Browse files
committed
update comment
1 parent bb4f695 commit f1e235e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

onnxruntime/core/framework/allocation_planner.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,9 +923,10 @@ class PlannerImpl {
923923
// However, we still ignore them.
924924
//
925925
// 2.
926-
// MemcpyFromHost node provided by CPU EP requires special handling.
927-
// As per MemcpyFromHost kernel registration uses default memory type for output,
928-
// but it actually may produce output on the device specific to its consumer node's EP.
926+
// MemcpyFromHost node provided by the CPU EP requires special handling.
927+
// As per MemcpyFromHost kernel registration uses default memory type for output which means
928+
// it uses CPU memory for output as it's run on CPU, but it actually may produce output on
929+
// the device specific to its consumer node's EP.
929930
// So we need to check the consumer node's EP and set the output device accordingly.
930931

931932
if (output_device.Type() == OrtDevice::CPU) {
@@ -937,6 +938,7 @@ class PlannerImpl {
937938

938939
if ((pnode->OpType() == "MemcpyFromHost") &&
939940
pnode->GetExecutionProviderType() == kCpuExecutionProvider) {
941+
// Check the consumer node's EP and set the output device accordingly
940942
output_device = execution_providers_.Get(ep_type)
941943
->GetOrtDeviceByMemType(p_kernel_def->OutputMemoryType(i));
942944
break;

0 commit comments

Comments
 (0)