diff --git a/paddle/fluid/framework/op_registry.h b/paddle/fluid/framework/op_registry.h index d38efbff31..f5bef776d6 100644 --- a/paddle/fluid/framework/op_registry.h +++ b/paddle/fluid/framework/op_registry.h @@ -186,9 +186,8 @@ struct OpKernelRegistrarFunctor { library_type, customized_type_value, - [op_type](const framework::ExecutionContext& ctx) { + [](const framework::ExecutionContext& ctx) { KERNEL_TYPE().Compute(ctx); - CheckKernelLaunch(op_type); }); constexpr auto size = std::tuple_size>::value; OpKernelRegistrarFunctor @@ -257,15 +256,8 @@ struct OpKernelRegistrarFunctorEx( - op_type, - library_type, - customized_type_value, - - [op_type](const framework::ExecutionContext& ctx) { - Functor()(ctx); - CheckKernelLaunch(op_type); - }); + RegisterKernelClass(op_type, library_type, + customized_type_value, Functor()); constexpr auto size = std::tuple_size>::value; @@ -296,7 +288,7 @@ struct OpKernelRegistrarFunctorEx, \ paddle::framework::EmptyGradOpMaker) +#define REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, ...) /** * Macro to register OperatorKernel. */ #define REGISTER_OP_KERNEL_WITH_CUSTOM_TYPE(op_type, library_type, \ + place_class, customized_name, \ + customized_type_value, ...) + +#define REGISTER_OP_KERNEL_WITH_CUSTOM_TYPE__(op_type, library_type, \ place_class, customized_name, \ customized_type_value, ...) \ STATIC_ASSERT_GLOBAL_NAMESPACE( \ @@ -332,18 +331,22 @@ struct OpKernelRegistrarFunctorEx