| 
									
										
										
										
											2019-04-17 10:49:11 +08:00
										 |  |  | //
 | 
					
						
							|  |  |  | //  MetalConcat.hpp
 | 
					
						
							|  |  |  | //  MNN
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //  Created by MNN on 2019/01/30.
 | 
					
						
							|  |  |  | //  Copyright © 2018, Alibaba Group Holding Limited
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef MetalConcat_hpp
 | 
					
						
							|  |  |  | #define MetalConcat_hpp
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #import <memory>
 | 
					
						
							| 
									
										
										
										
											2019-12-27 22:16:57 +08:00
										 |  |  | #import "core/Execution.hpp"
 | 
					
						
							| 
									
										
										
										
											2019-04-17 10:49:11 +08:00
										 |  |  | #import "MNN_generated.h"
 | 
					
						
							|  |  |  | #import "MetalDefine.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if MNN_METAL_ENABLED
 | 
					
						
							|  |  |  | namespace MNN { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class MetalConcat : public Execution { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     MetalConcat(Backend *backend, int axis); | 
					
						
							|  |  |  |     virtual ~MetalConcat() = default; | 
					
						
							|  |  |  |     virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override; | 
					
						
							|  |  |  |     virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     int mAxis; | 
					
						
							|  |  |  |     id<MTLBuffer> mBlits; | 
					
						
							|  |  |  |     std::vector<std::shared_ptr<Tensor>> mTempInputs; | 
					
						
							|  |  |  |     std::shared_ptr<Tensor> mTempOutput; | 
					
						
							|  |  |  |     bool mFastMode = false; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace MNN
 | 
					
						
							|  |  |  | #endif /* MNN_METAL_ENABLED */
 | 
					
						
							|  |  |  | #endif /* MetalConcat_hpp */
 |