Helper class for building a KernelRegistrar. More...
#include <KernelRegistration.h>
Public Member Functions | |
constexpr | KernelRegistrationBuilder (OpHandleGetter *op) |
constexpr | KernelRegistrationBuilder (OpHandleGetter *op, c10::optional< TensorTypeId > dispatch_key, KernelFunction *kernel, KernelCacheCreatorFunction *cache_creator) |
operator KernelRegistrar ()&& | |
Implicit coercion to KernelRegistrar that finalizes the builder and creates the object. More... | |
AT_CPP14_CONSTEXPR KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags|DISPATCH_KEY_PRESENT > | dispatchKey (TensorTypeId dispatch_key)&& |
Specify the dispatch key for this dispatch registration. More... | |
template<KernelFunction * kernel_func> | |
AT_CPP14_CONSTEXPR KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags|KERNEL_PRESENT > | kernel ()&& |
Specify the concrete function implementation for this dispatch registration. More... | |
template<class FuncType , FuncType * kernel_func> | |
AT_CPP14_CONSTEXPR KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags|KERNEL_PRESENT > | kernel ()&& |
Specify the concrete function implementation for this dispatch registration. More... | |
template<class Cache > | |
AT_CPP14_CONSTEXPR KernelRegistrationBuilder< Cache, FieldsPresentFlags|CACHE_PRESENT > | withCache ()&& |
Specify the dispatch key for this dispatch registration. More... | |
Helper class for building a KernelRegistrar.
This permits "keyword-argument" like syntax when performing operator registration, e.g., as in:
C10_REGISTER_KERNEL(::ops::add_notensor) .kernel(&add_notensor_op) .dispatchKey("bla");
Expanded, this macro invocation looks like:
static KernelRegistrar<::ops::add_notensor> _anon0 = KernelRegistrationBuilder<::ops::add_notensor, false, false>() .kernel(&add_notensor_op) .dispatchKey("bla");
The resulting full expression is implicitly convertible to a KernelRegistrar.
Definition at line 181 of file KernelRegistration.h.
|
inline |
Specify the dispatch key for this dispatch registration.
dispatch_key | dispatch key to register the function to |
Definition at line 231 of file KernelRegistration.h.
|
inline |
Specify the concrete function implementation for this dispatch registration.
kernel | concrete function implementation to be registered |
Definition at line 242 of file KernelRegistration.h.
|
inline |
Specify the concrete function implementation for this dispatch registration.
kernel | concrete function implementation to be registered |
Definition at line 254 of file KernelRegistration.h.
|
inline |
Implicit coercion to KernelRegistrar that finalizes the builder and creates the object.
Definition at line 220 of file KernelRegistration.h.
|
inline |
Specify the dispatch key for this dispatch registration.
dispatch_key | dispatch key to register the function to |
Definition at line 265 of file KernelRegistration.h.