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 2022/01/21 02:44:48 UTC

[GitHub] [tvm] yangulei commented on a change in pull request #9996: [TIR] add support for multi-blocking layout and their transformation

yangulei commented on a change in pull request #9996:
URL: https://github.com/apache/tvm/pull/9996#discussion_r789306340



##########
File path: include/tvm/tir/op.h
##########
@@ -495,6 +495,22 @@ TVM_DLL PrimExpr truncmod(PrimExpr a, PrimExpr b, Span span = Span());
  *       index types(int32, int64) when possible.
  */
 TVM_DLL PrimExpr indexdiv(PrimExpr a, PrimExpr b, Span span = Span());
+/*!
+ * \brief compute ceil(a / b) where a and b are non-negative.
+ *
+ * Use this function for shape split calculation.
+ *
+ * This function might take advantage of the fact
+ * that a and b are non-negative.
+ *
+ * \param a left operand
+ * \param b right operand
+ * \param span The location of this operation in the source.
+ * \return The result expression.
+ * \note this function does eager constant folding for
+ *       shape types(int32, int64) when possible.
+ */
+TVM_DLL PrimExpr shapediv(PrimExpr a, PrimExpr b, Span span = Span());

Review comment:
       I think it's a kind of symmetry, as `indexdiv` is an alias of `floordiv` to prevent access out-of-boundary, and `shapediv` is an alias of `ceildiv` to prevent the shrink of a Tensor.
   If this is confusing, I prefer to remove `indexdiv` and `shapediv` since they are just aliases of `floordiv` and `ceildiv` now, or we can keep them and add check codes for _non-negative_ then change their names to nonneg_floordiv/ceildiv.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org