tvm
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tvm::script::ir_builder::tirx::FunctionFrameObj Class Reference

A frame that represents the Function containing TIR statements. More...

#include <frame.h>

Inheritance diagram for tvm::script::ir_builder::tirx::FunctionFrameObj:
Collaboration diagram for tvm::script::ir_builder::tirx::FunctionFrameObj:

Public Types

using AttrValidator = std::function< void(const FunctionFrameObj *, const ffi::Any &)>
 Register validation for an extension-owned function attribute.
 

Public Member Functions

 TVM_FFI_DECLARE_OBJECT_INFO ("script.ir_builder.tirx.FunctionFrame", FunctionFrameObj, ir::StmtFrameObj)
 
void ExitWithScope () final
 The method called when exiting RAII scope.
 
void ValidateAttrs () const
 
virtual tvm::tirx::Function FinalizeFunction (tvm::tirx::Function func)
 Complete dialect-specific function construction before publication.
 
- Public Member Functions inherited from tvm::script::ir_builder::ir::StmtFrameObj
 TVM_FFI_DECLARE_OBJECT_INFO ("script.ir_builder.StmtFrame", StmtFrameObj, IRBuilderFrameObj)
 
- Public Member Functions inherited from tvm::script::ir_builder::IRBuilderFrameObj
 IRBuilderFrameObj ()
 Capture the source-call context when this frame is constructed.
 
 TVM_FFI_DECLARE_OBJECT_INFO ("script.ir_builder.IRBuilderFrame", IRBuilderFrameObj, ffi::Object)
 
virtual ~IRBuilderFrameObj ()=default
 Default destructor.
 
virtual void EnterWithScope ()
 The method called when entering RAII scope.
 
void AddCallback (ffi::TypedFunction< void()> callback)
 Add a callback method invoked when exiting the RAII scope.
 

Static Public Member Functions

static void RegisterReflection ()
 
static void RegisterAttrValidator (ffi::String key, AttrValidator validator)
 
- Static Public Member Functions inherited from tvm::script::ir_builder::ir::StmtFrameObj
static void RegisterReflection ()
 
- Static Public Member Functions inherited from tvm::script::ir_builder::IRBuilderFrameObj
static void RegisterReflection ()
 

Public Attributes

ffi::Optional< ffi::String > name
 The name of the block.
 
ffi::Array< tvm::Var > args
 Function parameters.
 
bool is_private
 Whether the Function is annotated as private.
 
ffi::Optional< Type > ret_type
 The return type of the function.
 
ffi::Map< ffi::String, Any > attrs
 Additional attributes storing the meta-data.
 
bool persistent
 Whether it is a persistent kernel.
 
bool is_declaration {false}
 Whether this frame declares a bodyless signature.
 
ffi::Optional< tvm::tirx::Function > function
 Finalized function and its module identity.
 
ffi::Optional< GlobalVar > global_var
 
- Public Attributes inherited from tvm::script::ir_builder::ir::StmtFrameObj
ffi::Array< tvm::Stmt > stmts
 The statements within this frame.
 
- Public Attributes inherited from tvm::script::ir_builder::IRBuilderFrameObj
std::vector< ffi::TypedFunction< void()> > callbacks
 A list of callbacks used when exiting the frame.
 
Location loc = UnknownLoc()
 Source context retained until this frame constructs its result.
 

Additional Inherited Members

- Static Public Attributes inherited from tvm::script::ir_builder::IRBuilderFrameObj
static constexpr const bool _type_mutable = true
 

Detailed Description

A frame that represents the Function containing TIR statements.

See also
FunctionFrame

Member Typedef Documentation

◆ AttrValidator

using tvm::script::ir_builder::tirx::FunctionFrameObj::AttrValidator = std::function<void(const FunctionFrameObj*, const ffi::Any&)>

Register validation for an extension-owned function attribute.

Member Function Documentation

◆ ExitWithScope()

void tvm::script::ir_builder::tirx::FunctionFrameObj::ExitWithScope ( )
finalvirtual

The method called when exiting RAII scope.

See also
tvm::support::With

Reimplemented from tvm::script::ir_builder::IRBuilderFrameObj.

◆ FinalizeFunction()

virtual tvm::tirx::Function tvm::script::ir_builder::tirx::FunctionFrameObj::FinalizeFunction ( tvm::tirx::Function  func)
virtual

Complete dialect-specific function construction before publication.

Reimplemented in tvm::script::ir_builder::s_tir::FunctionFrameObj.

◆ RegisterAttrValidator()

static void tvm::script::ir_builder::tirx::FunctionFrameObj::RegisterAttrValidator ( ffi::String  key,
AttrValidator  validator 
)
static

◆ RegisterReflection()

static void tvm::script::ir_builder::tirx::FunctionFrameObj::RegisterReflection ( )
inlinestatic

◆ TVM_FFI_DECLARE_OBJECT_INFO()

tvm::script::ir_builder::tirx::FunctionFrameObj::TVM_FFI_DECLARE_OBJECT_INFO ( "script.ir_builder.tirx.FunctionFrame"  ,
FunctionFrameObj  ,
ir::StmtFrameObj   
)

◆ ValidateAttrs()

void tvm::script::ir_builder::tirx::FunctionFrameObj::ValidateAttrs ( ) const

Member Data Documentation

◆ args

ffi::Array<tvm::Var> tvm::script::ir_builder::tirx::FunctionFrameObj::args

Function parameters.

◆ attrs

ffi::Map<ffi::String, Any> tvm::script::ir_builder::tirx::FunctionFrameObj::attrs

Additional attributes storing the meta-data.

◆ function

ffi::Optional<tvm::tirx::Function> tvm::script::ir_builder::tirx::FunctionFrameObj::function

Finalized function and its module identity.

◆ global_var

ffi::Optional<GlobalVar> tvm::script::ir_builder::tirx::FunctionFrameObj::global_var

◆ is_declaration

bool tvm::script::ir_builder::tirx::FunctionFrameObj::is_declaration {false}

Whether this frame declares a bodyless signature.

◆ is_private

bool tvm::script::ir_builder::tirx::FunctionFrameObj::is_private

Whether the Function is annotated as private.

◆ name

ffi::Optional<ffi::String> tvm::script::ir_builder::tirx::FunctionFrameObj::name

The name of the block.

◆ persistent

bool tvm::script::ir_builder::tirx::FunctionFrameObj::persistent

Whether it is a persistent kernel.

◆ ret_type

ffi::Optional<Type> tvm::script::ir_builder::tirx::FunctionFrameObj::ret_type

The return type of the function.


The documentation for this class was generated from the following file: