MNN/source/backend/metal/MetalConvolutionDepthwise.hpp

35 lines
1.0 KiB
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// MetalConvolutionDepthwise.hpp
// MNN
//
// Created by MNN on 2019/02/25.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef MetalConvolutionDepthwise_hpp
#define MetalConvolutionDepthwise_hpp
#import "MetalConvolutionCommon.hpp"
#if MNN_METAL_ENABLED
namespace MNN {
class MetalConvolutionDepthwise : public MetalConvolutionCommon {
public:
MetalConvolutionDepthwise(Backend *backend, const MNN::Op *op);
virtual ~MetalConvolutionDepthwise() = default;
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
protected:
2023-12-27 17:26:44 +08:00
virtual void onFloat(const Tensor *input, const Tensor *output, id<MTLComputeCommandEncoder> encoder) override;
2019-04-17 10:49:11 +08:00
virtual id<MTLBuffer> weightForFloat(int group, int oc, int ic, int kh, int kw, const float *src) override;
private:
id<MTLComputePipelineState> mPipeline;
std::pair<MTLSize, MTLSize> mThreads;
2019-04-17 10:49:11 +08:00
};
} // namespace MNN
#endif /* MNN_METAL_ENABLED */
#endif /* MetalConvolutionDepthwise_hpp */