// // MetalConvolution1x1.hpp // MNN // // Created by MNN on 2019/02/25. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef MetalConvolution1x1_hpp #define MetalConvolution1x1_hpp #import "MetalConvolutionCommon.hpp" #if MNN_METAL_ENABLED namespace MNN { class MetalConvolution1x1 : public MetalConvolutionCommon { public: static bool isValid(const Convolution2D *conv, const Tensor *input); MetalConvolution1x1(Backend *backend, const MNN::Op *op); virtual ~MetalConvolution1x1() = default; virtual ErrorCode onResize(const std::vector &inputs, const std::vector &outputs) override; virtual bool onClone(Backend* bn, const Op* op, Execution** dst) override; virtual void onEncode(const std::vector &inputs, const std::vector &outputs, id encoder) override; private: MetalConvolution1x1(Backend *backend, const MNN::Op *op, std::shared_ptr weight, std::shared_ptr bias, std::shared_ptr dequantScale, int dequantBits, float scaleCoef); id mPipeline; std::pair mThreads; id mDequantPipeline; std::pair mDequantThreads; bool mPreDequantWeight = false; std::shared_ptr mTempWeight; }; } // namespace MNN #endif /* MNN_METAL_ENABLED */ #endif /* MetalConvolution1x1_hpp */