2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								cmake_minimum_required ( VERSION  3.0 ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Versioning stuff
  
						 
					
						
							
								
									
										
										
										
											2022-06-24 18:30:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								file ( STRINGS  "${CMAKE_CURRENT_LIST_DIR}/include/MNN/MNNDefine.h"  MNN_DEFINE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( REGEX  MATCH  "MNN_VERSION_MAJOR [0-9]+"  MNN_VERSION_MAJOR_DEFINE  ${ MNN_DEFINE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( REGEX  MATCH  "[0-9]+"  MNN_VERSION_MAJOR  ${ MNN_VERSION_MAJOR_DEFINE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( REGEX  MATCH  "MNN_VERSION_MINOR [0-9]+"  MNN_VERSION_MINOR_DEFINE  ${ MNN_DEFINE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( REGEX  MATCH  "[0-9]+"  MNN_VERSION_MINOR  ${ MNN_VERSION_MINOR_DEFINE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( REGEX  MATCH  "MNN_VERSION_PATCH [0-9]+"  MNN_VERSION_PATCH_DEFINE  ${ MNN_DEFINE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( REGEX  MATCH  "[0-9]+"  MNN_VERSION_PATCH  ${ MNN_VERSION_PATCH_DEFINE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( MNN_VERSION  ${ MNN_VERSION_MAJOR } . ${ MNN_VERSION_MINOR } . ${ MNN_VERSION_PATCH } ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Clear VERSION variables when no VERSION is given to project()
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( POLICY  CMP0048 ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  cmake_policy ( SET  CMP0048  NEW ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# MSVC runtime library flags are selected by an abstraction.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( POLICY  CMP0091 ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  cmake_policy ( SET  CMP0091  NEW ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2022-06-24 18:30:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								project ( MNN  VERSION  ${ MNN_VERSION }  LANGUAGES  C  CXX  ASM ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# complier options
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_C_STANDARD  99 ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_STANDARD  11 ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( CMAKE_MODULE_PATH  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  $ { C M A K E _ M O D U L E _ P A T H } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  " $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# build options
  
						 
					
						
							
								
									
										
										
										
											2020-03-01 15:33:28 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_USE_SYSTEM_LIB  "For opencl and vulkan, use system lib or use dlopen"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								option ( MNN_BUILD_HARD  "Build -mfloat-abi=hard or not"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_BUILD_SHARED_LIBS  "MNN build shared or static lib"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_WIN_RUNTIME_MT  "MNN use /MT on Windows dll"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								option ( MNN_FORBID_MULTI_THREAD  "Disable Multi Thread"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_OPENMP  "Use OpenMP's thread pool implementation. Does not work on iOS or Mac OS"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_USE_THREAD_POOL  "Use MNN's own thread pool implementation"  ON ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_BUILD_TRAIN  "Build MNN's training framework"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2019-06-17 20:10:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_DEMO  "Build demo/exec or not"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_TOOLS  "Build tools/cpp or not"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 13:56:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_QUANTOOLS  "Build Quantized Tools or not"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2019-08-07 16:44:09 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_EVALUATION  "Build Evaluation Tools or not"  OFF ) 
  
						 
					
						
							
								
									
										
											 
										
											
												- build:
	- unify schema building in core and converter;
	- add more build script for android;
	- add linux build script for python;
- ops impl:
	- add floor mod support in binary;
	- use eltwise impl in add/max/sub/mul binary for optimization;
	- remove fake double support in cast;
	- fix 5d support for concat;
	- add adjX and adjY support for batch matmul;
	- optimize conv2d back prop filter;
	- add pad mode support for conv3d;
	- fix bug in conv2d & conv depthwise with very small feature map;
	- optimize binary without broacast;
	- add data types support for gather;
	- add gather ND support;
	- use uint8 data type in gather v2;
	- add transpose support for matmul;
	- add matrix band part;
	- add dim != 4 support for padding, reshape & tensor convert;
	- add pad type support for pool3d;
	- make ops based on TensorFlow Lite quantization optional;
	- add all & any support for reduction;
	- use type in parameter as output type in reduction;
	- add int support for unary;
	- add variable weight support for conv2d;
	- fix conv2d depthwise weights initialization;
	- fix type support for transpose;
	- fix grad outputs count for  reduce grad and reshape grad;
	- fix priorbox & detection output;
	- fix metal softmax error;
- python:
	- add runSessionWithCallBackInfo interface;
	- add max nodes limit (1400) for visualization tool;
	- fix save error in python3;
	- align default dim;
- convert:
	- add extra design for optimization;
	- add more post converting optimizers;
	- add caffe v1 weights blob support;
	- add cast, unary, conv transpose support for onnx model;
	- optimize batchnorm, conv with variable weights, prelu, reshape, slice, upsample for onnx model;
	- add cos/sin/atan/tan support for unary for tensorflow model;
	- add any/all support for reduction for tensorflow model;
	- add elu, conv3d, pool3d support for tensorflow model;
	- optimize argmax, batchnorm, concat, batch to space, conv with variable weights, prelu, slice for tensorflow model;
- others:
	- fix size computer lock;
	- fix thread pool deadlock;
	- add express & parameters in express;
	- rewrite blitter chooser without static map;
	- add tests for expr;
											 
										 
										
											2019-10-29 13:37:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_CONVERTER  "Build Converter"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2022-07-19 13:52:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_SUPPORT_DEPRECATED_OP  "Enable MNN's tflite quantized op"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_DEBUG_MEMORY  "MNN Debug Memory Access"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_DEBUG_TENSOR_SIZE  "Enable Tensor Size"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_GPU_TRACE  "Enable MNN Gpu Debug"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_PORTABLE_BUILD  "Link the static version of third party libraries where possible to improve the portability of built executables"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2022-05-27 23:48:09 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_SEP_BUILD  "Build MNN Backends and expression separately. Only works with MNN_BUILD_SHARED_LIBS=ON"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( NATIVE_LIBRARY_OUTPUT  "Native Library Path"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( NATIVE_INCLUDE_OUTPUT  "Native Include Path"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_AAPL_FMWK  "Build MNN.framework instead of traditional .a/.dylib"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-14 21:43:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_WITH_PLUGIN  "Build with plugin op support."  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_MINI  "Build MNN-MINI that just supports fixed shape models."  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_USE_SSE  "Use SSE optimization for x86 if possiable"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_CODEGEN  "Build with codegen"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-08 14:36:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_ENABLE_COVERAGE  "Build with coverage enable"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2021-11-30 10:10:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_PROTOBUFFER  "Build with protobuffer in MNN"  ON ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_BUILD_OPENCV  "Build OpenCV api in MNN."  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2022-01-04 10:50:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_INTERNAL  "Build with MNN internal features, such as model authentication, metrics logging"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2022-06-10 10:39:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_JNI  "Build MNN Jni for java to use"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-14 21:43:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF  ( NOT  DEFINED  MNN_USE_SPARSE_COMPUTE ) 
  
						 
					
						
							
								
									
										
										
										
											2023-08-15 19:19:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   set ( MNN_USE_SPARSE_COMPUTE  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-04 10:24:34 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( NOT  MNN_BUILD_SHARED_LIBS  AND  MNN_SEP_BUILD ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-15 11:21:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  message ( WARNING  "Close MNN_SEP_BUILD for static library" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  SET ( MNN_SEP_BUILD  OFF  CACHE  BOOL  "<docstring>"  FORCE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( APPLE  AND  MNN_AAPL_FMWK  AND  MNN_SEP_BUILD ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  message ( WARNING  "MNN_SEP_BUILD AND MNN_AAPL_FMWK can't coexist. Turning off MNN_SEP_BUILD" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:41:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  SET ( MNN_SEP_BUILD  OFF  CACHE  BOOL  "<docstring>"  FORCE ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( WIN32 ) 
  
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:41:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    message ( WARNING  "MNN_SEP_BUILD IS TROUBLESOME ON Windows. Forcing OFF..." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( MNN_SEP_BUILD  OFF  CACHE  BOOL  "<docstring>"  FORCE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  add_definitions ( -D_CRT_SECURE_NO_WARNINGS ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  IF ( MSVC ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # generate optimized (release) exe and library with pdb debug file, https://stackoverflow.com/a/31264946
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_EXE_LINKER_FLAGS_RELEASE  "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_SHARED_LINKER_FLAGS_RELEASE  "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_C_FLAGS_RELEASE  "${CMAKE_C_FLAGS_RELEASE} /Zi" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} /Zi" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    SET ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} /wd4267 /wd4018 /wd4251 /wd4996 /wd4244 /wd4146 /wd4129 /wd4305 /wd4275 /wd4101" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /wd4267 /wd4018 /wd4251 /wd4996 /wd4244 /wd4146 /wd4129 /wd4305 /wd4275 /wd4101" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-15 13:33:47 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-08 14:36:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# for coverage test
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF (  MNN_ENABLE_COVERAGE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-07-13 10:40:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( ( CMAKE_SYSTEM_NAME  STREQUAL  "Darwin" )  AND  CMAKE_OSX_ARCHITECTURES ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( CMAKE_SYSTEM_PROCESSOR  ${ CMAKE_OSX_ARCHITECTURES } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# do this before protobuf, make sure wincrt config of protobuf and MNN is same
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( MSVC ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # same as protobuf, otherwise config is inconsistent
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( CMAKE_VERSION  VERSION_GREATER  3.15  OR  CMAKE_VERSION  VERSION_EQUAL  3.15 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( CMAKE_MSVC_RUNTIME_LIBRARY  MultiThreaded $< $<CONFIG:Debug > :Debug> ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      if ( NOT  MNN_WIN_RUNTIME_MT ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_MSVC_RUNTIME_LIBRARY  ${ CMAKE_MSVC_RUNTIME_LIBRARY } DLL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      foreach ( flag_var 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          C M A K E _ C _ F L A G S  C M A K E _ C _ F L A G S _ D E B U G  C M A K E _ C _ F L A G S _ R E L E A S E 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          C M A K E _ C _ F L A G S _ M I N S I Z E R E L  C M A K E _ C _ F L A G S _ R E L W I T H D E B I N F O 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          C M A K E _ C X X _ F L A G S  C M A K E _ C X X _ F L A G S _ D E B U G  C M A K E _ C X X _ F L A G S _ R E L E A S E 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          C M A K E _ C X X _ F L A G S _ M I N S I Z E R E L  C M A K E _ C X X _ F L A G S _ R E L W I T H D E B I N F O ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          if  ( MNN_WIN_RUNTIME_MT ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              if ( ${ flag_var }  MATCHES  "/MD" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                  string ( REGEX  REPLACE  "/MD"  "/MT"  ${ flag_var }  "${${flag_var}}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          else  ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              if ( ${ flag_var }  MATCHES  "/MT" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                  string ( REGEX  REPLACE  "/MT"  "/MD"  ${ flag_var }  "${${flag_var}}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          endif  ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      endforeach ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( protobuf_BUILD_SHARED_LIBS  ${ MNN_BUILD_SHARED_LIBS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /cmake/macros.cmake ) 
  
						 
					
						
							
								
									
										
										
										
											2021-11-30 10:10:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_BUILD_PROTOBUFFER ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_BUILD_CONVERTER ) 
  
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  IF ( MSVC ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( protobuf_BUILD_SHARED_LIBS  ${ MNN_BUILD_SHARED_LIBS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( ( NOT  MNN_BUILD_SHARED_LIBS )  AND  ( NOT  MNN_WIN_RUNTIME_MT ) ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      message ( FATAL_ERROR  "When MNN_BUILD_CONVERTER=ON and MNN_BUILD_SHARED_LIBS=OFF, MNN_WIN_RUNTIME_MT must be ON. Because protobuf not support the config(static /MD)" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-30 10:10:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /3rd_party/protobuf/cmake ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-07-11 13:56:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# specify source file encoding explicitly, fix cross-platform garbled output issue
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# we need do this after protobuf which set different execution-charset
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MSVC ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( CMAKE_C_FLAGS  "${CMAKE_CXX_FLAGS} /source-charset:utf-8" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /source-charset:utf-8" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 22:52:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( CMAKE_CXX_COMPILER_ID  STREQUAL  "GNU"  AND  NOT  MNN_BUILD_SHARED_LIBS  AND  NOT  ( MSVC  OR  WIN32 ) ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  SET ( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:41:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  SET ( MNN_SEP_BUILD  OFF  CACHE  BOOL  "<docstring>"  FORCE ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-18 14:47:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  IF ( MNN_BUILD_CONVERTER ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:41:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    SET ( MNN_PORTABLE_BUILD  ON  CACHE  BOOL  "<docstring>"  FORCE ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-18 14:47:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-18 14:17:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								if ( MNN_FORBID_MULTI_THREAD ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_FORBIT_MULTI_THREADS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2022-07-19 13:52:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( MNN_SUPPORT_DEPRECATED_OP ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_SUPPORT_DEPRECATED_OP ) 
 
							 
						 
					
						
							
								
									
										
											 
										
											
												- build:
	- unify schema building in core and converter;
	- add more build script for android;
	- add linux build script for python;
- ops impl:
	- add floor mod support in binary;
	- use eltwise impl in add/max/sub/mul binary for optimization;
	- remove fake double support in cast;
	- fix 5d support for concat;
	- add adjX and adjY support for batch matmul;
	- optimize conv2d back prop filter;
	- add pad mode support for conv3d;
	- fix bug in conv2d & conv depthwise with very small feature map;
	- optimize binary without broacast;
	- add data types support for gather;
	- add gather ND support;
	- use uint8 data type in gather v2;
	- add transpose support for matmul;
	- add matrix band part;
	- add dim != 4 support for padding, reshape & tensor convert;
	- add pad type support for pool3d;
	- make ops based on TensorFlow Lite quantization optional;
	- add all & any support for reduction;
	- use type in parameter as output type in reduction;
	- add int support for unary;
	- add variable weight support for conv2d;
	- fix conv2d depthwise weights initialization;
	- fix type support for transpose;
	- fix grad outputs count for  reduce grad and reshape grad;
	- fix priorbox & detection output;
	- fix metal softmax error;
- python:
	- add runSessionWithCallBackInfo interface;
	- add max nodes limit (1400) for visualization tool;
	- fix save error in python3;
	- align default dim;
- convert:
	- add extra design for optimization;
	- add more post converting optimizers;
	- add caffe v1 weights blob support;
	- add cast, unary, conv transpose support for onnx model;
	- optimize batchnorm, conv with variable weights, prelu, reshape, slice, upsample for onnx model;
	- add cos/sin/atan/tan support for unary for tensorflow model;
	- add any/all support for reduction for tensorflow model;
	- add elu, conv3d, pool3d support for tensorflow model;
	- optimize argmax, batchnorm, concat, batch to space, conv with variable weights, prelu, slice for tensorflow model;
- others:
	- fix size computer lock;
	- fix thread pool deadlock;
	- add express & parameters in express;
	- rewrite blitter chooser without static map;
	- add tests for expr;
											 
										 
										
											2019-10-29 13:37:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# debug options
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( MNN_DEBUG_MEMORY ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_DEBUG_MEMORY ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( MNN_DEBUG_TENSOR_SIZE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_DEBUG_TENSOR_SIZE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( MNN_GPU_TRACE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_GPU_FORCE_FINISH ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# backend options
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_METAL  "Enable Metal"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_OPENCL  "Enable OpenCL"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_OPENGL  "Enable OpenGL"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_VULKAN  "Enable Vulkan"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_ARM82  "Enable ARM82"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_ONEDNN  "Enable oneDNN"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_AVX512  "Enable AVX512"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_CUDA  "Enable CUDA"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_TENSORRT  "Enable TensorRT"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_COREML  "Enable CoreML"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2022-09-30 10:02:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_NNAPI  "Enable NNAPI"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_CUDA_PROFILE  "Enable CUDA profile"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if  ( NOT  MNN_CUDA  OR  NOT  CMAKE_SYSTEM_NAME  MATCHES  "^Linux" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( MNN_CUDA_PROFILE  OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-05-09 19:39:33 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( MNN_USE_THREAD_POOL ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    message ( STATUS  "Use Threadpool, forbid openmp" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( MNN_OPENMP  OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_USE_THREAD_POOL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-08 15:34:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# When build Android based on arm32 by MTL, force turn off MNN_ARM82
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if  ( CMAKE_SYSTEM_NAME  MATCHES  "^Android"  AND  CMAKE_SYSTEM_PROCESSOR  MATCHES  "^armv7"  AND  NOT  MNN_BUILD_FOR_ANDROID_COMMAND ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    message ( STATUS  "force turn off MNN_ARM82 when build for Android based on arm32 by MTL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET ( MNN_ARM82  OFF  CACHE  BOOL  "Enable ARM82"  FORCE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# target options
  
						 
					
						
							
								
									
										
										
											
												- dynamic computation graph (beta)
	- add supports (/express)
	- add tests
	- add benchmarks with it (/benchmark/exprModels)
- Python
	- MNN engine and tools were submitted to pip
	- available on Windows/macOS/Linux
- Engine/Converter
	- add supports for each op benchmarking
	- refactor optimizer by separating steps
- CPU
	- add supports for Conv3D, Pool3D, ELU, ReverseSequence
	- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
	- add half transform in CPU
	- add broadcast supports for binary
	- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
	- add sub, real div supports for binary
	- add supports for unary
	- optimize Conv2D, Reshape
- Vulkan
	- add max supports for eltwise
- Metal
	- fix metallib missing problem
- Train/Quantization
	- use express to refactor training codes
											 
										 
										
											2019-09-26 21:02:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_BUILD_BENCHMARK  "Build benchmark or not"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								option ( MNN_BUILD_TEST  "Build tests or not"  OFF ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								option ( MNN_BUILD_FOR_ANDROID_COMMAND  "Build from command"  OFF ) 
  
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_USE_LOGCAT  "Use Logcat intead of print for info"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								set  ( MNN_HIDDEN  FALSE ) 
  
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( CMAKE_BUILD_TYPE  MATCHES  Debug ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ELSE ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( MNN_HIDDEN  TRUE ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( CMAKE_BUILD_TYPE  MATCHES  Debug ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  ">>>>>>>>>>>>>" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "MNN BUILD INFO:" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tSystem: ${CMAKE_SYSTEM_NAME}" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tProcessor: ${CMAKE_SYSTEM_PROCESSOR}" ) 
  
						 
					
						
							
								
									
										
										
										
											2022-06-24 18:30:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tVersion: ${MNN_VERSION}" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tMetal: ${MNN_METAL}" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tOpenCL: ${MNN_OPENCL}" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tOpenGL: ${MNN_OPENGL}" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tVulkan: ${MNN_VULKAN}" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-03-22 20:16:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tARM82: ${MNN_ARM82}" ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\toneDNN: ${MNN_ONEDNN}" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tTensorRT: ${MNN_TENSORRT}" ) 
  
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tCoreML: ${MNN_COREML}" ) 
  
						 
					
						
							
								
									
										
										
										
											2022-09-30 10:02:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tNNAPI: ${MNN_NNAPI}" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tCUDA: ${MNN_CUDA}" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								message ( STATUS  "\tOpenMP: ${MNN_OPENMP}" ) 
  
						 
					
						
							
								
									
										
										
										
											2021-04-08 15:34:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tBF16: ${MNN_SUPPORT_BF16}" ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tThreadPool: ${MNN_USE_THREAD_POOL}" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-11-13 11:44:43 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tHidden: ${MNN_HIDDEN}" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tBuild Path: ${CMAKE_CURRENT_BINARY_DIR}" ) 
  
						 
					
						
							
								
									
										
										
										
											2022-09-30 10:02:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								message ( STATUS  "\tCUDA PROFILE: ${MNN_CUDA_PROFILE}" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_NAME  MATCHES  "^Android"  OR  CMAKE_SYSTEM_NAME  MATCHES  "^Linux" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -fPIC ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2022-05-30 21:15:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Raspberry Pi 32-bit fix
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_NAME  MATCHES  "^Linux"  AND  CMAKE_SYSTEM_PROCESSOR  MATCHES  "^armv7" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -march=armv7-a  -mfpu=neon-vfpv4 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_NAME  MATCHES  "^Android" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_BUILD_FOR_ANDROID ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( CMAKE_SYSTEM_PROCESSOR  MATCHES  "^arm" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_definitions ( -mfloat-abi=softfp  -mfpu=neon ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2020-03-05 21:02:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( MNN_USE_CPP11  "Enable MNN use c++11"  ON ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if  ( NOT  MSVC ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( MNN_USE_CPP11 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -std=gnu99" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -std=c++11" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -std=gnu99" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -std=c++0x" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_NAME  MATCHES  "^Linux" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -D__STRICT_ANSI__" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( CMAKE_CXX_COMPILER_ID  STREQUAL  "Clang" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      # This is to workaround libgcc.a
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( CMAKE_SYSTEM_PROCESSOR  MATCHES  "^armv7" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-21 14:47:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_definitions ( -mfpu=neon )     #please define in project/cross-compile/arm.toolchain.cmake
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-05 21:02:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( MNN_BUILD_HARD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_definitions ( -mfloat-abi=hard )   #better define in project/cross-compile/arm.toolchain.cmake
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-04-18 18:54:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_DEBUG_MEMORY ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -fsanitize=address" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=address" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( CMAKE_BUILD_TYPE  MATCHES  Debug ) 
  
						 
					
						
							
								
									
										
										
										
											2019-09-01 19:25:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_DEBUG  -DDEBUG ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-10 21:08:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( MSVC ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-01 19:25:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} /DEBUG" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /DEBUG" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-10 21:08:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-01 19:25:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -g" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -g" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-10 21:08:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								else ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-06-10 21:08:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ( MSVC ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} /O2" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /O2" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -O3" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O3" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if ( CMAKE_SYSTEM_NAME  MATCHES  "^Android" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if ( MNN_BUILD_FOR_ANDROID_COMMAND ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                set ( CMAKE_SHARED_LINKER_FLAGS  "${CMAKE_SHARED_LINKER_FLAGS} -s" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                set ( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -pie -fPIE -s" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                set ( CMAKE_SHARED_LINKER_FLAGS  "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-10 21:08:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( CMAKE_BUILD_TYPE  MATCHES  Debug ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_NAME  MATCHES  "^Android" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( MNN_USE_LOGCAT ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_definitions ( -DMNN_USE_LOGCAT ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF  ( NOT  MNN_BUILD_FOR_ANDROID_COMMAND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${ NATIVE_LIBRARY_OUTPUT } / ${ ANDROID_ABI } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( ${ CMAKE_SYSTEM_NAME }  MATCHES  "^Linux" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( ( CMAKE_SYSTEM_PROCESSOR  MATCHES  "^arm" )  OR  ( CMAKE_SYSTEM_PROCESSOR  MATCHES  "^aarch64" ) ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        set ( aarch64_linux_include 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            #/usr/include/c++/4.9
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            #/usr/lib/gcc/x86_64-linux-gnu/4.9
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            #/usr/lib/gcc/x86_64-linux-gnu/4.9/include
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            #/usr/include/x86_64-linux-gnu/c++/4.9
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        include_directories ( ${ aarch64_linux_include } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include_directories ( ${ CMAKE_CURRENT_LIST_DIR } /include/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / s o u r c e / 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / e x p r e s s / 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / t o o l s / 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c o d e g e n / 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / s c h e m a / c u r r e n t / 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 3 r d _ p a r t y / 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 3 r d _ p a r t y / f l a t b u f f e r s / i n c l u d e 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 3 r d _ p a r t y / h a l f 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 3 r d _ p a r t y / i m a g e H e l p e r 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 3 r d _ p a r t y / O p e n C L H e a d e r s / 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                  ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-15 13:33:47 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( MNN_OBJECTS_TO_LINK  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( MNN_TARGETS  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Core
  
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								FILE ( GLOB  MNN_Core_SRC  ${ CMAKE_CURRENT_LIST_DIR } /source/core/* ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								add_library ( MNNCore  OBJECT  ${ MNN_Core_SRC } ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNCore > ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_TARGETS  MNNCore ) 
  
						 
					
						
							
								
									
										
										
										
											2021-04-08 15:34:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( MNN_BUILD_MINI ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target_compile_options ( MNNCore  PRIVATE  -DMNN_BUILD_MINI ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# CV
  
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								FILE ( GLOB  MNN_CV_SRC  ${ CMAKE_CURRENT_LIST_DIR } /source/cv/* ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								add_library ( MNNCV  OBJECT  ${ MNN_CV_SRC } ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNCV > ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_TARGETS  MNNCV ) 
  
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_PROCESSOR  MATCHES  "(x86_64)|(X86_64)|(x64)|(X64)|(amd64)|(AMD64)|(i686)" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( APPLE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_definitions ( -fno-stack-check )  # Workaround a Xcode 11.X bug
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Math
  
						 
					
						
							
								
									
										
										
										
											2020-02-26 09:57:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								FILE ( GLOB  MNN_Math_SRC  ${ CMAKE_CURRENT_LIST_DIR } /source/math/* ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								add_library ( MNNMath  OBJECT  ${ MNN_Math_SRC } ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNMath > ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_TARGETS  MNNMath ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Transform
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								FILE ( GLOB  MNN_Transform_SRC  ${ CMAKE_CURRENT_LIST_DIR } /source/shape/*  ${ CMAKE_CURRENT_LIST_DIR } /source/geometry/* ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								add_library ( MNNTransform  OBJECT  ${ MNN_Transform_SRC } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF  ( NOT  MNN_BUILD_MINI ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNTransform > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_TARGETS  MNNTransform ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Utils
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								FILE ( GLOB  MNN_Utils_SRC  ${ CMAKE_CURRENT_LIST_DIR } /source/utils/* ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								add_library ( MNNUtils  OBJECT  ${ MNN_Utils_SRC } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNUtils > ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_TARGETS  MNNUtils ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-08 15:34:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/cpu/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								SET ( MNN_PUB_HDRS  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								SET ( MNN_EXPR_PUB_HDRS  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/MNNDefine.h" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/Interpreter.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/HalideRuntime.h" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/Tensor.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/ErrorCode.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/ImageProcess.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/Matrix.h" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/Rect.h" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/MNNForwardType.h" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/AutoTime.hpp" ) 
  
						 
					
						
							
								
									
										
										
										
											2022-01-04 10:50:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/MNNSharedContext.h" ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/Expr.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/ExprCreator.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/MathOp.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/NeuralNetWorkOp.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/Optimizer.hpp" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/Executor.hpp" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-12-15 14:12:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/Module.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/NeuralNetWorkOp.hpp" ) 
  
						 
					
						
							
								
									
										
										
										
											2022-01-04 10:50:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/ExecutorScope.hpp" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXPR_PUB_HDRS  "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/Scope.hpp" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-04 01:21:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( MNN_DEPS  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( MNN_EXTRA_DEPENDS  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-04 10:50:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Add Thread dependency
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								find_package ( Threads ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  MNN_EXTRA_DEPENDS  ${ CMAKE_THREAD_LIBS_INIT } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( NOT  APPLE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  if ( MNN_OPENMP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      message ( STATUS  "[*] Checking OpenMP" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      find_package ( OpenMP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      # For CMake < 3.9, we need to make the target ourselves
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      if ( NOT  TARGET  OpenMP::OpenMP_CXX ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          add_library ( OpenMP::OpenMP_CXX  IMPORTED  INTERFACE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          set_property ( TARGET  OpenMP::OpenMP_CXX 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              P R O P E R T Y  I N T E R F A C E _ C O M P I L E _ O P T I O N S  $ { O p e n M P _ C X X _ F L A G S } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          # Only works if the same flag is passed to the linker; use CMake 3.9+ otherwise (Intel, AppleClang)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          set_property ( TARGET  OpenMP::OpenMP_CXX 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              P R O P E R T Y  I N T E R F A C E _ L I N K _ L I B R A R I E S  $ { O p e n M P _ C X X _ F L A G S }  T h r e a d s : : T h r e a d s ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      # TODO: Don't pollute global CFLAGS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( CMAKE_SHARED_LINKER_FLAGS  "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      if  ( MSVC ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								          set ( OpenMP_C_FLAGS  "/openmp ${OpenMP_C_FLAGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          set ( OpenMP_CXX_FLAGS  "/openmp ${OpenMP_CXX_FLAGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-04 01:21:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      list ( APPEND  MNN_EXTRA_DEPENDS  OpenMP::OpenMP_CXX ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( ( NOT  MSVC )  AND  MNN_HIDDEN ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fvisibility=hidden" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -fvisibility=hidden" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Omit frame pointer may cause difficult debug
 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 15:52:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fomit-frame-pointer" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( NOT  MSVC ) 
  
						 
					
						
							
								
									
										
										
										
											2020-05-15 19:08:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-16 09:42:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								else ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /fp:fast" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} /fp:fast" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-15 19:08:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Metal
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( MNN_DEPS  "" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( MNN_EXTRA_DEPENDS  "" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-03-25 20:48:47 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_DEPS  MNN ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-14 21:43:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Plugin
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( MNN_WITH_PLUGIN ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_WITH_PLUGIN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    include ( ${ CMAKE_CURRENT_LIST_DIR } /source/plugin/CMakeLists.txt ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Metal
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( MNN_METAL  AND  APPLE ) 
  
						 
					
						
							
								
									
										
											 
										
											
												[MNN:Sync] Sync internal github
Commits:
        8148ae75c  弗人  bugfix
        14cb8ec7f  弗人  [Converter:Bugfix] bugfix for onnx depthwise convtranspose
        476fbcd90  雁行  [MNN:Feature] Open AVX cast and bugfix for contentCFG.
        5e26b9fd3  雁行  [Test:Feature] Add android test.
        37e147b25  雁行  [MNN:Bugfix] Bugfix for floordiv.
        144c185f5  tianbu.xsw  hangxing fix hiai
        b4fd429d6  tianbu.xsw  updateCacheFile bugfix -- update cache size
        d4ba572a8  雁行  [MNN:Bugfix] Support int8 in AVX2 and some Bugfix.
        43061f07e  xiaying  [MNN:Bugfix] Fix bug for module mode run part of model
        398cc5ab6  tianhang.yth  refactor demo
        736380600  xiaying  [Express:Bugfix] Fix memory leak for copy branch
        b8dab0a27  tianhang.yth  MNNFloat2Int8 sizeQuad=0 crash fix
        94b95bfed  ghz  [BugFix]1.Better method for fast pack valid check
        6a921f85e  xiaying  [Converter:Bugfix] Fix bug for Fuseconsttosubgraph
        5f77ae889  tianhang.yth  numThread bugfix
        a807ef879  tianhang.yth  add createSession(configs, runtimeinfo) API, add pymnn demo, pymnn logcat bugfix
        ad05409d3  xiaying  [MNN:Bugfix] Fix bug for StaticModule's sizecompute overflow, add error print for module mode
        9d81b8299  xiaying  [MNN:Bugfix] Fix bug for Unique op for output size = 1
        03b15e9af  xiaying  [Test:Feature] Add MatMulBConst Test, Fix bug for single Convert
        c944a76ee  tianhang.yth  add auto backend and getSessionInfo @tianbu
        91fa7267b  ghz  [BugFix]1.fix the error in eP check
        bf0041f77  ghz  [BugFix]1.Fix the logic error in eP check. 2.Fix the sp align error
        693871672  雁行  [CPU:Bugfix] rm adrp instruction for clang compiler bug.
        1b8f6b3d8  ghz  1.Fix the wronly use of r13 in arm32 version. 2.Fix the missing callee register save and restore process.
        feb7ecc4c  弗人  modify log of python offline quant
        040c04811  ghz  [BufFix]1.replace platform-related regs. 2.fix the same problem in arm32 version
        609f37db8  弗人  add log for python quant, python convert
        5511dd30a  ghz  [BugFix]1.Add testcases in SparseConv to check all functional code branch. 2. Fix the bug in "MNNPackC4ForMatMul_A.S" in arm64, which is caused by the missing check of eReal parameter.
        a93ff9280  tianhang.yth  add tf.Unique op support
        9729ff773  allen.lk  [Bugfix] Fix one arm32 instruction syntax that clang works but gcc DOES NOT work. use index instruction instead.
        297c1ad14  雁行  [Expr:Bugfix] bugfix for tensor content used by shape compute.
        ef8c369e3  弗人  catch exception
        07c2dd670  弗人  add dependence to setup, base64 encode url, add time log
        177e590c1  弗人  [Python:Feature] add aliyun log for python quant tool
        40a7928cf  allen.lk  [Debug:Sparse] 1.Add group parameter in torchscript converter. 2. Stop split running to avoid memory corruption when check failed in TransformGroupConvolution 3. fix Op split issue in TransformGroupConvolution
        3bdea84a1  allen.lk  [Debug:Sparse] Fix and warning one kind of segmentfault cause by memory corruption when resize ConvolutionWinograd.  Avoid to use some registers as arm restriction.
        c3c6fbdbd  allen.lk  [Debug:Sparse] Fix and warning one kind of segmentfault cause by memory corruption when resize ConvolutionWinograd.  Avoid to use some registers as arm restriction.
        bc590eee4  雁行  [Converter:Bugfix] bugfix for onnx instancenormalization convert.
        d8918593f  tianhang.yth  add auto backend and getSessionInfo @tianbu
        83a198ed7  杭行  update
        d0dd3e09b  杭行  update
        99540202e  xiaying  [Converter:Optimize] Opt the tensor convert insert
        333d8db82  allen.lk  [Debug:Sparse] Fix All platform-register r9 / x18 issue on arm32 and arm64.
        db5994672  杭行  merge
        6293de7b8  tianbu.xsw  fix pymnn updateCacheFile
        5c2e11cb1  tianbu.xsw  do updateCache in createSession
        6e7641ff4  tianbu.xsw  do not limit cacheFile for a model
        5287a65e4  tianbu.xsw  bugfix
        52ba53a91  tianbu.xsw  revert pymnn api
        60284d830  tianbu.xsw  bugfix
        6d8077490  tianbu.xsw  rename updateCacheFile api params
        3cb172710  tianhang.yth  updateCacheFile API size default value is 0
        c5b69aabf  tianbu.xsw  updateCacheFile python api fix
        5d5da7aa5  tianbu.xsw  reflector code
        5707877a4  雁行  [MNN:Speed] Speedup for softmax in x86 and arm.
        2a211825c  tianbu.xsw  reflector code for updateCacheFile
        76db3a835  tianbu.xsw  [Cache Feature]: Add updateCacheFile API for increment cache
        b06b0fd43  allen.lk  [Debug:Sparse] Fix and warning one kind of segmentfault cause by memory corruption when resize ConvolutionWinograd.  Avoid to use some registers as arm restriction.
        e68bfa495  雁行  [Converter:Feature] Add UUID when model convert.
        a9cb935dc  xiaying  [MNN:Speed] Support c4nhwc for more fastblit
        019f40353  xiaying  [Converter:Refractor] Reduce memory used by MNNConvert(bert from 5G ->         1G)
        d2a6d3d05  xiaying  [MNN:Bugfix] Fix bug for identity output not find
        604d0801b  xiaying  [Converter:Bugfix] Fix bug for FuseGeLu
        4bada2367  xiaying  [MNN:Refractor] SegmentMean rewrite as segment
        82070e708  xiaying  [MNN:Bugfix] Fix bug for GeometryBinary
        e8ea4266e  xiaying  Fix bug for ShapeTensorConvert compute for dim = 1 error
        1f1cf1991  xiaying  [Tools:Bugfix] Fix system compability for fastTestOnnx
        6f422efe2  xiaying  [Tools:Bugfix] Remove color for checkDir for easy to dump
        968f7ec88  xiaying  [MNN:Speed] Support turn broadcast binary to loop
        3e7aaf46f  xiaying  [MNN:Refractor] Set Convolution1x1Strassen support variable input/output ptr
        1f65ab163  xiaying  [MNN:Bugfix] Fix bug for mini mnn can't convert model
        d65953d47  xiaying  [MNN:Bugfix] Fix bug for armv7a - android-14 + ARM82
        8b68be45c  xiaying  [MNN:Feature] Add segment
        8a8f264f5  xiaying  [Vulkan:Bugfix] Remove unuseful print
        025bb0fda  xiaying  [Converter:Bugfix] Fix bug for oneof don't support
        43900251e  tianbu.xsw  enable setCacheFile python API
        ebfb05c74  tianbu.xsw  [Metal Feature] support metallib obtain from walle transfer task
        9665c0a79  弗人  add check for path in json file
        c66fef224  xiaying  [Converter:Bugfix] Fix bug for oneof don't support
        42f192852  xiaying  [MNN:Bugfix] Fix bug for not set output / saveTensor into origin Schedule's outputs
        1b95354ff  雁行  [Feature]: Support shape compute for SetDiff1D, and null input for Prod.
        83966d043  xiaying  [Test:Feature] Add test for static module
        42d1be933  xiaying  [Converter:Bugfix] Fix bug for mnn convert and static model add more outputs for origin model
        9067531c3  xiaying  [Converter:Refractor] formatLicence
        99558bed9  xiaying  [Converter:Bugfix] Count the op for unuseful and controlflow
        4f6da0fa7  allen.lk  [Feature:GRUMultiOutput] fix multi output dimension type
        c6b219bce  xiaying  [Converter:Feature] Turn torch converter to object
        dd4e68a37  xiaying  [Converter:Feature] Support dump supported ops
        80b6a60a3  xiaying  [Converter:Info] If has output name, print output name instead of computed
        015278fc3  xiaying  [MNN:Refractor] Revert IfModule's debug info
        23ac967c4  xiaying  Don't transform for multi-input convolution/deconvolution
        b02b0d4de  xiaying  Fix bug for multi-input for conv1d
        254d8b1d4  xiaying  Fix bug for Conv1dSqueezeMove for multi input convolution 1d
        d47d0b9ca  xiaying  Fix bug for CPURaster's fuse nc4hw4
        357c5bd33  xiaying  Fix ConvBiasAdd for conv's inputs op > 1
        55b1f0c9c  xiaying  [Converter:Bugfix] Don't transform for multi-input convolution/deconvolution
        1902a30f5  xiaying  [Converter:Bugfix] Fix bug for Conv1dSqueezeMove for multi input convolution 1d
        c23fe617b  xiaying  [MNN:Bugfix] Fix bug for multi-input for conv1d
        8ff018426  xiaying  [MNN:Bugfix] Fix bug for CPURaster's fuse nc4hw4
        d4e8cd602  xiaying  [Converter:Bugfix] Fix ConvBiasAdd for conv's inputs op > 1
        846266b42  tianbu.xsw  return when program and tune both nullptr
        fd67c76a9  xiaying  [Converter:Bugfix] DepthwiseConvWeightMerge only valid for tflite
        e77a242c4  xiaying  [Converter:Feature] Support tflite's half pixel
        be054c377  tianbu.xsw  [OpenCL Bugfix] do not rewrite cache when binary program is produced
        51e65aa35  xiaying  [Converter:Feature] Support tflite for fp16 and multi-input convolution
        1ccdfdeb5  tianbu.xsw  redefine svm macro name
        31234d372  tianbu.xsw  [OpenCL SVM] add macro for only use wrapper
        d739e35da  xiaying  [MNN:Bugfix] Fix compile bug for grid op
        24ab13c79  Joker  feat(arm82): add GridSample op support in arm82 backend, AVX(by xiaying)
        7b142978e  xiaying  [AVX512:Speed] Optimize for e <= 8
        5f6febe7b  tianbu.xsw  code refactor
        998d91b57  xiaying  [Express:Speed] Merge submodule for speed
        22c89146f  tianhang.yth  fix alpha div by zero bug and arm server compile bug
        8f829a170  tianbu.xsw  [OpenCL Pad] unify conv/deconv pad computing
        4a28f603e  xiaying  [Express:Speed] Shared Const for All Submodule
        c74cf28f3  xiaying  [MNN:Refractor] Seperate Const init and schedule
        2a1eebb7a  xiaying  [Tools:Bugfix] Fix bug for modelTest.py count size
        72f04008c  xiaying  [MNN:Refractor] Delete unuseful const op
        1e735d03c  xiaying  [Converter:Bugfix] Fix bug for static module gen
        4dfadbc6e  xiaying  [MNN:Refractor] Rewrite const init mode
        1fcf0417a  xiaying  [MNN:Bugfix] Fix bug for deconvolutin multi-input for multi-batch
        41d429cfd  xiaying  [Train:Bugfix] Revert convert NCHW for mnistTrain
        f947a5f01  xiaying  [Test:Feature] Add testTrain
        dad59b6f6  tianbu.xsw  move realize code from Backend.hpp to Tensor.cpp
        cf4473ad1  xiaying  [Train:Bugfix] Support pad for GeometryPoolGrad
        91ab13734  xiaying  [MNN:Bugfix] Fix compile bug for avx512
        742e80f47  xiaying  [MNN:Refractor] Opt the logic for checknan judge
        12543b841  xiaying  [ARM82:Bugfix] Fix compile bug for ios
        3a2b0a49f  xiaying  [ARM82:Speed] Opt Pack / Unpack for armv8
        c0f1995cd  xiaying  [ARM82:Speed] Opt MNNPackC8FP16 and MNNUnpackC8FP16 by asm
        e0fc77dcf  xiaying  [MNN:Speed] Fix bug for DeconvolutionWithStride for C4HW4, open it
        584bec578  xiaying  [MNN:Bugfix] Fix bug for format set error for onnx
        d5bd4148d  xiaying  [MNN:Bugfix] Fix bug for format set error for onnx
        b00265841  xiaying  [MNN:Bugfix] Fix bug for SparseConvolutionTiledExecutor
        bb09188ac  xiaying  [Test:Bugfix] Fix bug for run into sparse auto
        426d1babd  xiaying  [MNN:Refractor] Small bugfix for Group convolution and pack
        7d0ea1c46  tianbu.xsw  [testModel Feature] support testModel.out input resize
        4169c54ce  xiaying  [MNN:Bugfix] Fix bug for checkNAN for origin
        412a82222  xiaying  [Test:Bugfix] Fix bug for CheckNAN's error of matmul
        319b1d425  xiaying  [MNN:Bugfix] Fix bug for multi-batch for ConvInt8
        050b728a6  xiaying  [Test:Bugfix] Use NCHW for ConvInt8Test
        7db3423a1  xiaying  [OpenCL:Bugfix] Fix bug for opencl::image,opencl::buffer for C4HW4
        adcec6a7f  xiaying  [Vulkan:Bugfix] Fix bug for invalid tensor size limit
        d2a7cf4e9  xiaying  [Vulkan:Bugfix] Fix bug for onCopyBuffer of nc4hw4
        557bebdd3  xiaying  [MNN:Bugfix] Fix bug for BF16-ARM32
        bbe186649  tianbu.xsw  [Update AUTO mode]: fix MNN_FORWARD_AUTO choose priority
        6deb23439  xiaying  [MNN:Bugfix] Fix bug for GeometryBinary don't care about NC4HW4 same size
        b137590e4  xiaying  [MNN:Bugfix] Fix bug for GeometryBinary don't care about NC4HW4 same size
        7003558ea  xiaying  [Converter:Bugfix] Fix bug for onnx pad for serveral case
        b5f8cae5a  xiaying  [Converter:Bugfix] Fix bug for onnx pad for serveral case
        29b09e125  xiaying  [MNN:Bugfix] Fix bug for arm64-bf16
        42ce00770  xiaying  [MNN:Bugfix] Fix bug for ARM64 - float
        a2d89fc18  雁行  [Converter:Feature] Support Binary Unary for Torch.
        7f1c0deb1  xiaying  [MNN:Bugfix] Fix bug for Raster for Int8
        8335a6f18  tianbu.xsw  [OpenCL Shared Memory] modify data_format method
        b359e031b  xiaying  [ARM82:Bugfix] Fix bug for arm82 and speed up pack / unpack c8
        24bf3fc88  雁行  [Convert:Feature] Support LayerNormFuse without gamma beta.
        3e629624b  xiaying  [MNN:Bugfix] Fix bug for float - armv7a
        2b7908ec7  tianbu.xsw  modify workItemSize
        3cee0d413  xiaying  [MNN:Bugfix] test wrong clear
        9cbbfb998  xiaying  [MNN:Bugfix] fix compile bug for c++ < 14
        2d7a44484  xiaying  [MNN:Bugfix] fix compile bug for c++ < 14
        eb7d0cb53  xiaying  [Test:Bugfix] Don't test for NC4HW4 directly
        7b40ca8d1  xiaying  [MNN:Bugfix] Fix bug for ConvolutionGroup
        2694d8a91  xiaying  [MNN:Bugfix] Fix bug for CPUGridSample
        f89af60f6  xiaying  [MNN:Bugfix] Fix compile bug for arm
        a151abcdd  xiaying  [MNN:Bugfix] Fix bug for convert for int8 / int16
        b254dbe61  雁行  [MNN:Bugfix] Bugfix for Conv onClone.
        d08150631  xiaying  [MNN:Bugfix] Fix bug for fast rcnn
        e5568a0df  xiaying  [MNN:Bugfix] Fix bug for CPURaster treat NC4HW4 fast blit
        128318933  雁行  [Raster:Bugfix] bugfix for Raster merge onResize.
        03caacbea  xiaying  [MNN:Bugfix] fix bug for CPUDeconvolution and Convolution1x1Strassen for iw != ow
        e1e3c245c  xiaying  [MNN:Bugfix] Fix bug for ConvolutionWinograd
        2524cbc6d  xiaying  [MNN:Bugfix] Fix bug for CPUSoftmax
        44ec79b8f  xiaying  [MNN:Bugfix] Fix bug for CPUConvolutionDepthwise / Scale / DeconvolutionDW
        21ae956ce  xiaying  [MNN:Bugfix] Fix bug for Multi-Batch-TiledExecutor
        09a5069c7  xiaying  [MNN:Speed] Add offset for src and dst
        6776c6784  xiaying  [MNN:Bugfix] Fix bug for trainable model
        cc83ae30b  xiaying  [MNN:Bugfix] Fix bug for trainable model
											 
										 
										
											2021-07-29 11:46:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    target_compile_options ( MNNCore  PRIVATE  -DMNN_METAL_ENABLED=1 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    include ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/metal/CMakeLists.txt ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  MNNMetal ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNMetal > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# CoreML
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_COREML ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_COREML_ENABLED=1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/coreml/ ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-08 13:16:32 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      list ( APPEND  MNN_DEPS  MNNCoreML ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNCoreML > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    find_library ( COREML  CoreML ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    find_library ( FOUNDATION  Foundation ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    find_library ( METAL  Metal ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-09 17:21:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    find_library ( VIDEO  CoreVideo ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  ${ COREML } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  ${ FOUNDATION } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  ${ METAL } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-09 17:21:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  ${ VIDEO } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 17:17:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-30 10:02:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# NNAPI
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_NNAPI ) 
  
						 
					
						
							
								
									
										
										
										
											2022-10-30 08:44:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_NNAPI_ENABLED=1 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-30 10:02:52 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/nnapi/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_NNAPI > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Vulkan
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_VULKAN ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/vulkan/ ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    list ( APPEND  MNN_DEPS  MNN_Vulkan ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  MNN_Vulkan ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_Vulkan > ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-01 15:33:28 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  ${ MNN_VULKAN_LIBS } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# oneDNN
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_ONEDNN ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target_compile_definitions ( MNNCPU  PRIVATE  "-DMNN_USE_ONEDNN" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_dependencies ( MNNCPU  oneDNN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    include ( cmake/oneDNN.cmake ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( ONEDNN_DIR  ${ CMAKE_CURRENT_LIST_DIR } /3rd_party/oneDNN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_library ( ONEDNN_COMMON  OBJECT  IMPORTED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    file ( GLOB_RECURSE  OBJECT_FILES  ${ ONEDNN_DIR } /src/common/CMakeFiles/dnnl_common.dir/*.o ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_property ( TARGET  ONEDNN_COMMON  PROPERTY  IMPORTED_OBJECTS  ${ OBJECT_FILES } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_library ( ONEDNN_CPU  OBJECT  IMPORTED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    file ( GLOB_RECURSE  OBJECT_FILES  ${ ONEDNN_DIR } /src/cpu/CMakeFiles/dnnl_cpu.dir/*.o ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_property ( TARGET  ONEDNN_CPU  PROPERTY  IMPORTED_OBJECTS  ${ OBJECT_FILES } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_library ( ONEDNN_CPU_X64  OBJECT  IMPORTED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    file ( GLOB_RECURSE  OBJECT_FILES  ${ ONEDNN_DIR } /src/cpu/x64/CMakeFiles/dnnl_cpu_x64.dir/*.o ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_property ( TARGET  ONEDNN_CPU_X64  PROPERTY  IMPORTED_OBJECTS  ${ OBJECT_FILES } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    include_directories ( ${ ONEDNN_DIR } /include ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  ${ ONEDNN_COMMON } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  ${ ONEDNN_CPU } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  ${ ONEDNN_CPU_X64 } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:ONEDNN_COMMON > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:ONEDNN_CPU > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:ONEDNN_CPU_X64 > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# OpenCL
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_OPENCL ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/opencl/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_DEPS  MNN_CL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  MNN_CL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_CL > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  ${ MNN_OCL_LIBS } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# OpenGL
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_OPENGL ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/opengl/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_DEPS  MNN_GL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  MNN_GL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_GL > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  GLESv3 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_EXTRA_DEPENDS  EGL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# CUDA
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_CUDA ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/cuda/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  list ( APPEND  MNN_TARGETS  MNN_CUDA ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 15:52:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  if  ( NOT  MSVC ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_CUDA > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  list ( APPEND  MNN_EXTRA_DEPENDS  ${ MNN_CUDA_LIBS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Express
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /express/ ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_SEP_BUILD ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  list ( APPEND  MNN_DEPS  MNN_Express ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ELSE ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   list ( APPEND  MNN_TARGETS  MNN_Express ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_Express > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-04 10:50:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Model Internal. Enable MNN internal features such as model authentication and metrics logging.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if  ( MNN_INTERNAL ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target_compile_options ( MNNCore  PRIVATE  -DMNN_INTERNAL_ENABLED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target_compile_options ( MNN_Express  PRIVATE  -DMNN_INTERNAL_ENABLED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    include ( ${ CMAKE_CURRENT_LIST_DIR } /source/internal/logging/CMakeLists.txt ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( CMAKE_SYSTEM_NAME  MATCHES  "^Linux" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        list ( APPEND  MNN_EXTRA_DEPENDS  "-lcurl -lssl -lcrypto" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-04 10:50:40 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Train
  
						 
					
						
							
								
									
										
										
										
											2021-04-28 18:02:10 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_BUILD_TRAIN  OR  MNN_BUILD_QUANTOOLS ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  add_subdirectory ( tools/train ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_DEPS  MNNTrain ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_TARGETS  MNNTrain ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNNTrain > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#CodeGen
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_BUILD_CODEGEN ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_definitions ( -DMNN_BUILD_CODEGEN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    include ( ${ CMAKE_CURRENT_LIST_DIR } /codegen/CMakeLists.txt ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 10:45:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# NPU
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_NPU ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/hiai/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( MNN_SEP_BUILD ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        list ( APPEND  MNN_DEPS  MNN_NPU ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        list ( APPEND  MNN_TARGETS  MNN_NPU ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_NPU > ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-11 16:36:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        list ( APPEND  MNN_EXTRA_DEPENDS  ${ CMAKE_CURRENT_LIST_DIR } /source/backend/hiai/3rdParty/ ${ ANDROID_ABI } /libhiai.so ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        list ( APPEND  MNN_EXTRA_DEPENDS  ${ CMAKE_CURRENT_LIST_DIR } /source/backend/hiai/3rdParty/ ${ ANDROID_ABI } /libhiai_ir_build.so ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        list ( APPEND  MNN_EXTRA_DEPENDS  ${ CMAKE_CURRENT_LIST_DIR } /source/backend/hiai/3rdParty/ ${ ANDROID_ABI } /libhiai_ir.so ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 10:45:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# TensorRT
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_TENSORRT ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/backend/tensorrt/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  list ( APPEND  MNN_TARGETS  MNN_TRT ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  list ( APPEND  MNN_OBJECTS_TO_LINK  $< TARGET_OBJECTS:MNN_TRT > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  list ( APPEND  MNN_EXTRA_DEPENDS  ${ MNN_TRT_LIBS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_SEP_BUILD ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  add_library ( MNN  SHARED  ${ CMAKE_CURRENT_LIST_DIR } /cmake/dummy.cpp  ${ MNN_OBJECTS_TO_LINK }  ${ MNN_PUB_HDRS }  ${ MNN_EXPR_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  target_link_libraries ( MNN  PUBLIC  ${ MNN_EXTRA_DEPENDS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ELSE ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  IF ( MNN_BUILD_SHARED_LIBS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_library ( MNN  SHARED  ${ CMAKE_CURRENT_LIST_DIR } /cmake/dummy.cpp  ${ MNN_OBJECTS_TO_LINK }  ${ MNN_PUB_HDRS }  ${ MNN_EXPR_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ( WIN32 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 22:52:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      foreach ( TARGET  ${ MNN_TARGETS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        target_compile_definitions ( ${ TARGET }  PRIVATE  "-DBUILDING_MNN_DLL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        target_compile_definitions ( ${ TARGET }  INTERFACE  "-DUSING_MNN_DLL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      endforeach ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      target_compile_definitions ( MNN  PRIVATE  "-DBUILDING_MNN_DLL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      target_compile_definitions ( MNN  INTERFACE  "-DUSING_MNN_DLL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ELSE ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_library ( MNN  STATIC  ${ CMAKE_CURRENT_LIST_DIR } /cmake/dummy.cpp  ${ MNN_OBJECTS_TO_LINK }  ${ MNN_PUB_HDRS }  ${ MNN_EXPR_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  target_link_libraries ( MNN  PUBLIC  ${ MNN_EXTRA_DEPENDS } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( MSVC ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-14 22:52:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  target_link_options ( MNN  PRIVATE  "/IGNORE:4049,4217" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 15:52:30 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  if  ( MNN_CUDA ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( MNN_BUILD_SHARED_LIBS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      target_link_options ( MNN  PRIVATE  "/WHOLEARCHIVE:$<TARGET_FILE:MNN_CUDA>" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      add_custom_command ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        T A R G E T  M N N 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        P O S T _ B U I L D 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        C O M M A N D  l i b . e x e  A R G S  / O U T : $ < T A R G E T _ F I L E : M N N >  $ < T A R G E T _ F I L E : M N N >  $ < T A R G E T _ F I L E : M N N _ C U D A > 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 22:52:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-06 16:29:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( MNN_ONEDNN ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_dependencies ( MNN  ONEDNN_COMMON  ONEDNN_CPU  ONEDNN_CPU_X64 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-06 13:55:54 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( APPLE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( MNN_AAPL_FMWK ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      set_target_properties ( MNN  PROPERTIES  FRAMEWORK  TRUE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set_target_properties ( MNN  PROPERTIES 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								          M A C O S X _ F R A M E W O R K _ I D E N T I F I E R  c o m . a l i b a b a . M N N 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          M A C O S X _ F R A M E W O R K _ S H O R T _ V E R S I O N _ S T R I N G  $ { P A C K A G E _ V E R S I O N } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          M A C O S X _ F R A M E W O R K _ B U N D L E _ V E R S I O N  $ { P A C K A G E _ V E R S I O N } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          X C O D E _ A T T R I B U T E _ C O D E _ S I G N _ I D E N T I T Y  " i P h o n e  D e v e l o p e r " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      set_target_properties ( MNN  PROPERTIES  MACOSX_FRAMEWORK_INFO_PLIST  ${ CMAKE_CURRENT_SOURCE_DIR } /project/ios/MNN/Info.plist ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( MNN_METAL ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      find_library ( FOUNDATION  Foundation  REQUIRED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      target_link_libraries ( MNN  PUBLIC  ${ FOUNDATION } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      find_library ( METAL  Metal  REQUIRED ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      target_link_libraries ( MNN  PUBLIC  ${ METAL } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 16:41:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      find_library ( GRAPHIC  CoreGraphics ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      target_link_libraries ( MNN  PUBLIC  ${ GRAPHIC } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2021-01-04 17:40:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								add_dependencies ( MNN  MNNCore  MNNCV  MNNTransform  MNNMath  MNNCPU ) 
  
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /tools/converter ) 
  
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( WIN32  AND  MNN_BUILD_CONVERTER  AND  MNN_BUILD_SHARED_LIBS ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Because of dllimport/dllexport, we merge MNN and MNNConvertDeps together, which depend protobuf
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  target_link_libraries ( MNN  PUBLIC  ${ Protobuf_LIBRARIES } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Merge MNN/MNNExpress/MNNOpenCV and other backends into one .lib/.dll on Windows
  
						 
					
						
							
								
									
										
										
										
											2021-11-30 10:10:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /tools/cv ) 
  
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_BUILD_OPENCV  AND  NOT  MNN_SEP_BUILD ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  IF ( MSVC ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target_compile_definitions ( MNNOpenCV  PRIVATE  "-DBUILDING_MNN_DLL"  INTERFACE  "-DUSING_MNN_DLL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  target_sources ( MNN  PRIVATE  $< TARGET_OBJECTS:MNNOpenCV > ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( CMAKE_SYSTEM_NAME  MATCHES  "^Linux" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-14 22:52:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Using -pthread, needed by thread-safe implemention of glibc, is better than only using -lpthread
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# https://stackoverflow.com/questions/23250863/difference-between-pthread-and-lpthread-while-compiling
  
						 
					
						
							
								
									
										
										
										
											2020-05-20 04:31:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  target_link_libraries ( MNN  PUBLIC  -pthread  dl ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								elseif ( CMAKE_SYSTEM_NAME  MATCHES  "^Android" ) 
  
						 
					
						
							
								
									
										
										
										
											2020-12-15 14:12:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  target_link_libraries ( MNN  PUBLIC  log  m ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								else ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
											
												- dynamic computation graph (beta)
	- add supports (/express)
	- add tests
	- add benchmarks with it (/benchmark/exprModels)
- Python
	- MNN engine and tools were submitted to pip
	- available on Windows/macOS/Linux
- Engine/Converter
	- add supports for each op benchmarking
	- refactor optimizer by separating steps
- CPU
	- add supports for Conv3D, Pool3D, ELU, ReverseSequence
	- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
	- add half transform in CPU
	- add broadcast supports for binary
	- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
	- add sub, real div supports for binary
	- add supports for unary
	- optimize Conv2D, Reshape
- Vulkan
	- add max supports for eltwise
- Metal
	- fix metallib missing problem
- Train/Quantization
	- use express to refactor training codes
											 
										 
										
											2019-09-26 21:02:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( NOT  MNN_BUILD_SHARED_LIBS ) 
  
						 
					
						
							
								
									
										
										
										
											2023-09-04 10:42:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ( CMAKE_CXX_COMPILER_ID  MATCHES  "GNU"  OR  CMAKE_CXX_COMPILER_ID  MATCHES  "Clang" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:19:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # Static-link will not replace thread-related weak symbol in glibc with strong symbol
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 22:52:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # in pthread library, so we need use --whole-archive to pthread
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-15 11:14:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if ( CMAKE_SYSTEM_NAME  MATCHES  "^Linux" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            set ( MNN_DEPS  -Wl,--whole-archive  ${ MNN_DEPS }  -lpthread  -Wl,--no-whole-archive ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            set ( MNN_DEPS  -Wl,--whole-archive  ${ MNN_DEPS }  -Wl,--no-whole-archive ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-01 19:25:26 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								list ( APPEND  MNN_TARGETS  MNN ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( REMOVE_ITEM  MNN_TARGETS  MNN ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								IF ( MNN_BUILD_DEMO ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /demo/exec/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_BUILD_TOOLS ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /tools/cpp/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_BUILD_TEST ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /test/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_BUILD_BENCHMARK ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /benchmark/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_BUILD_QUANTOOLS ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /tools/quantization/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( MNN_EVALUATION ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include ( ${ CMAKE_CURRENT_LIST_DIR } /tools/evaluation/CMakeLists.txt ) 
  
						 
					
						
							
								
									
										
										
										
											2020-04-11 18:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Install headers
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								IF ( CMAKE_SYSTEM_NAME  MATCHES  "^Android"  AND  NOT  MNN_BUILD_FOR_ANDROID_COMMAND ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    IF ( NOT  NATIVE_INCLUDE_OUTPUT ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      set ( NATIVE_INCLUDE_OUTPUT  "." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-17 10:49:11 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    set ( MNN_INCLUDE_OUTPUT  ${ NATIVE_INCLUDE_OUTPUT } /MNN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_custom_command ( 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      T A R G E T  M N N 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      P O S T _ B U I L D 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      C O M M A N D  $ { C M A K E _ C O M M A N D } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      - E  m a k e _ d i r e c t o r y  " $ { M N N _ I N C L U D E _ O U T P U T } / " 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-14 19:54:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_custom_command ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      T A R G E T  M N N 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      P O S T _ B U I L D 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      C O M M A N D  $ { C M A K E _ C O M M A N D } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      - E  m a k e _ d i r e c t o r y  " $ { M N N _ I N C L U D E _ O U T P U T } / e x p r / " 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-10 21:08:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    FOREACH ( header  ${ MNN_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      add_custom_command ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        T A R G E T  M N N 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        P O S T _ B U I L D 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        C O M M A N D  $ { C M A K E _ C O M M A N D } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        A R G S  - E  c o p y  $ { h e a d e r }  " $ { M N N _ I N C L U D E _ O U T P U T } / " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDFOREACH ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    FOREACH ( header  ${ MNN_EXPR_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      add_custom_command ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        T A R G E T  M N N 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        P O S T _ B U I L D 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        C O M M A N D  $ { C M A K E _ C O M M A N D } 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        A R G S  - E  c o p y  $ { h e a d e r }  " $ { M N N _ I N C L U D E _ O U T P U T } / e x p r / " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ENDFOREACH ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ELSEIF ( NOT  APPLE ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  INSTALL ( FILES  ${ MNN_PUB_HDRS }  DESTINATION  include/MNN/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  INSTALL ( FILES  ${ MNN_EXPR_PUB_HDRS }  DESTINATION  include/MNN/expr/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  install ( TARGETS  MNN 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      L I B R A R Y  D E S T I N A T I O N  l i b 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      A R C H I V E  D E S T I N A T I O N  l i b 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ELSE ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  install ( TARGETS  MNN 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      L I B R A R Y  D E S T I N A T I O N  l i b 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      A R C H I V E  D E S T I N A T I O N  l i b 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      F R A M E W O R K  D E S T I N A T I O N  / L i b r a r y / F r a m e w o r k s / 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 11:30:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  if  ( NOT  MNN_AAPL_FMWK ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      INSTALL ( FILES  ${ MNN_PUB_HDRS }  DESTINATION  include/MNN/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      INSTALL ( FILES  ${ MNN_EXPR_PUB_HDRS }  DESTINATION  include/MNN/expr/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  FOREACH ( HDR  ${ MNN_EXPR_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET_SOURCE_FILES_PROPERTIES ( ${ HDR }  PROPERTIES  MACOSX_PACKAGE_LOCATION  Headers/expr/  ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDFOREACH ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  FOREACH ( HDR  ${ MNN_PUB_HDRS } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET_SOURCE_FILES_PROPERTIES ( ${ HDR }  PROPERTIES  MACOSX_PACKAGE_LOCATION  Headers/  ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDFOREACH ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-17 10:20:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  IF ( MNN_METAL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    SET_SOURCE_FILES_PROPERTIES ( ${ CMAKE_CURRENT_BINARY_DIR } /mnn.metallib  PROPERTIES  MACOSX_PACKAGE_LOCATION  Resources/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ENDIF ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-27 22:16:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ENDIF ( ) 
  
						 
					
						
							
								
									
										
										
										
											2022-06-10 10:39:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( MNN_JNI ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_subdirectory ( ${ CMAKE_CURRENT_LIST_DIR } /source/jni/ ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( )