Per-operator dispatch table. More...
#include <DispatchTable.h>
Public Member Functions | |
DispatchTable (const FunctionSchema &schema) | |
DispatchTable (DispatchTable &&)=delete | |
DispatchTable & | operator= (DispatchTable &&)=delete |
DispatchTable (const DispatchTable &)=delete | |
DispatchTable & | operator= (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 DispatchTableEntry & | lookup (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 |
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.
|
inline |
Deregister the kernel for some dispatch key.
dispatch_key | Dispatch key to unregister. |
Definition at line 149 of file DispatchTable.h.
|
inline |
Perform a dynamic dispatch on this table and find the kernel to call for the given arguments.
args | Arguments to invoke the function with |
Definition at line 160 of file DispatchTable.h.
|
inline |
Register a kernel in the table at some dispatch key.
func | Concrete kernel function implementation to register |
dispatch_key | Dispatch key to define when this kernel is selected |
Definition at line 135 of file DispatchTable.h.