Function tvm::sym::NormalizeToIterSum#
Defined in File iter_affine_map.h
Function Documentation#
-
IterSumExpr tvm::sym::NormalizeToIterSum(PrimExpr index, const ffi::Map<PrimVar, Range> &input_iters, const sym::Analyzer &analyzer)#
Rewrite index as IterSumExpr.
((i0 // b0) % a0) * s0 + ((i0 // b1) % a1) * s1 … + base
The iterators are ordered such that s0 > s1 … if we can prove the relation.
Note that base may contain expressions that cannot be detected as the right pattern.
Note
This function is useful to detect iterator stride patterns.
- Parameters:
index – The input index
input_iters – The input iterators.
analyzer – The input analyzer.