tvm
Public Member Functions | Static Public Member Functions | List of all members
tvm::script::ir_builder::IRBuilder Class Reference

Managed reference to an IRBuilderNode. More...

#include <base.h>

Inheritance diagram for tvm::script::ir_builder::IRBuilder:
Collaboration diagram for tvm::script::ir_builder::IRBuilder:

Public Member Functions

 IRBuilder ()
 Creates an IRBuilder. More...
 
 TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS (IRBuilder, ObjectRef, IRBuilderNode)
 
void EnterWithScope ()
 Puts the current IRBuilder into a thread-local scope, which can be retrieved using IRBuilder::Current(). More...
 
void ExitWithScope ()
 Exit the RAII scope. More...
 

Static Public Member Functions

static IRBuilder Current ()
 Get the current IRBuilder in the current thread-local scope. More...
 
static bool IsInScope ()
 See if the current thread-local scope has an IRBuilder. More...
 
template<class TObjectRef >
static TObjectRef Name (String name, TObjectRef obj)
 Give a string name to the obj More...
 

Detailed Description

Managed reference to an IRBuilderNode.

See also
IRBuilderNode

Constructor & Destructor Documentation

◆ IRBuilder()

tvm::script::ir_builder::IRBuilder::IRBuilder ( )

Member Function Documentation

◆ Current()

static IRBuilder tvm::script::ir_builder::IRBuilder::Current ( )
static

Get the current IRBuilder in the current thread-local scope.

Returns
The current IRBuilder.
See also
IRBuilder::EnterWithScope
IRBuilder::ExitWithScope
tvm::support::With
Examples
/workspace/include/tvm/script/ir_builder/base.h.

◆ EnterWithScope()

void tvm::script::ir_builder::IRBuilder::EnterWithScope ( )

Puts the current IRBuilder into a thread-local scope, which can be retrieved using IRBuilder::Current().

IRBuilder builder;
{
With<IRBuilder> _(builder);
// IRBuilder::Current() == builder
}
// IRBuilder::Current() == nullptr
IRBuilder()
Creates an IRBuilder.
See also
IRBuilder::Current
IRBuilder::ExitWithScope
tvm::support::With
Examples
/workspace/include/tvm/script/ir_builder/base.h.

◆ ExitWithScope()

void tvm::script::ir_builder::IRBuilder::ExitWithScope ( )

Exit the RAII scope.

See also
IRBuilder::EnterWithScope
IRBuilder::Current
tvm::support::With
Examples
/workspace/include/tvm/script/ir_builder/base.h.

◆ IsInScope()

static bool tvm::script::ir_builder::IRBuilder::IsInScope ( )
static

See if the current thread-local scope has an IRBuilder.

Examples
/workspace/include/tvm/script/ir_builder/base.h.

◆ Name()

template<class TObjectRef >
TObjectRef tvm::script::ir_builder::IRBuilder::Name ( String  name,
TObjectRef  obj 
)
inlinestatic

Give a string name to the obj

Template Parameters
TObjectRefThe type of the object to name.
Parameters
nameThe name to give to the object.
objThe object to name.
Examples
/workspace/include/tvm/script/ir_builder/base.h.

◆ TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS()

tvm::script::ir_builder::IRBuilder::TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS ( IRBuilder  ,
ObjectRef  ,
IRBuilderNode   
)

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