24#ifndef TVM_RELAX_TRANSFORM_H_
25#define TVM_RELAX_TRANSFORM_H_
27#include <tvm/ffi/reflection/registry.h>
44using LayoutCb = ffi::TypedFunction<ffi::Map<ffi::String, ffi::Array<ffi::String>>(
Call)>;
58 int opt_level, ffi::String name,
59 tvm::ffi::Array<ffi::String> required,
bool traceable =
false);
74 ffi::String name, tvm::ffi::Array<ffi::String> required,
bool traceable =
false);
220 ffi::Optional<ffi::String> func_name = std::nullopt);
256 ffi::Optional<ffi::Array<ffi::String>>
skip_ops,
406 namespace refl = tvm::ffi::reflection;
407 refl::ObjectDef<FusionPatternNode>()
421 ffi::Map<ffi::String, DFPattern> annotation_patterns,
422 ffi::Optional<ffi::Function> check, ffi::Optional<ffi::Function> attrs_getter);
425 :
FusionPattern(name, pattern, {}, std::nullopt, std::nullopt) {}
465 namespace refl = tvm::ffi::reflection;
466 refl::ObjectDef<PatternCheckContextNode>()
480 ffi::Map<Var, Expr> matched_bindings,
481 ffi::Map<
Var, ffi::Array<Var>> var_usages,
482 ffi::Map<Expr, Var> value_to_bound_var);
Managed reference to CallNode.
Definition expr.h:474
Managed reference to ExprNode.
Definition base_expr.h:335
Managed reference class to IRModuleNode.
Definition module.h:255
Typed reference/view over any Expr whose ExprNode::ty is PrimType.
Definition base_expr.h:401
Managed reference to VDeviceNode.
Definition global_info.h:87
Managed reference to VarNode.
Definition expr.h:372
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
Managed reference to dataflow patterns.
Definition dataflow_pattern.h:102
The input of FusionPattern::check.
Definition transform.h:433
ffi::Map< Expr, Var > value_to_bound_var
Map from value to its bound variable. It doesn't have variables after the matched expression.
Definition transform.h:462
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.transform.PatternCheckContext", PatternCheckContextNode, ffi::Object)
ffi::Map< Var, Expr > matched_bindings
Map from variable to its value. It contains variables from bindings that is being fused by FuseOpsByP...
Definition transform.h:450
static void RegisterReflection()
Definition transform.h:464
ffi::Map< ffi::String, Expr > annotated_expr
A map which contains all expressions matched by the sub patterns in FusionPattern::annotation_pattern...
Definition transform.h:444
Expr matched_expr
The expression that's matched with the FusionPattern::pattern.
Definition transform.h:438
ffi::Map< Var, ffi::Array< Var > > var_usages
A map mapping variable definitions to a set of uses. It has all variables used in the function.
Definition transform.h:456
Definition transform.h:477
PatternCheckContext(Expr matched_expr, ffi::Map< ffi::String, Expr > annotated_expr, ffi::Map< Var, Expr > matched_bindings, ffi::Map< Var, ffi::Array< Var > > var_usages, ffi::Map< Expr, Var > value_to_bound_var)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(PatternCheckContext, ffi::ObjectRef, PatternCheckContextNode)
PassContext that is used to configure the pass behavior.
Definition transform.h:151
A pattern language for matching dataflow properties.
Defines a remapping of buffer indices.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40