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

Helper structure to register TargetKind. More...

#include <target_kind.h>

Collaboration diagram for tvm::TargetKindRegEntry:

Public Member Functions

template<typename ValueType >
TargetKindRegEntryset_attr (const String &attr_name, const ValueType &value, int plevel=10)
 Register additional attributes to target_kind. More...
 
TargetKindRegEntryset_default_device_type (int device_type)
 Set DLPack's device_type the target. More...
 
TargetKindRegEntryset_default_keys (std::vector< String > keys)
 Set DLPack's device_type the target. More...
 
template<typename FLambda >
TargetKindRegEntryset_attrs_preprocessor (FLambda f)
 Set the pre-processing function applied upon target creation. More...
 
TargetKindRegEntryset_target_parser (FTVMTargetParser parser)
 Set the parsing function applied upon target creation. More...
 
template<typename ValueType >
TargetKindRegEntryadd_attr_option (const String &key)
 Register a valid configuration option and its ValueType for validation. More...
 
template<typename ValueType >
TargetKindRegEntryadd_attr_option (const String &key, ObjectRef default_value)
 Register a valid configuration option and its ValueType for validation. More...
 
TargetKindRegEntryset_name ()
 Set name of the TargetKind to be the same as registry if it is empty. More...
 

Static Public Member Functions

static Array< StringListTargetKinds ()
 List all the entry names in the registry. More...
 
static Map< String, StringListTargetKindOptions (const TargetKind &kind)
 Get all supported option names and types for a given Target kind. More...
 
static TargetKindRegEntryRegisterOrGet (const String &target_kind_name)
 Register or get a new entry. More...
 

Friends

template<typename , typename >
class AttrRegistry
 
class TargetKind
 

Detailed Description

Helper structure to register TargetKind.

See also
TVM_REGISTER_TARGET_KIND

Member Function Documentation

◆ add_attr_option() [1/2]

template<typename ValueType >
TargetKindRegEntry & tvm::TargetKindRegEntry::add_attr_option ( const String key)
inline

Register a valid configuration option and its ValueType for validation.

Parameters
keyThe configuration key
Template Parameters
ValueTypeThe value type to be registered

◆ add_attr_option() [2/2]

template<typename ValueType >
TargetKindRegEntry & tvm::TargetKindRegEntry::add_attr_option ( const String key,
ObjectRef  default_value 
)
inline

Register a valid configuration option and its ValueType for validation.

Parameters
keyThe configuration key
default_valueThe default value of the key
Template Parameters
ValueTypeThe value type to be registered

◆ ListTargetKindOptions()

static Map<String, String> tvm::TargetKindRegEntry::ListTargetKindOptions ( const TargetKind kind)
static

Get all supported option names and types for a given Target kind.

Returns
Map of option name to type

◆ ListTargetKinds()

static Array<String> tvm::TargetKindRegEntry::ListTargetKinds ( )
static

List all the entry names in the registry.

Returns
The entry names.

◆ RegisterOrGet()

static TargetKindRegEntry& tvm::TargetKindRegEntry::RegisterOrGet ( const String target_kind_name)
static

Register or get a new entry.

Parameters
target_kind_nameThe name of the TargetKind.
Returns
the corresponding entry.

◆ set_attr()

template<typename ValueType >
TargetKindRegEntry & tvm::TargetKindRegEntry::set_attr ( const String attr_name,
const ValueType &  value,
int  plevel = 10 
)
inline

Register additional attributes to target_kind.

Parameters
attr_nameThe name of the attribute.
valueThe value to be set.
plevelThe priority level of this attribute, an higher priority level attribute will replace lower priority level attribute. Must be bigger than 0.

Cannot set with same plevel twice in the code.

Template Parameters
ValueTypeThe type of the value to be set.

◆ set_attrs_preprocessor()

template<typename FLambda >
TargetKindRegEntry & tvm::TargetKindRegEntry::set_attrs_preprocessor ( FLambda  f)
inline

Set the pre-processing function applied upon target creation.

Template Parameters
FLambdaType of the function
Parameters
fThe pre-processing function

◆ set_default_device_type()

TargetKindRegEntry & tvm::TargetKindRegEntry::set_default_device_type ( int  device_type)
inline

Set DLPack's device_type the target.

Parameters
device_typeDevice type

◆ set_default_keys()

TargetKindRegEntry & tvm::TargetKindRegEntry::set_default_keys ( std::vector< String keys)
inline

Set DLPack's device_type the target.

Parameters
keysThe default keys

◆ set_name()

TargetKindRegEntry & tvm::TargetKindRegEntry::set_name ( )
inline

Set name of the TargetKind to be the same as registry if it is empty.

◆ set_target_parser()

TargetKindRegEntry & tvm::TargetKindRegEntry::set_target_parser ( FTVMTargetParser  parser)
inline

Set the parsing function applied upon target creation.

Parameters
parserThe Target parsing function

Friends And Related Function Documentation

◆ AttrRegistry

template<typename , typename >
friend class AttrRegistry
friend

◆ TargetKind

friend class TargetKind
friend

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