// // CPUDepthwiseConvInt8.hpp // MNN // // Created by MNN on 2019/5/17. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef CPUDepthwiseConvInt8_hpp #define CPUDepthwiseConvInt8_hpp #include "CPUConvolution.hpp" #include "compute/Int8FunctionsOpt.h" namespace MNN { class CPUDepthwiseConvInt8 : public CPUConvolution { public: CPUDepthwiseConvInt8(Backend *backend, const Convolution2DCommon* common, std::shared_ptr res); virtual ~CPUDepthwiseConvInt8(); virtual ErrorCode onResize(const std::vector &inputs, const std::vector &outputs) override; virtual ErrorCode onExecute(const std::vector &inputs, const std::vector &outputs) override; virtual bool onClone(Backend* bn, const Op* op, Execution** dst) override; private: int mThreadNumber; int mPack = 16; bool mUse3x3Kernel = false; std::shared_ptr mResource; std::shared_ptr mInputPad; std::pair mPads; std::pair mPaddedSize; std::pair mStrides; std::pair mDilates; std::pair mKernels; MutableResourceInt8 mMutableResource; std::shared_ptr mInputTemp; std::shared_ptr mOutputTemp; std::shared_ptr mWeightTemp; void fastDepthwiseInt8(const std::vector& inputs, const std::vector& outputs); std::function mThreadFunction; std::vector mOrder; std::vector mBiasExtend; }; } // namespace MNN #endif /* CPUDepthwiseConvInt8_hpp */