tqchen commented on code in PR #18523:
URL: https://github.com/apache/tvm/pull/18523#discussion_r2572369113


##########
include/tvm/runtime/tensor.h:
##########
@@ -188,14 +189,25 @@ class Tensor : public tvm::ffi::Tensor {
    */
   TVM_DLL static void CopyFromBytes(const DLTensor* to, void* from, size_t 
nbytes,
                                     TVMStreamHandle stream = nullptr);
+
+  TVM_DLL void SetScope(ffi::String scope);
+  TVM_DLL ffi::String GetScope() const;
+
+ protected:
+  /*!
+   * \brief The memory scope
+   * represents the underlaying scope information of device
+   */
+  ffi::String scope = "global";

Review Comment:
   i think it is somewhat very intrusive to introduce scope to runtime tensor 
class here, is it possible to avoid it in runtime? but instead ensure compiler 
allocate the right scope and call right ops implicitly?
   
   Note that per runtime, the scope can also implicit attaches to data field



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to