Caffe2 - C++ API
A deep learning, cross platform ML framework
Data Structures | Public Member Functions
c10::DispatchTable Class Referencefinal

Per-operator dispatch table. More...

#include <DispatchTable.h>

Public Member Functions

 DispatchTable (const FunctionSchema &schema)
 
 DispatchTable (DispatchTable &&)=delete
 
DispatchTableoperator= (DispatchTable &&)=delete
 
 DispatchTable (const DispatchTable &)=delete
 
DispatchTableoperator= (const DispatchTable &)=delete
 
void registerKernel (TensorTypeId dispatch_key, const DispatchTableEntry &kernel)
 Register a kernel in the table at some dispatch key. More...
 
void deregisterKernel (TensorTypeId dispatch_key)
 Deregister the kernel for some dispatch key. More...
 
const DispatchTableEntrylookup (const Stack *stack) const
 Perform a dynamic dispatch on this table and find the kernel to call for the given arguments. More...
 
bool isEmpty () const
 

Detailed Description

Per-operator dispatch table.

Given an operator specified by a FunctionSchema, this class records a dispatch table for various kernels provided for this operator. For example, if we consider the operator add(Tensor, Tensor), the dispatch table for this operator may contain implementations for various dynamic tensor types, such as CPUTensorId, CUDATensorId, etc.

Definition at line 118 of file DispatchTable.h.

Member Function Documentation

void c10::DispatchTable::deregisterKernel ( TensorTypeId  dispatch_key)
inline

Deregister the kernel for some dispatch key.

Parameters
dispatch_keyDispatch key to unregister.

Definition at line 149 of file DispatchTable.h.

const DispatchTableEntry& c10::DispatchTable::lookup ( const Stack *  stack) const
inline

Perform a dynamic dispatch on this table and find the kernel to call for the given arguments.

Parameters
argsArguments to invoke the function with
Returns
Kernel function pointing to the right kernel for the given arguments

Definition at line 160 of file DispatchTable.h.

void c10::DispatchTable::registerKernel ( TensorTypeId  dispatch_key,
const DispatchTableEntry kernel 
)
inline

Register a kernel in the table at some dispatch key.

Parameters
funcConcrete kernel function implementation to register
dispatch_keyDispatch key to define when this kernel is selected

Definition at line 135 of file DispatchTable.h.


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