Function tvm::sym::DetectIterMap

Function tvm::sym::DetectIterMap#

Function Documentation#

IterMapResult tvm::sym::DetectIterMap(const ffi::Array<PrimExpr> &indices, const ffi::Map<PrimVar, Range> &input_iters, const PrimExpr &predicate, IterMapLevel check_level, const sym::Analyzer &analyzer, bool simplify_trivial_iterators = true)#

Detect if indices can be written as [y_0 + c_0, y_1 + c_1, …, y_n + c_n].

Here y = some-quasi-affine-iter-map(input_iters) and c are symbolic constants.

We also requires that y_i and y_j to be independent for i != j.

For returned value rv, the following is always true:

  • rv[i]->args.size() <=1: only one iterator per element.

Parameters:
  • indices – The indices to detect pattern for.

  • input_iters – Map from variable to iterator’s range.

  • predicate – The predicate constraints on the input iterators

  • check_level – The iter mapping checking level.

  • analyzer – Analyzer used to get context information.

  • simplify_trivial_iterators – If true, iterators with extent of 1 will be replaced with a constant value.

Returns:

The detected iteration result. The return object’s .indices is empty on failure.