Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags > Class Template Referencefinal

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...
 

Detailed Description

template<class CacheTypeOrVoid, uint64_t FieldsPresentFlags>
class c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags >

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.

Member Function Documentation

template<class CacheTypeOrVoid, uint64_t FieldsPresentFlags>
AT_CPP14_CONSTEXPR KernelRegistrationBuilder<CacheTypeOrVoid, FieldsPresentFlags | DISPATCH_KEY_PRESENT> c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags >::dispatchKey ( TensorTypeId  dispatch_key)
inline

Specify the dispatch key for this dispatch registration.

Parameters
dispatch_keydispatch key to register the function to
Returns
"this" for method chaining

Definition at line 231 of file KernelRegistration.h.

template<class CacheTypeOrVoid, uint64_t FieldsPresentFlags>
template<KernelFunction * kernel_func>
AT_CPP14_CONSTEXPR KernelRegistrationBuilder<CacheTypeOrVoid, FieldsPresentFlags | KERNEL_PRESENT> c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags >::kernel ( )
inline

Specify the concrete function implementation for this dispatch registration.

Parameters
kernelconcrete function implementation to be registered
Returns
"this" for method chaining

Definition at line 242 of file KernelRegistration.h.

template<class CacheTypeOrVoid, uint64_t FieldsPresentFlags>
template<class FuncType , FuncType * kernel_func>
AT_CPP14_CONSTEXPR KernelRegistrationBuilder<CacheTypeOrVoid, FieldsPresentFlags | KERNEL_PRESENT> c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags >::kernel ( )
inline

Specify the concrete function implementation for this dispatch registration.

Parameters
kernelconcrete function implementation to be registered
Returns
"this" for method chaining

Definition at line 254 of file KernelRegistration.h.

template<class CacheTypeOrVoid, uint64_t FieldsPresentFlags>
c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags >::operator KernelRegistrar ( )
inline

Implicit coercion to KernelRegistrar that finalizes the builder and creates the object.

Returns
Produced KernelRegistrar

Definition at line 220 of file KernelRegistration.h.

template<class CacheTypeOrVoid, uint64_t FieldsPresentFlags>
template<class Cache >
AT_CPP14_CONSTEXPR KernelRegistrationBuilder<Cache, FieldsPresentFlags | CACHE_PRESENT> c10::KernelRegistrationBuilder< CacheTypeOrVoid, FieldsPresentFlags >::withCache ( )
inline

Specify the dispatch key for this dispatch registration.

Parameters
dispatch_keydispatch key to register the function to
Returns
"this" for method chaining

Definition at line 265 of file KernelRegistration.h.


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