echuraev commented on code in PR #15419:
URL: https://github.com/apache/tvm/pull/15419#discussion_r1282897535


##########
src/runtime/vm/vm.cc:
##########
@@ -899,8 +920,9 @@ void VirtualMachine::RunLoop(const std::vector<Index>& 
output_tensor_reg_indices
         ICHECK_EQ(actual_src_dev.device_type, inst_src_dev.device_type);
         ICHECK_EQ(actual_src_dev.device_id, inst_src_dev.device_id);
         Device dst_dev = GetDevice(instr.device_copy.dst_device_index);
+        auto mem_scope = 
exec_->virtual_devices[instr.device_copy.dst_device_index].second;
 
-        NDArray dst_data = src_data.CopyTo(dst_dev);
+        NDArray dst_data = src_data.CopyTo(dst_dev, String(mem_scope));

Review Comment:
   I tried to do that, but it looks like we cannot avoid it. We cannot store 
`mem_scope` in `virtual_devices` as a `String` because of serialization 
problems. We could use `std::string` in `CopyTo` method, but it looks like in 
`NDArray` it is better to use `String` because of keeping uniform interface.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to