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 2020/04/30 19:45:45 UTC

[GitHub] [incubator-tvm] kparzysz-quic opened a new pull request #5491: Make "none" DataType explicit

kparzysz-quic opened a new pull request #5491:
URL: https://github.com/apache/incubator-tvm/pull/5491


   The `None` data type is created when converting an empty string to `DataType`.
   
   Add functions to create it and recognize it. Convert it to the `void` LLVM type in LLVM codegen (it was not handled).


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



[GitHub] [incubator-tvm] kparzysz-quic commented on a change in pull request #5491: Make "none" DataType explicit

Posted by GitBox <gi...@apache.org>.
kparzysz-quic commented on a change in pull request #5491:
URL: https://github.com/apache/incubator-tvm/pull/5491#discussion_r418263860



##########
File path: include/tvm/runtime/data_type.h
##########
@@ -211,6 +215,13 @@ class DataType {
   static DataType Handle(int bits = 64, int lanes = 1) {
     return DataType(kHandle, bits, lanes);
   }
+  /*!
+   * \brief Construct a None type.
+   * \return The constructed data type.
+   */
+  static DataType None() {

Review comment:
       I'm not sure what to do in `GetType`.  It checks for a pointer type, and for other expressions it just returns the DataType member, so it seems like there is no extra handling needed.
   
   Btw, the if statement doesn't seem to be doing anything, since it's followed by the exact same return statement:
   https://github.com/apache/incubator-tvm/blob/master/src/tir/ir/op.cc#L61




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



[GitHub] [incubator-tvm] tqchen commented on pull request #5491: Make "none" DataType explicit

Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #5491:
URL: https://github.com/apache/incubator-tvm/pull/5491#issuecomment-622250434


   Thanks @kparzysz-quic !


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



[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5491: Make "none" DataType explicit

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #5491:
URL: https://github.com/apache/incubator-tvm/pull/5491#discussion_r418253950



##########
File path: include/tvm/runtime/data_type.h
##########
@@ -211,6 +215,13 @@ class DataType {
   static DataType Handle(int bits = 64, int lanes = 1) {
     return DataType(kHandle, bits, lanes);
   }
+  /*!
+   * \brief Construct a None type.
+   * \return The constructed data type.
+   */
+  static DataType None() {

Review comment:
       to be consistent with the VoidType, perhaps we can use Void here? See also https://github.com/apache/incubator-tvm/blob/master/include/tvm/ir/type.h#L375
   
   Also need to update GetRuntimeType and GetType here https://github.com/apache/incubator-tvm/blob/master/include/tvm/tir/op.h#L60




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



[GitHub] [incubator-tvm] kparzysz-quic commented on a change in pull request #5491: Make "none" DataType explicit

Posted by GitBox <gi...@apache.org>.
kparzysz-quic commented on a change in pull request #5491:
URL: https://github.com/apache/incubator-tvm/pull/5491#discussion_r418270642



##########
File path: include/tvm/runtime/data_type.h
##########
@@ -211,6 +215,13 @@ class DataType {
   static DataType Handle(int bits = 64, int lanes = 1) {
     return DataType(kHandle, bits, lanes);
   }
+  /*!
+   * \brief Construct a None type.
+   * \return The constructed data type.
+   */
+  static DataType None() {

Review comment:
       Ah, of course.  I didn't notice that `GetType` returned `Type`.




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



[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5491: Make "none" DataType explicit

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #5491:
URL: https://github.com/apache/incubator-tvm/pull/5491#discussion_r418268635



##########
File path: include/tvm/runtime/data_type.h
##########
@@ -211,6 +215,13 @@ class DataType {
   static DataType Handle(int bits = 64, int lanes = 1) {
     return DataType(kHandle, bits, lanes);
   }
+  /*!
+   * \brief Construct a None type.
+   * \return The constructed data type.
+   */
+  static DataType None() {

Review comment:
       It would be great to have a single VoidType, so GetType(DataType::Void()) better returns VoidType() and GetRuntimeType(VoidType()) returns the DataType variant.
   
   The main reason of the additional return is that we suppose to add an WARNING if the check does not pass, see also the relations between runtime type and type in https://github.com/apache/incubator-tvm/blob/master/include/tvm/ir/type.h#L29




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