You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/12/27 05:50:52 UTC

[GitHub] [incubator-tvm] FrozenGene opened a new pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters

FrozenGene opened a new pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters
URL: https://github.com/apache/incubator-tvm/pull/4590
 
 
   Follow up of #4586 . Our API for input DLTensor doesn't restrict const, but in fact, we should do. This PR add the const qualifier for them.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen merged pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters

Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters
URL: https://github.com/apache/incubator-tvm/pull/4590
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters
URL: https://github.com/apache/incubator-tvm/pull/4590#discussion_r361590582
 
 

 ##########
 File path: include/tvm/runtime/c_runtime_api.h
 ##########
 @@ -136,13 +136,16 @@ typedef DLDataType TVMType;
 typedef DLContext TVMContext;
 
 /*!
- * \brief The tensor array stucture to TVM API.
+ * \brief The tensor array structure to TVM API.
  */
 typedef DLTensor TVMArray;
 
 /*! \brief the array handle */
 typedef TVMArray* TVMArrayHandle;
 
+/*! \brief the const array handle */
+typedef const TVMArray* kTVMArrayHandle;
 
 Review comment:
   k prefix in the Google C style refers to constant numbers as opposed to types. so we should not make this change 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters
URL: https://github.com/apache/incubator-tvm/pull/4590#discussion_r361590708
 
 

 ##########
 File path: include/tvm/runtime/c_runtime_api.h
 ##########
 @@ -136,13 +136,16 @@ typedef DLDataType TVMType;
 typedef DLContext TVMContext;
 
 /*!
- * \brief The tensor array stucture to TVM API.
+ * \brief The tensor array structure to TVM API.
  */
 typedef DLTensor TVMArray;
 
 /*! \brief the array handle */
 typedef TVMArray* TVMArrayHandle;
 
+/*! \brief the const array handle */
+typedef const TVMArray* kTVMArrayHandle;
 
 Review comment:
   Given that C do not really have const, let us keep the C API as it is

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] FrozenGene commented on issue #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on issue #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters
URL: https://github.com/apache/incubator-tvm/pull/4590#issuecomment-569205106
 
 
   @tqchen I keep NDArray's C++ interface adding const qualifier, but leave C's API as original interface. Have updated code.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on a change in pull request #4590: [Runtime] add necessary const qualifier for NDArray container of function parameters
URL: https://github.com/apache/incubator-tvm/pull/4590#discussion_r361594503
 
 

 ##########
 File path: include/tvm/runtime/c_runtime_api.h
 ##########
 @@ -136,13 +136,16 @@ typedef DLDataType TVMType;
 typedef DLContext TVMContext;
 
 /*!
- * \brief The tensor array stucture to TVM API.
+ * \brief The tensor array structure to TVM API.
  */
 typedef DLTensor TVMArray;
 
 /*! \brief the array handle */
 typedef TVMArray* TVMArrayHandle;
 
+/*! \brief the const array handle */
+typedef const TVMArray* kTVMArrayHandle;
 
 Review comment:
   Ok. Got it. But I will keep the NDArray's const qualifier. Like ```inline void NDArray::CopyFrom(const DLTensor* other)```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services