You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "csullivan (via GitHub)" <gi...@apache.org> on 2023/08/04 16:43:52 UTC

[GitHub] [tvm] csullivan commented on a diff in pull request #15419: [VM][Textures] Enable OpenCL textures for VM

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


##########
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:
   Does the `instr.device_copy.dst` NDArray not have the correct memory scope already? 
   
   1. If so, then can we use it instead of the copy here?
   
   2. If not, then I would not expect `instr.device_copy.src` to have the correct mem_scope either. In that case you would need to construct a new ndarray from a container using the src dataptr and the correct memory scope. 



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org