Function tvm::sym::SubspaceDivide

Function tvm::sym::SubspaceDivide#

Function Documentation#

ffi::Array<ffi::Array<IterMark>> tvm::sym::SubspaceDivide(const ffi::Array<PrimExpr> &bindings, const ffi::Map<PrimVar, Range> &input_iters, const ffi::Array<PrimVar> &sub_iters, const PrimExpr &predicate, IterMapLevel check_level, const sym::Analyzer &analyzer, bool simplify_trivial_iterators = true)#

Detect if bindings can be written as [a_0*e_0 + b_0 + c_0, a_1*e_1 + b_1, …, a_n*e_n + b_n].

where a = some-quasi-affine-iter-map(input_iters set_minus sub_iters) b = some-quasi-affine-iter-map(sub_iters) c is constant symbols e is the extent of b

For example, z*12 + y*3 + x + c = (z*4+y)*3 + x, if sub_iters={x}

Parameters:
  • bindings – The input bindings

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

  • sub_iters – Iterators of subspace.

  • 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 result list has length len(bindings) + 1 [0, len(bindings)): The iter map matching result. The inner list is of length 2. The first expr is the basis of the quotient space. The second expr is the basis of the subspace. len(bindings): the predicate of outer space and inner space Empty array if no match can be found.