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_DECLARE_FINAL_OBJECT_INFO (IRBuilderNode, runtime::Object) |
|
template<typename TFrame > |
Optional< TFrame > | FindFrame () const |
| Find a frame of the given type in the stack this->frames from top to bottom. More...
|
|
template<typename TFrame > |
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...
|
|
|
static constexpr const char * | _type_key = "script.ir_builder.IRBuilder" |
|
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:203
Buffer MatchBuffer(ObjectRef param, Array< PrimExpr > shape, DataType dtype=DataType::Float(32), Optional< Var > data=std::nullopt, Array< PrimExpr > strides={}, PrimExpr elem_offset=PrimExpr(), String storage_scope="global", int align=-1, int offset_factor=0, String buffer_type="default", Optional< Array< IntImm >> axis_separators=std::nullopt)
The buffer match statement.
PrimFuncFrame PrimFunc(bool is_private)
The primitive function statement.
◆ FindFrame()
template<typename TFrame >
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 >
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_DECLARE_FINAL_OBJECT_INFO()
tvm::script::ir_builder::IRBuilderNode::TVM_DECLARE_FINAL_OBJECT_INFO |
( |
IRBuilderNode |
, |
|
|
runtime::Object |
|
|
) |
| |
◆ _type_key
constexpr const char* tvm::script::ir_builder::IRBuilderNode::_type_key = "script.ir_builder.IRBuilder" |
|
staticconstexpr |
◆ frames
◆ result
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