diff --git a/src/operators/fusion_conv_add.cpp b/src/operators/fusion_conv_add.cpp index 656d30c4e1921914d3fe80d930f4219d73f025ea..b1dba23be0d8ea010b38844b1897381fbf578617 100644 --- a/src/operators/fusion_conv_add.cpp +++ b/src/operators/fusion_conv_add.cpp @@ -45,28 +45,6 @@ void FusionConvAddOp::InferShape() const { this->param_.Output()->Resize(ddim); } -#ifdef PADDLE_MOBILE_CPU - -#ifndef CONV_ADD_REGISTER -framework::FusionOpRegistrar convadd_registrar(new FusionConvAddMatcher()); -#define CONV_ADD_REGISTER -#endif - -#endif - -#ifdef PADDLE_MOBILE_MALI_GPU - -#ifndef CONV_ADD_REGISTER -static framework::FusionOpRegistrar convadd_registrar( - new FusionConvAddMatcher()); -#define CONV_ADD_REGISTER -#endif - -#endif - -#ifdef PADDLE_MOBILE_FPGA -#endif - template class FusionConvAddOp; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/fusion_conv_add.h b/src/operators/fusion_conv_add.h index bc623efc8c9288a6007a8141220a2d40b29d7bdb..ae030ba5767e4039cfa3effe0a7ded4886f261cf 100644 --- a/src/operators/fusion_conv_add.h +++ b/src/operators/fusion_conv_add.h @@ -69,7 +69,7 @@ class FusionConvAddOp : public framework::OperatorWithKernel< #ifdef PADDLE_MOBILE_CPU #ifndef CONV_ADD_REGISTER -extern framework::FusionOpRegistrar convadd_registrar( +static framework::FusionOpRegistrar convadd_registrar( new FusionConvAddMatcher()); #define CONV_ADD_REGISTER #endif @@ -82,6 +82,7 @@ extern framework::FusionOpRegistrar convadd_registrar( static framework::FusionOpRegistrar convadd_registrar( new FusionConvAddMatcher()); #define CONV_ADD_REGISTER + #endif #endif diff --git a/src/operators/fusion_fc_op.cpp b/src/operators/fusion_fc_op.cpp index 0ca3c26c47e91771ab7019261f78815ad8463408..57a8b1b53f2f98b3218ee8fc40c6c9774ec5a5c7 100644 --- a/src/operators/fusion_fc_op.cpp +++ b/src/operators/fusion_fc_op.cpp @@ -50,27 +50,6 @@ void FusionFcOp::InferShape() const { this->param_.Out()->Resize(ddim); } -#ifdef PADDLE_MOBILE_CPU - -#ifndef CONV_CPU_REGISTER -#define CONV_CPU_REGISTER -framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); -#endif - -#endif - -#ifdef PADDLE_MOBILE_MALI_GPU - -#ifndef CONV_CPU_REGISTER -#define CONV_CPU_REGISTER -framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); -#endif - -#endif - -#ifdef PADDLE_MOBILE_FPGA -#endif - template class FusionFcOp; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/fusion_fc_op.h b/src/operators/fusion_fc_op.h index b545bb8380aedcc31200080beaec4c56f137ad13..c6f13c8e347f525ecee915759a5f4df492a73a92 100644 --- a/src/operators/fusion_fc_op.h +++ b/src/operators/fusion_fc_op.h @@ -69,7 +69,7 @@ class FusionFcOp #ifndef CONV_CPU_REGISTER #define CONV_CPU_REGISTER -extern framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); +static framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); #endif #endif @@ -78,7 +78,7 @@ extern framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); #ifndef CONV_CPU_REGISTER #define CONV_CPU_REGISTER -extern framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); +static framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); #endif #endif diff --git a/tools/op.cmake b/tools/op.cmake index 34caf36c54d9935517fcb2cad1d31121d46d7624..71defeffcc919848e165ea836f4bfed2fcc7e0ff 100644 --- a/tools/op.cmake +++ b/tools/op.cmake @@ -166,6 +166,7 @@ if (SCALE_OP) endif() if (SLICE_OP) add_definitions(-DSLICE_OP) +endif() if (DROPOUT_OP) add_definitions(-DDROPOUT_OP) endif()