HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime::KernelDefBuilder Class Reference

#include <kernel_def_builder.h>

Public Member Functions

 KernelDefBuilder ()
 
KernelDefBuilderSetName (const std::string &op_name)
 
KernelDefBuilderSetName (const char *op_name)
 
KernelDefBuilderSetDomain (const std::string &domain)
 
KernelDefBuilderSetDomain (const char *domain)
 
KernelDefBuilderSinceVersion (int since_version)
 
KernelDefBuilderSinceVersion (int since_version_start, int since_version_end)
 
KernelDefBuilderProvider (ProviderType provider_type)
 
KernelDefBuilderProvider (const char *provider_type)
 
KernelDefBuilderTypeConstraint (const std::string &arg_name, std::vector< MLDataType > types)
 
KernelDefBuilderTypeConstraint (const char *arg_name, std::vector< MLDataType > types)
 
KernelDefBuilderTypeConstraint (const std::string &arg_name, MLDataType type)
 
KernelDefBuilderTypeConstraint (const char *arg_name, MLDataType type)
 
KernelDefBuilderMayInplace (const std::vector< std::pair< int, int >> &inplaces)
 
KernelDefBuilderMayInplace (int input_index, int output_index)
 
KernelDefBuilderAlias (const std::vector< std::pair< int, int >> &aliases)
 
KernelDefBuilderAlias (int input_index, int output_index)
 
KernelDefBuilderVariadicAlias (int input_offset, int output_offset)
 
KernelDefBuilderAllocateInputsContiguously ()
 
KernelDefBuilderExternalOutputs ()
 
KernelDefBuilderInputMemoryType (OrtMemType type, int input_index)
 
KernelDefBuilderInputMemoryType (OrtMemType type, const std::vector< int > &input_indexes)
 
KernelDefBuilderOutputMemoryType (OrtMemType type, int output_index)
 
KernelDefBuilderOutputMemoryType (OrtMemType type, const std::vector< int > &output_indexes)
 
KernelDefBuilderExecQueueId (int queue_id)
 
KernelDefBuilderSetDefaultInputsMemoryType (OrtMemType mem_type)
 
KernelDefBuilderSetDefaultOutputMemoryType (OrtMemType mem_type)
 
std::unique_ptr< KernelDefBuild ()
 

Static Public Member Functions

static std::unique_ptr
< KernelDefBuilder
Create ()
 

Detailed Description

Definition at line 166 of file kernel_def_builder.h.

Constructor & Destructor Documentation

onnxruntime::KernelDefBuilder::KernelDefBuilder ( )
inlineexplicit

Definition at line 170 of file kernel_def_builder.h.

Member Function Documentation

KernelDefBuilder& onnxruntime::KernelDefBuilder::Alias ( const std::vector< std::pair< int, int >> &  aliases)

Alias mapping from inputs to outputs. Different from Inplace that the content of the tensor is not changed. This is to take care of operators such as Identity and Reshape.

KernelDefBuilder& onnxruntime::KernelDefBuilder::Alias ( int  input_index,
int  output_index 
)
KernelDefBuilder& onnxruntime::KernelDefBuilder::AllocateInputsContiguously ( )
inline

Specify that this kernel requires input tensors to be allocated contiguously. This allows kernels to execute as a single large computation, rather than numerous smaller computations.

Definition at line 250 of file kernel_def_builder.h.

std::unique_ptr<KernelDef> onnxruntime::KernelDefBuilder::Build ( )
inline

Return the kernel definition, passing ownership of the KernelDef to the caller

Definition at line 344 of file kernel_def_builder.h.

static std::unique_ptr<KernelDefBuilder> onnxruntime::KernelDefBuilder::Create ( )
inlinestatic

Definition at line 168 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::ExecQueueId ( int  queue_id)
inline

Specify that this kernel runs on which execution queue in the provider

Definition at line 320 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::ExternalOutputs ( )
inline

Specify that this kernel's output buffers are passed from external, i.e. not created or managed by ORT's memory allocator.

