ZihengJiang commented on a change in pull request #7488:
URL: https://github.com/apache/tvm/pull/7488#discussion_r583281947



##########
File path: include/tvm/runtime/device_api.h
##########
@@ -98,20 +109,13 @@ class TVM_DLL DeviceAPI {
   virtual void FreeDataSpace(TVMContext ctx, void* ptr) = 0;
   /*!
    * \brief copy data from one place to another
+   * \note This API is designed to support special memory with shape dependent 
layout.
+   *       We pass in DLTensor* with shape information to support these cases.
    * \param from The source array.
-   * \param from_offset The byte offeset in the from.
    * \param to The target array.
-   * \param to_offset The byte offset in the to.
-   * \param num_bytes The size of the memory in bytes
-   * \param ctx_from The source context
-   * \param ctx_to The target context
-   * \param type_hint The type of elements, only neded by certain backends.
-   *                  can be useful for cross device endian converison.
    * \param stream Optional stream object.
    */
-  virtual void CopyDataFromTo(const void* from, size_t from_offset, void* to, 
size_t to_offset,
-                              size_t num_bytes, TVMContext ctx_from, 
TVMContext ctx_to,
-                              DLDataType type_hint, TVMStreamHandle stream) = 
0;
+  virtual void CopyDataFromTo(DLTensor* from, DLTensor* to, TVMStreamHandle 
stream);

Review comment:
       same reason that Tianqi metioned beblow: we actually expect `const 
void*` for `from->data`




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

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


Reply via email to