A dialect-agnostic IRBuilder that constructs any IR of TVM. An idiomatic use of this class is to put this inside the RAII with-scope, call dialect-specific methods accordingly. Upon exiting the scope.
More...
#include <base.h>
|
| | TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("script.ir_builder.IRBuilder", IRBuilderNode, runtime::Object) |
| |
| template<typename TFrame > |
| ffi::Optional< TFrame > | FindFrame () const |
| | Find a frame of the given type in the stack this->frames from top to bottom. More...
|
| |
| template<typename TFrame > |
| ffi::Optional< TFrame > | GetLastFrame () const |
| | Get the frame on top of the stack this->frames if its type is TFrame. More...
|
| |
| template<typename TObjectRef > |
| TObjectRef | Get () const |
| | Get the IR being constructed. More...
|
| |
A dialect-agnostic IRBuilder that constructs any IR of TVM. An idiomatic use of this class is to put this inside the RAII with-scope, call dialect-specific methods accordingly. Upon exiting the scope.
IRBuilder builder;
{
With<IRBuilder> _(builder);
With<T::PrimFuncFrame> _2(...);
}
}
Managed reference to an IRBuilderNode.
Definition: base.h:205
PrimFuncFrame PrimFunc(bool is_private)
The primitive function statement.
Buffer MatchBuffer(ObjectRef param, ffi::Array< PrimExpr > shape, DataType dtype=DataType::Float(32), ffi::Optional< Var > data=std::nullopt, ffi::Array< PrimExpr > strides={}, PrimExpr elem_offset=PrimExpr(), ffi::String storage_scope="global", int align=-1, int offset_factor=0, ffi::String buffer_type="default", ffi::Optional< ffi::Array< IntImm >> axis_separators=std::nullopt)
The buffer match statement.
◆ FindFrame()
template<typename TFrame >
| ffi::Optional< TFrame > tvm::script::ir_builder::IRBuilderNode::FindFrame |
|
inline |
Find a frame of the given type in the stack this->frames from top to bottom.
- Template Parameters
-
| T | The type of the frame to find. |
- Returns
- The frame if found, otherwise std::nullopt.
- Examples
- /workspace/include/tvm/script/ir_builder/base.h.
◆ Get()
template<typename TObjectRef >
| TObjectRef tvm::script::ir_builder::IRBuilderNode::Get |
|
inline |
◆ GetLastFrame()
template<typename TFrame >
| ffi::Optional< TFrame > tvm::script::ir_builder::IRBuilderNode::GetLastFrame |
|
inline |
Get the frame on top of the stack this->frames if its type is TFrame.
- Template Parameters
-
| TFrame | The assumed type of the last frame on stack. |
- Returns
- The frame if the stack is non-empty and the top of the stack is of type
TFrame. Otherwise std::nullopt.
- Examples
- /workspace/include/tvm/script/ir_builder/base.h.
◆ RegisterReflection()
| static void tvm::script::ir_builder::IRBuilderNode::RegisterReflection |
( |
| ) |
|
|
inlinestatic |
◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()
| tvm::script::ir_builder::IRBuilderNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL |
( |
"script.ir_builder.IRBuilder" |
, |
|
|
IRBuilderNode |
, |
|
|
runtime::Object |
|
|
) |
| |
◆ _type_mutable
| constexpr const bool tvm::script::ir_builder::IRBuilderNode::_type_mutable = true |
|
staticconstexpr |
◆ frames
| ffi::Array<IRBuilderFrame> tvm::script::ir_builder::IRBuilderNode::frames |
◆ result
| ffi::Optional<ObjectRef> tvm::script::ir_builder::IRBuilderNode::result |
The documentation for this class was generated from the following file:
- include/tvm/script/ir_builder/base.h