File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
onnxruntime/core/framework Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments