// // DeconvolutionWithStride.hpp // MNN // // Created by MNN on 2018/10/08. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef DeconvolutionWithStride_hpp #define DeconvolutionWithStride_hpp #include "backend/cpu/CPUDeconvolution.hpp" #include "core/Backend.hpp" #include namespace MNN { class DeconvolutionWithStride : public CPUDeconvolutionCommon { public: DeconvolutionWithStride(const Tensor *input, const Op *convOp, Backend *b); virtual ~DeconvolutionWithStride(); virtual ErrorCode onResize(const std::vector &inputs, const std::vector &outputs) override; virtual ErrorCode onExecute(const std::vector &inputs, const std::vector &outputs) override; struct ComputeUnit { std::shared_ptr weight; std::shared_ptr dstBuffer; int xUnit = 0; int yUnit = 0; int xOffset = 0; int yOffset = 0; struct Winograd { std::shared_ptr dstTransformedBuffer; std::shared_ptr A; std::shared_ptr B; std::shared_ptr G; int srcUnitX = 0; int srcUnitY = 0; bool open = false; }; Winograd winogradInfo; }; private: bool _alloc(Backend::StorageType type); void _release(Backend::StorageType type); void _extract(const Op *convOp); std::shared_ptr mSrcBuffer; std::shared_ptr mMatMulPackBuffer; std::map> mTransformedBuffer; std::shared_ptr mDestBuffer; std::vector mComputeUnits; std::mutex mLock; int mStrideX = 1; int mStrideY = 1; std::vector mPostParameters; }; } // namespace MNN #endif /* DeconvolutionWithStride_hpp */