// // MetalCast.hpp // MNN // // Created by MNN on 2019/01/30. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef MetalCast_hpp #define MetalCast_hpp #import "MetalExecution.hpp" #if MNN_METAL_ENABLED namespace MNN { class MetalCast : public MetalExecution { public: MetalCast(Backend *backend, id pipeline); virtual ~MetalCast() = default; virtual ErrorCode onResize(const std::vector &inputs, const std::vector &outputs) override; virtual void onEncode(const std::vector &inputs, const std::vector &outputs, id encoder) override; static NSString* getScalarType(const halide_type_t& srcType, bool useFp16); static NSString* getVecType(const halide_type_t& srcType, bool useFp16); protected: id mConstBuffer; id mPipeline; std::pair mThreads; }; } // namespace MNN #endif /* MNN_METAL_ENABLED */ #endif /* MetalCast_hpp */