diff --git a/paddle/fluid/framework/op_registry.h b/paddle/fluid/framework/op_registry.h index a1f07f9f25..179df3b981 100644 --- a/paddle/fluid/framework/op_registry.h +++ b/paddle/fluid/framework/op_registry.h @@ -178,9 +178,8 @@ struct OpKernelRegistrarFunctor { RegisterKernelClass( op_type, 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 @@ -240,13 +239,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; @@ -275,7 +269,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( \ @@ -311,18 +312,22 @@ struct OpKernelRegistrarFunctorEx