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

Top-level dispatch interface for dispatching via the dynamic dispatcher. More...

#include <Dispatcher.h>

Public Member Functions

OperatorHandle registerSchema (FunctionSchema schema)
 Register a new operator schema. More...
 
void deregisterSchema (const OperatorHandle &op)
 Remove an operator from the dispatcher. More...
 
void registerKernel (const OperatorHandle &op, TensorTypeId dispatch_key, KernelFunction *kernel_func, KernelCacheCreatorFunction *cache_creator_func)
 Register an operator to the dispatch table for an operator.
 
void deregisterKernel (const OperatorHandle &op, TensorTypeId dispatch_key)
 Remove an operator from the dispatch table for an operator.
 
OpKernel lookup (const OperatorHandle &op, const Stack *stack) const
 Perform a dynamic dispatch and get the kernel for an operator.
 
void addRegistrationListener (std::unique_ptr< OpRegistrationListener > listener)
 Add a listener that gets called whenever a new op is registered or an existing op is deregistered. More...
 

Static Public Member Functions

static Dispatchersingleton ()
 

Friends

class OperatorHandle
 

Detailed Description

Top-level dispatch interface for dispatching via the dynamic dispatcher.

Definition at line 70 of file Dispatcher.h.

Member Function Documentation

void c10::Dispatcher::addRegistrationListener ( std::unique_ptr< OpRegistrationListener listener)

Add a listener that gets called whenever a new op is registered or an existing op is deregistered.

Immediately after registering, this listener gets called for all previously registered ops, so it can be used to keep track of ops registered with this dispatcher.

Definition at line 79 of file Dispatcher.cpp.

void c10::Dispatcher::deregisterSchema ( const OperatorHandle op)

Remove an operator from the dispatcher.

Make sure you removed all kernels for this operatorbefore calling this.

Definition at line 55 of file Dispatcher.cpp.

OperatorHandle c10::Dispatcher::registerSchema ( FunctionSchema  schema)

Register a new operator schema.

The handle returned can be used to register kernels to this operator or to call it.

Definition at line 42 of file Dispatcher.cpp.


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