diff --git a/src/framework/op_registry.h b/src/framework/op_registry.h index 74a4b2725076dc44f53b7970f1e931bad46214a6..f1f7a954e07bc403476d5ac987b94aa9c6700e29 100644 --- a/src/framework/op_registry.h +++ b/src/framework/op_registry.h @@ -98,67 +98,68 @@ class OpRegistry { #ifdef PADDLE_MOBILE_CPU -#define REGISTER_OPERATOR_CPU(op_type, op_class) \ - template \ +#define REGISTER_OPERATOR_CPU(op_type, op_class) \ + template \ class _OpClass_##op_type##_cpu : public op_class { \ - public: \ + public: \ DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_cpu, op_class); \ - }; \ - static paddle_mobile::framework::OperatorRegistrar< \ + }; \ + static paddle_mobile::framework::OperatorRegistrar< \ paddle_mobile::CPU, _OpClass_##op_type##_cpu> \ __op_registrar_##op_type##__cpu(#op_type); \ - int TouchOpRegistrar_##op_type##_cpu() { \ + int TouchOpRegistrar_##op_type##_cpu() { \ __op_registrar_##op_type##__cpu.Touch(); \ - return 0; \ + return 0; \ } -#define USE_OP_CPU(op_type) \ - extern int TouchOpRegistrar_##op_type##_cpu(); \ +#define USE_OP_CPU(op_type) \ + extern int TouchOpRegistrar_##op_type##_cpu(); \ static int use_op_itself_##op_type##_ __attribute__((unused)) = \ TouchOpRegistrar_##op_type##_cpu() #endif - #ifdef PADDLE_MOBILE_MALI_GPU -#define REGISTER_OPERATOR_MALI_GPU(op_type, op_class) \ - template \ - class _OpClass_##op_type##_mali_gpu : public op_class { \ - public: \ - DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_mali_gpu, op_class); \ - }; \ - static paddle_mobile::framework::OperatorRegistrar< \ - paddle_mobile::CPU, _OpClass_##op_type##_mali_gpu> \ - __op_registrar_##op_type##__mali_gpu(#op_type); \ - int TouchOpRegistrar_##op_type##_mali_gpu() { \ - __op_registrar_##op_type##__mali_gpu.Touch(); \ - return 0; \ +#define REGISTER_OPERATOR_MALI_GPU(op_type, op_class) \ + template \ + class _OpClass_##op_type##_mali_gpu : public op_class { \ + public: \ + DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_mali_gpu, op_class); \ + }; \ + static paddle_mobile::framework::OperatorRegistrar< \ + paddle_mobile::CPU, \ + _OpClass_##op_type##_mali_gpu> \ + __op_registrar_##op_type##__mali_gpu(#op_type); \ + int TouchOpRegistrar_##op_type##_mali_gpu() { \ + __op_registrar_##op_type##__mali_gpu.Touch(); \ + return 0; \ } -#define USE_OP_MALI_GPU(op_type) \ - extern int TouchOpRegistrar_##op_type##_mali_gpu(); \ +#define USE_OP_MALI_GPU(op_type) \ + extern int TouchOpRegistrar_##op_type##_mali_gpu(); \ static int use_op_itself_##op_type##_ __attribute__((unused)) = \ TouchOpRegistrar_##op_type##_mali_gpu() #endif #ifdef PADDLE_MOBILE_FPGA -#define REGISTER_OPERATOR_FPGA(op_type, op_class) \ - template \ - class _OpClass_##op_type##_fpga : public op_class { \ - public: \ - DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_fpga, op_class); \ - }; \ - static paddle_mobile::framework::OperatorRegistrar< \ - paddle_mobile::CPU, _OpClass_##op_type##_fpga> \ - __op_registrar_##op_type##__fpga(#op_type); \ - int TouchOpRegistrar_##op_type##_fpga() { \ - __op_registrar_##op_type##__fpga.Touch(); \ - return 0; \ +#define REGISTER_OPERATOR_FPGA(op_type, op_class) \ + template \ + class _OpClass_##op_type##_fpga : public op_class { \ + public: \ + DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_fpga, op_class); \ + }; \ + static paddle_mobile::framework::OperatorRegistrar< \ + paddle_mobile::CPU, \ + _OpClass_##op_type##_fpga> \ + __op_registrar_##op_type##__fpga(#op_type); \ + int TouchOpRegistrar_##op_type##_fpga() { \ + __op_registrar_##op_type##__fpga.Touch(); \ + return 0; \ } -#define USE_OP_FPGA(op_type) \ - extern int TouchOpRegistrar_##op_type##_fpga(); \ +#define USE_OP_FPGA(op_type) \ + extern int TouchOpRegistrar_##op_type##_fpga(); \ static int use_op_itself_##op_type##_ __attribute__((unused)) = \ TouchOpRegistrar_##op_type##_fpga() diff --git a/src/framework/operator.h b/src/framework/operator.h index c49f85085543fe3ccf2ac44b7791c8f304edabce..2ea7626711c4161bbbedd5e26cdc895c27cdcd83 100644 --- a/src/framework/operator.h +++ b/src/framework/operator.h @@ -137,7 +137,6 @@ class OpKernelBase { std::shared_ptr<::paddle_mobile::framework::Scope> scope) \ : parent_cls(type, inputs, outputs, attrs, scope) {} - class FusionOpMatcher { public: FusionOpMatcher() {} diff --git a/src/operators/batchnorm_op.cpp b/src/operators/batchnorm_op.cpp index 896e677e14d9ba7a298afc496be0d9359c07caf1..e36cb24b7c46039463b76635536f0af4c6407824 100644 --- a/src/operators/batchnorm_op.cpp +++ b/src/operators/batchnorm_op.cpp @@ -40,5 +40,4 @@ REGISTER_OPERATOR_CPU(batch_norm, ops::BatchNormOp); #ifdef PADDLE_MOBILE_FPGA #endif - #endif diff --git a/src/operators/concat_op.cpp b/src/operators/concat_op.cpp index a128629e77370dfc2b03b900d19ff58b05aab398..b9eacde60ee25a91769317bd441058b4afb3f296 100644 --- a/src/operators/concat_op.cpp +++ b/src/operators/concat_op.cpp @@ -61,7 +61,6 @@ template class ConcatOp; } // namespace operators } // namespace paddle_mobile - namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU USE_OP_CPU(concat); diff --git a/src/operators/conv_op.cpp b/src/operators/conv_op.cpp index 7b06a29fe9e9c5c107079205ff6653a0476faf92..4be442f6169f65be9cffb2710f4f3aae40e9c905 100644 --- a/src/operators/conv_op.cpp +++ b/src/operators/conv_op.cpp @@ -66,6 +66,4 @@ USE_OP_FPGA(conv2d); REGISTER_OPERATOR_FPGA(conv2d, ops::ConvOp); #endif - - #endif diff --git a/src/operators/fusion_conv_add_relu_op.h b/src/operators/fusion_conv_add_relu_op.h index 601486f2099bbdf6834bf2db150e9f929cbf03b9..eb8dd205b45ed5f149f1eeeb5ed730a1c3f8b788 100644 --- a/src/operators/fusion_conv_add_relu_op.h +++ b/src/operators/fusion_conv_add_relu_op.h @@ -47,7 +47,7 @@ class ConvAddReluOp { }; #ifdef PADDLE_MOBILE_CPU -//static framework::FusionOpRegistrar fusion_conv_add_relu_registrar( +// static framework::FusionOpRegistrar fusion_conv_add_relu_registrar( // new FushionConvAddReluOpMatcher()); #endif #ifdef PADDLE_MOBILE_MALI_GPU diff --git a/src/operators/kernel/fpga/conv_kernel.cpp b/src/operators/kernel/fpga/conv_kernel.cpp index 00a7e4a3d6255da38fcf1e43c941d1ccdad5b000..d2c08992a89f0837de318c876fbab2892ee34e89 100644 --- a/src/operators/kernel/fpga/conv_kernel.cpp +++ b/src/operators/kernel/fpga/conv_kernel.cpp @@ -19,11 +19,11 @@ limitations under the License. */ namespace paddle_mobile { namespace operators { -template<> +template <> void ConvKernel::Compute(const ConvParam ¶m) const {} template class ConvKernel; -} +} // namespace operators } // namespace paddle_mobile #endif diff --git a/src/operators/transpose_op.cpp b/src/operators/transpose_op.cpp index 9ebe13aaa22ef8d61cde09e6ec7b4196ba844327..02a3b16e8d62d094a83c329f52957b4b8b87d805 100644 --- a/src/operators/transpose_op.cpp +++ b/src/operators/transpose_op.cpp @@ -61,5 +61,4 @@ REGISTER_OPERATOR_CPU(transpose, ops::TransposeOp); #ifdef PADDLE_MOBILE_FPGA #endif - #endif