Class IRBuilder#

Inheritance Relationships#

Base Type#

  • public ffi::ObjectRef

Class Documentation#

class IRBuilder : public ffi::ObjectRef#

Managed reference to an IRBuilderObj.

See also

IRBuilderObj

Public Types

using ContainerType = IRBuilderObj#

Public Functions

inline IRBuilder()#

Creates an IRBuilder.

inline explicit IRBuilder(::tvm::ffi::UnsafeInit tag)#
inline __PtrType operator->() const#
inline __PtrType get() const#
void 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

See also

tvm::support::With

void ExitWithScope()#

Exit the RAII scope.

See also

tvm::support::With

Public Static Functions

static IRBuilder Current()#

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

See also

tvm::support::With

Returns:

The current IRBuilder.

static bool IsInScope()#

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

template<class TObjectRef>
static inline TObjectRef Name(ffi::String name, TObjectRef obj)#

Give a string name to the obj.

Template Parameters:

TObjectRef – The type of the object to name.

Parameters:
  • name – The name to give to the object.

  • obj – The object to name.