tvm
Public Member Functions | Static Public Member Functions | Friends | List of all members
tvm::SEScope Class Reference

Managed reference class to SEScopeNode. More...

#include <se_scope.h>

Inheritance diagram for tvm::SEScope:
Collaboration diagram for tvm::SEScope:

Public Member Functions

 SEScope (DLDeviceType device_type=kInvalidDeviceType, int virtual_device_id=-1, Target target={}, MemoryScope memory_scope={})
 Construct an SEScope. More...
 
 TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (SEScope, ObjectRef, SEScopeNode)
 
- Public Member Functions inherited from tvm::runtime::ObjectRef
 ObjectRef ()=default
 default constructor More...
 
 ObjectRef (ObjectPtr< Object > data)
 Constructor from existing object ptr. More...
 
bool same_as (const ObjectRef &other) const
 Comparator. More...
 
bool operator== (const ObjectRef &other) const
 Comparator. More...
 
bool operator!= (const ObjectRef &other) const
 Comparator. More...
 
bool operator< (const ObjectRef &other) const
 Comparator. More...
 
bool defined () const
 
const Objectget () const
 
const Objectoperator-> () const
 
bool unique () const
 
int use_count () const
 
template<typename ObjectType >
const ObjectType * as () const
 Try to downcast the internal Object to a raw pointer of a corresponding type. More...
 

Static Public Member Functions

static SEScope FullyUnconstrained ()
 Returns the unique fully unconstrained SEScope. More...
 
static SEScope ForDeviceType (DLDeviceType device_type, int virtual_device_id=-1)
 Returns the SEScope for device_type and (if not -1) virtual_device_id. The target and memory scope will be unconstrained. More...
 
static SEScope ForDeviceType (int device_type, int virtual_device_id=-1)
 
static SEScope ForDeviceType (const Integer &device_type, int virtual_device_id=-1)
 
static SEScope ForDevice (const Device &device)
 Returns the SEScope for device. More...
 
static SEScope ForDeviceAndTarget (const Device &device, Target target)
 Returns the SEScope for device and target. More...
 
static SEScope ForDeviceTargetAndMemoryScope (const Device &device, Target target, MemoryScope memory_scope)
 Returns the SEScope for device, target and memory_scope. More...
 
static Optional< SEScopeJoin (const SEScope &lhs, const SEScope &rhs)
 Returns the 'join' of lhs and rhs. The result will agree pointwise with lhs and rhs on all their constrained fields. Returns the null optional if no such join exists, ie there's disagreement on at least one constrained field. More...
 
static SEScope Default (const SEScope &lhs, const SEScope &rhs)
 Returns the 'default' of lhs and rhs. The result will be lhs, except any unconstrained fields in lhs will take their value from rhs. Always well-defined. More...
 

Friends

class SEScopeCache
 

Additional Inherited Members

- Public Types inherited from tvm::runtime::ObjectRef
using ContainerType = Object
 type indicate the container type. More...
 
- Static Public Attributes inherited from tvm::runtime::ObjectRef
static constexpr bool _type_is_nullable = true
 
- Protected Member Functions inherited from tvm::runtime::ObjectRef
Objectget_mutable () const
 
- Static Protected Member Functions inherited from tvm::runtime::ObjectRef
template<typename T >
static T DowncastNoCheck (ObjectRef ref)
 Internal helper function downcast a ref without check. More...
 
static void FFIClearAfterMove (ObjectRef *ref)
 Clear the object ref data field without DecRef after we successfully moved the field. More...
 
template<typename ObjectType >
static ObjectPtr< ObjectType > GetDataPtr (const ObjectRef &ref)
 Internal helper function get data_ as ObjectPtr of ObjectType. More...
 
- Protected Attributes inherited from tvm::runtime::ObjectRef
ObjectPtr< Objectdata_
 Internal pointer that backs the reference. More...
 

Detailed Description

Managed reference class to SEScopeNode.

See also
SEScopeNode.

Constructor & Destructor Documentation

◆ SEScope()

tvm::SEScope::SEScope ( DLDeviceType  device_type = kInvalidDeviceType,
int  virtual_device_id = -1,
Target  target = {},
MemoryScope  memory_scope = {} 
)
explicit

Construct an SEScope.

Parameters
device_typeThe device type for the virtual device, or kInvalidDeviceType if unconstrained. If target is defined then must match its target->kind->device_type.
virtual_device_idThe device id for the virtual device, or -1 if unconstrained.
targetThe target describing how to compile for the virtual device, or null if unconstrained.
memory_scopeThe memory scope w.r.t. the virtual device which holds data, or "" if unconstrained.
Returns
The SEScope

Member Function Documentation

◆ Default()

static SEScope tvm::SEScope::Default ( const SEScope lhs,
const SEScope rhs 
)
static

Returns the 'default' of lhs and rhs. The result will be lhs, except any unconstrained fields in lhs will take their value from rhs. Always well-defined.

◆ ForDevice()

static SEScope tvm::SEScope::ForDevice ( const Device device)
inlinestatic

Returns the SEScope for device.

◆ ForDeviceAndTarget()

static SEScope tvm::SEScope::ForDeviceAndTarget ( const Device device,
Target  target 
)
inlinestatic

Returns the SEScope for device and target.

◆ ForDeviceTargetAndMemoryScope()

static SEScope tvm::SEScope::ForDeviceTargetAndMemoryScope ( const Device device,
Target  target,
MemoryScope  memory_scope 
)
inlinestatic

Returns the SEScope for device, target and memory_scope.

◆ ForDeviceType() [1/3]

static SEScope tvm::SEScope::ForDeviceType ( DLDeviceType  device_type,
int  virtual_device_id = -1 
)
inlinestatic

Returns the SEScope for device_type and (if not -1) virtual_device_id. The target and memory scope will be unconstrained.

◆ ForDeviceType() [2/3]

static SEScope tvm::SEScope::ForDeviceType ( int  device_type,
int  virtual_device_id = -1 
)
inlinestatic

◆ ForDeviceType() [3/3]

static SEScope tvm::SEScope::ForDeviceType ( const Integer device_type,
int  virtual_device_id = -1 
)
inlinestatic

◆ FullyUnconstrained()

static SEScope tvm::SEScope::FullyUnconstrained ( )
static

Returns the unique fully unconstrained SEScope.

◆ Join()

static Optional<SEScope> tvm::SEScope::Join ( const SEScope lhs,
const SEScope rhs 
)
static

Returns the 'join' of lhs and rhs. The result will agree pointwise with lhs and rhs on all their constrained fields. Returns the null optional if no such join exists, ie there's disagreement on at least one constrained field.

◆ TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS()

tvm::SEScope::TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS ( SEScope  ,
ObjectRef  ,
SEScopeNode   
)

Friends And Related Function Documentation

◆ SEScopeCache

friend class SEScopeCache
friend

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