This class represents an operator kernel, i.e. More...
#include <Dispatcher.h>
Public Member Functions | |
OpKernel (OpKernel &&)=default | |
OpKernel & | operator= (OpKernel &&)=default |
OpKernel (const OpKernel &)=delete | |
OpKernel & | operator= (const OpKernel &)=delete |
void | call (Stack *stack) const |
Call the operator kernel with the given arguments. | |
Friends | |
class | Dispatcher |
This class represents an operator kernel, i.e.
an operator after it was dispatched to a certain device. You can use it to call the kernel.
You can keep this OpKernel instance around to avoid future dispatch when you know it'd dispatch to the same kernel anyhow.
Also, keeping around the OpKernel instance will keep around a local cache that is used by some kernels to get better performance when they're called multiple times (mostly Caffe2 kernels do that).
OpKernel is only threadsafe if the kernel is threadsafe. There are no mutexes protecting the kernel cache, so if the kernel uses the cache and doesn't have mutexes for it, it will likely not be threadsafe.
Definition at line 27 of file Dispatcher.h.