tvm
Classes | Namespaces | Macros | Typedefs | Variables
target_kind.h File Reference

Target kind registry. More...

#include <tvm/node/attr_registry_map.h>
#include <tvm/node/node.h>
#include <memory>
#include <unordered_map>
#include <utility>
#include <vector>
Include dependency graph for target_kind.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::TargetKindNode
 Target kind, specifies the kind of the target. More...
 
class  tvm::TargetKind
 Managed reference class to TargetKindNode. More...
 
class  tvm::TargetKindAttrMap< ValueType >
 Map<TargetKind, ValueType> used to store meta-information about TargetKind. More...
 
class  tvm::TargetKindRegEntry
 Helper structure to register TargetKind. More...
 
struct  tvm::detail::is_specialized< Type, Container >
 
struct  tvm::detail::is_specialized< Container< Args... >, Container >
 
struct  tvm::detail::ValueTypeInfoMaker< ValueType, IsArray, IsMap >
 

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::detail
 
 tvm::attr
 Generic attribute names that can be attached to any function.
 

Macros

#define TVM_TARGET_KIND_REGISTER_VAR_DEF    static DMLC_ATTRIBUTE_UNUSED ::tvm::TargetKindRegEntry& __make_##TargetKind
 
#define TVM_REGISTER_TARGET_KIND(TargetKindName, DeviceType)
 Register a new target kind, or set attribute of the corresponding target kind. More...
 

Typedefs

using tvm::TargetFeatures = Map< String, ObjectRef >
 Map containing parsed features of a specific Target. More...
 
using tvm::TargetJSON = Map< String, ObjectRef >
 TargetParser to apply on instantiation of a given TargetKind. More...
 
using tvm::FTVMTargetParser = runtime::TypedPackedFunc< TargetJSON(TargetJSON)>
 

Variables

constexpr const char * tvm::attr::kIsExternalCodegen = "is_external_codegen"
 A TargetKind attribute of type Bool. If true, then the target kind name also corresponds to an external codegen 'compiler' name. That name may be used: More...
 
constexpr const char * tvm::attr::kRelayToTIR = "RelayToTIR"
 A TargetKind attribute of type FTVMRelayToTIR. If set, then the target kind name also corresponds to an external codegen 'compiler' name, and the bound value is a Pass to apply before the TVM lowering. More...
 

Detailed Description

Target kind registry.

Macro Definition Documentation

◆ TVM_REGISTER_TARGET_KIND

#define TVM_REGISTER_TARGET_KIND (   TargetKindName,
  DeviceType 
)
Value:
.set_name() \
.set_default_device_type(DeviceType) \
.add_attr_option<Array<String>>("keys") \
.add_attr_option<String>("tag") \
.add_attr_option<String>("device") \
.add_attr_option<String>("model") \
.add_attr_option<Array<String>>("libs") \
.add_attr_option<Target>("host") \
.add_attr_option<Integer>("from_device") \
.add_attr_option<Integer>("target_device_type")
TargetKindRegEntry & set_name()
Set name of the TargetKind to be the same as registry if it is empty.
Definition: target_kind.h:380
static TargetKindRegEntry & RegisterOrGet(const String &target_kind_name)
Register or get a new entry.
TargetKindRegEntry & set_default_device_type(int device_type)
Set DLPack's device_type the target.
Definition: target_kind.h:341
TargetKindRegEntry & add_attr_option(const String &key)
Register a valid configuration option and its ValueType for validation.
Definition: target_kind.h:365
#define TVM_STR_CONCAT(__x, __y)
Definition: object.h:715
#define TVM_TARGET_KIND_REGISTER_VAR_DEF
Definition: target_kind.h:387

Register a new target kind, or set attribute of the corresponding target kind.

Parameters
TargetKindNameThe name of target kind
DeviceTypeThe DLDeviceType of the target kind
.set_attr<TPreCodegenPass>("TPreCodegenPass", a-pre-codegen-pass)
.add_attr_option<Bool>("system_lib")
.add_attr_option<String>("mtriple")
.add_attr_option<String>("mattr");
#define TVM_REGISTER_TARGET_KIND(TargetKindName, DeviceType)
Register a new target kind, or set attribute of the corresponding target kind.
Definition: target_kind.h:437

◆ TVM_TARGET_KIND_REGISTER_VAR_DEF

#define TVM_TARGET_KIND_REGISTER_VAR_DEF    static DMLC_ATTRIBUTE_UNUSED ::tvm::TargetKindRegEntry& __make_##TargetKind