提交 d7588e2a 编写于 作者: L liuruilong

format files

上级 ac318c20
...@@ -98,67 +98,68 @@ class OpRegistry { ...@@ -98,67 +98,68 @@ class OpRegistry {
#ifdef PADDLE_MOBILE_CPU #ifdef PADDLE_MOBILE_CPU
#define REGISTER_OPERATOR_CPU(op_type, op_class) \ #define REGISTER_OPERATOR_CPU(op_type, op_class) \
template <typename Dtype, typename T> \ template <typename Dtype, typename T> \
class _OpClass_##op_type##_cpu : public op_class<Dtype, T> { \ class _OpClass_##op_type##_cpu : public op_class<Dtype, T> { \
public: \ public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_cpu, op_class); \ 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<paddle_mobile::CPU, float>> \ paddle_mobile::CPU, _OpClass_##op_type##_cpu<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__cpu(#op_type); \ __op_registrar_##op_type##__cpu(#op_type); \
int TouchOpRegistrar_##op_type##_cpu() { \ int TouchOpRegistrar_##op_type##_cpu() { \
__op_registrar_##op_type##__cpu.Touch(); \ __op_registrar_##op_type##__cpu.Touch(); \
return 0; \ return 0; \
} }
#define USE_OP_CPU(op_type) \ #define USE_OP_CPU(op_type) \
extern int TouchOpRegistrar_##op_type##_cpu(); \ extern int TouchOpRegistrar_##op_type##_cpu(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \ static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_cpu() TouchOpRegistrar_##op_type##_cpu()
#endif #endif
#ifdef PADDLE_MOBILE_MALI_GPU #ifdef PADDLE_MOBILE_MALI_GPU
#define REGISTER_OPERATOR_MALI_GPU(op_type, op_class) \ #define REGISTER_OPERATOR_MALI_GPU(op_type, op_class) \
template <typename Dtype, typename T> \ template <typename Dtype, typename T> \
class _OpClass_##op_type##_mali_gpu : public op_class<Dtype, T> { \ class _OpClass_##op_type##_mali_gpu : public op_class<Dtype, T> { \
public: \ public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_mali_gpu, op_class); \ DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_mali_gpu, op_class); \
}; \ }; \
static paddle_mobile::framework::OperatorRegistrar< \ static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_mali_gpu<paddle_mobile::CPU, float>> \ paddle_mobile::CPU, \
__op_registrar_##op_type##__mali_gpu(#op_type); \ _OpClass_##op_type##_mali_gpu<paddle_mobile::CPU, float>> \
int TouchOpRegistrar_##op_type##_mali_gpu() { \ __op_registrar_##op_type##__mali_gpu(#op_type); \
__op_registrar_##op_type##__mali_gpu.Touch(); \ int TouchOpRegistrar_##op_type##_mali_gpu() { \
return 0; \ __op_registrar_##op_type##__mali_gpu.Touch(); \
return 0; \
} }
#define USE_OP_MALI_GPU(op_type) \ #define USE_OP_MALI_GPU(op_type) \
extern int TouchOpRegistrar_##op_type##_mali_gpu(); \ extern int TouchOpRegistrar_##op_type##_mali_gpu(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \ static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_mali_gpu() TouchOpRegistrar_##op_type##_mali_gpu()
#endif #endif
#ifdef PADDLE_MOBILE_FPGA #ifdef PADDLE_MOBILE_FPGA
#define REGISTER_OPERATOR_FPGA(op_type, op_class) \ #define REGISTER_OPERATOR_FPGA(op_type, op_class) \
template <typename Dtype, typename T> \ template <typename Dtype, typename T> \
class _OpClass_##op_type##_fpga : public op_class<Dtype, T> { \ class _OpClass_##op_type##_fpga : public op_class<Dtype, T> { \
public: \ public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_fpga, op_class); \ DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_fpga, op_class); \
}; \ }; \
static paddle_mobile::framework::OperatorRegistrar< \ static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_fpga<paddle_mobile::CPU, float>> \ paddle_mobile::CPU, \
__op_registrar_##op_type##__fpga(#op_type); \ _OpClass_##op_type##_fpga<paddle_mobile::CPU, float>> \
int TouchOpRegistrar_##op_type##_fpga() { \ __op_registrar_##op_type##__fpga(#op_type); \
__op_registrar_##op_type##__fpga.Touch(); \ int TouchOpRegistrar_##op_type##_fpga() { \
return 0; \ __op_registrar_##op_type##__fpga.Touch(); \
return 0; \
} }
#define USE_OP_FPGA(op_type) \ #define USE_OP_FPGA(op_type) \
extern int TouchOpRegistrar_##op_type##_fpga(); \ extern int TouchOpRegistrar_##op_type##_fpga(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \ static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_fpga() TouchOpRegistrar_##op_type##_fpga()
......
...@@ -137,7 +137,6 @@ class OpKernelBase { ...@@ -137,7 +137,6 @@ class OpKernelBase {
std::shared_ptr<::paddle_mobile::framework::Scope> scope) \ std::shared_ptr<::paddle_mobile::framework::Scope> scope) \
: parent_cls<Dtype, T>(type, inputs, outputs, attrs, scope) {} : parent_cls<Dtype, T>(type, inputs, outputs, attrs, scope) {}
class FusionOpMatcher { class FusionOpMatcher {
public: public:
FusionOpMatcher() {} FusionOpMatcher() {}
......
...@@ -40,5 +40,4 @@ REGISTER_OPERATOR_CPU(batch_norm, ops::BatchNormOp); ...@@ -40,5 +40,4 @@ REGISTER_OPERATOR_CPU(batch_norm, ops::BatchNormOp);
#ifdef PADDLE_MOBILE_FPGA #ifdef PADDLE_MOBILE_FPGA
#endif #endif
#endif #endif
...@@ -61,7 +61,6 @@ template class ConcatOp<CPU, float>; ...@@ -61,7 +61,6 @@ template class ConcatOp<CPU, float>;
} // namespace operators } // namespace operators
} // namespace paddle_mobile } // namespace paddle_mobile
namespace ops = paddle_mobile::operators; namespace ops = paddle_mobile::operators;
#ifdef PADDLE_MOBILE_CPU #ifdef PADDLE_MOBILE_CPU
USE_OP_CPU(concat); USE_OP_CPU(concat);
......
...@@ -66,6 +66,4 @@ USE_OP_FPGA(conv2d); ...@@ -66,6 +66,4 @@ USE_OP_FPGA(conv2d);
REGISTER_OPERATOR_FPGA(conv2d, ops::ConvOp); REGISTER_OPERATOR_FPGA(conv2d, ops::ConvOp);
#endif #endif
#endif #endif
...@@ -47,7 +47,7 @@ class ConvAddReluOp { ...@@ -47,7 +47,7 @@ class ConvAddReluOp {
}; };
#ifdef PADDLE_MOBILE_CPU #ifdef PADDLE_MOBILE_CPU
//static framework::FusionOpRegistrar fusion_conv_add_relu_registrar( // static framework::FusionOpRegistrar fusion_conv_add_relu_registrar(
// new FushionConvAddReluOpMatcher()); // new FushionConvAddReluOpMatcher());
#endif #endif
#ifdef PADDLE_MOBILE_MALI_GPU #ifdef PADDLE_MOBILE_MALI_GPU
......
...@@ -19,11 +19,11 @@ limitations under the License. */ ...@@ -19,11 +19,11 @@ limitations under the License. */
namespace paddle_mobile { namespace paddle_mobile {
namespace operators { namespace operators {
template<> template <>
void ConvKernel<FPGA, float>::Compute(const ConvParam &param) const {} void ConvKernel<FPGA, float>::Compute(const ConvParam &param) const {}
template class ConvKernel<FPGA, float>; template class ConvKernel<FPGA, float>;
} } // namespace operators
} // namespace paddle_mobile } // namespace paddle_mobile
#endif #endif
...@@ -61,5 +61,4 @@ REGISTER_OPERATOR_CPU(transpose, ops::TransposeOp); ...@@ -61,5 +61,4 @@ REGISTER_OPERATOR_CPU(transpose, ops::TransposeOp);
#ifdef PADDLE_MOBILE_FPGA #ifdef PADDLE_MOBILE_FPGA
#endif #endif
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册