Definition at line 259 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::InputMemoryType ( OrtMemType  type,
int  input_index 
)
inline

Specify that this kernel requires an input arg in certain memory type (instead of the default, device memory).

Definition at line 281 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::InputMemoryType ( OrtMemType  type,
const std::vector< int > &  input_indexes 
)
inline

Specify that this kernel requires input arguments in certain memory type (instead of the default, device memory).

Definition at line 290 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::MayInplace ( const std::vector< std::pair< int, int >> &  inplaces)

Inplace mapping from inputs to outputs allowed. It means that uplayer runtime could do memory in-place optimization as it will not impact the correctness of this kernel.

KernelDefBuilder& onnxruntime::KernelDefBuilder::MayInplace ( int  input_index,
int  output_index 
)
KernelDefBuilder& onnxruntime::KernelDefBuilder::OutputMemoryType ( OrtMemType  type,
int  output_index 
)
inline

Specify that this kernel provides an output arg in certain memory type (instead of the default, device memory).

Definition at line 301 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::OutputMemoryType ( OrtMemType  type,
const std::vector< int > &  output_indexes 
)
inline

Specify that this kernel provides an output arguments in certain memory type (instead of the default, device memory).

Definition at line 310 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::Provider ( ProviderType  provider_type)

The execution provider type of the kernel.

KernelDefBuilder& onnxruntime::KernelDefBuilder::Provider ( const char *  provider_type)
KernelDefBuilder& onnxruntime::KernelDefBuilder::SetDefaultInputsMemoryType ( OrtMemType  mem_type)
inline

Specify the default inputs memory type, if not specified, it is DefaultMemory

Definition at line 328 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::SetDefaultOutputMemoryType ( OrtMemType  mem_type)
inline

Specify the default outputs memory type, if not specified, it is DefaultMemory

Definition at line 336 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::SetDomain ( const std::string domain)
KernelDefBuilder& onnxruntime::KernelDefBuilder::SetDomain ( const char *  domain)
KernelDefBuilder& onnxruntime::KernelDefBuilder::SetName ( const std::string op_name)
KernelDefBuilder& onnxruntime::KernelDefBuilder::SetName ( const char *  op_name)
KernelDefBuilder& onnxruntime::KernelDefBuilder::SinceVersion ( int  since_version)
inline

This kernel supports operator definition since <since_version> (to latest).

Definition at line 182 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::SinceVersion ( int  since_version_start,
int  since_version_end 
)
inline

The start and end version should be set accordingly per version range for each domain registered in OpSchemaRegistry::DomainToVersionRange in .h as below. Key: domain. Value: <lowest version, highest version> pair. std::unordered_map<std::string, std::pair<int, int>> map_;

Definition at line 194 of file kernel_def_builder.h.

KernelDefBuilder& onnxruntime::KernelDefBuilder::TypeConstraint ( const std::string arg_name,
std::vector< MLDataType types 
)

Specify the set of types that this kernel supports. A further restriction of the set of types specified in the op schema.

Parameters
arg_nameThe arg name can be either op formal parameter name, say "X", or type argument name specified in op schema, say "T".
typesThe types that are supported in this build.
KernelDefBuilder& onnxruntime::KernelDefBuilder::TypeConstraint ( const char *  arg_name,
std::vector< MLDataType types 
)
KernelDefBuilder& onnxruntime::KernelDefBuilder::TypeConstraint ( const std::string arg_name,
MLDataType  type 
)

Like TypeConstraint but supports just a single type.

KernelDefBuilder& onnxruntime::KernelDefBuilder::TypeConstraint ( const char *  arg_name,
MLDataType  type 
)
KernelDefBuilder& onnxruntime::KernelDefBuilder::VariadicAlias ( int  input_offset,
int  output_offset 
)

Apply variadic number of alias mapping from inputs to outputs. This is effectively applying Alias(i + input_offset, i + output_offset) for i >= 0


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