1 //
2 //  ConvolutionDepthwise3x3.hpp
3 //  MNN
4 //
5 //  Created by MNN on 2019/4/3.
6 //  Copyright © 2018, Alibaba Group Holding Limited
7 //
8 
9 #ifndef ConvolutionDepthwise3x3_hpp
10 #define ConvolutionDepthwise3x3_hpp
11 
12 #include "backend/cpu/CPUConvolution.hpp"
13 
14 namespace MNN {
15 class ConvolutionDepthwise3x3 : public CPUConvolution {
16 public:
17     ConvolutionDepthwise3x3(const Convolution2DCommon *common, Backend *b, const float *originWeight,
18                             size_t originWeightSize, const float *bias, size_t biasSize);
19     virtual ~ConvolutionDepthwise3x3();
20 
21     virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
22     virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
23     virtual bool onClone(Backend* bn, const Op* op, Execution** dst) override;
24 private:
25     ConvolutionDepthwise3x3(std::shared_ptr<Resource> resource, const Convolution2DCommon* common, Backend* b);
26 
27     std::shared_ptr<Resource> mResource;
28 
29     std::unique_ptr<Tensor> mCacheLine;
30     int mSourceStartX = 0;
31     int mSourceEndX   = 0;
32     std::vector<float> mPostParameters;
33 };
34 } // namespace MNN
35 
36 #endif /* ConvolutionDepthwise3x3_hpp */
37