ekalda commented on code in PR #16523:
URL: https://github.com/apache/tvm/pull/16523#discussion_r1494419477
##########
include/tvm/runtime/data_type.h:
##########
@@ -114,17 +118,28 @@ class DataType {
/*! \return whether type is a handle type. */
bool is_handle() const { return code() == DataType::kHandle && !is_void(); }
/*! \return whether type is a vector type. */
- bool is_vector() const { return lanes() > 1; }
+ bool is_vector() const {
+ int encoded_lanes = static_cast<int16_t>(data_.lanes);
+ return encoded_lanes != 0 && encoded_lanes != 1;
+ }
/*! \return whether type is a bool vector type. */
bool is_vector_bool() const { return is_vector() && bits() == 1; }
/*! \return whether type is a Void type. */
bool is_void() const { return code() == DataType::kHandle && bits() == 0 &&
lanes() == 0; }
+ /*! \return Whether the type is scalable. */
+ bool is_scalable() const { return static_cast<int16_t>(data_.lanes) < 0; }
Review Comment:
Done
--
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]