alibaba / MNN

MNN is a blazing fast, lightweight deep learning framework, battle-tested by business-critical use cases in Alibaba
http://www.mnn.zone/
8.72k stars 1.67k forks source link

android端OPENGL、VULKAN后端输出结果错误 #1125

Closed zhra46 closed 4 years ago

zhra46 commented 4 years ago

平台(如果交叉编译请再附上交叉编译目标平台):

Platform(Include target platform as well if cross-compiling):

android: rk3399-all gpu: MALI-T860 android版本: 7.1.2 openGL:es3.2 v1 编译MNN so库平台: ubunt 18.04 ndk android-ndk-r18b

Github版本:547a284baafa9443c6d2615980eabec3200e10b5

Github Version:

编译方式: NDK交叉编译

Compiling Method

cmake 脚本:

cmake_minimum_required(VERSION 3.0)
# Versioning stuff
if(NOT DEFINED MNN_VERSION_MAJOR)
  set(MNN_VERSION_MAJOR 0)
endif()
if(NOT DEFINED MNN_VERSION_MINOR)
  set(MNN_VERSION_MINOR 2)
endif()
if(NOT DEFINED MNN_VERSION_PATCH)
  set(MNN_VERSION_PATCH 1)
endif()
if(NOT DEFINED MNN_VERSION_BUILD)
  set(MNN_VERSION_BUILD 5)
endif()
if(NOT DEFINED MNN_VERSION_SUFFIX)
  set(MNN_VERSION_SUFFIX git)
endif()
if (NOT PACKAGE_VERSION)
  set(PACKAGE_VERSION
    "${MNN_VERSION_MAJOR}.${MNN_VERSION_MINOR}.${MNN_VERSION_PATCH}.${MNN_VERSION_BUILD}${MNN_VERSION_SUFFIX}")
endif()
add_definitions("-DMNN_VERSION=\"${PACKAGE_VERSION}\"")
add_definitions("-DMNN_VERSION_MAJOR=${MNN_VERSION_MAJOR}")
add_definitions("-DMNN_VERSION_MINOR=${MNN_VERSION_MINOR}")
add_definitions("-DMNN_VERSION_PATCH=${MNN_VERSION_PATCH}")

# CMP0048 is related to letting CMake managing the package version for us

cmake_policy(SET CMP0048 NEW)
project(MNN VERSION ${MNN_VERSION_MAJOR}.${MNN_VERSION_MINOR}.${MNN_VERSION_PATCH}.${MNN_VERSION_BUILD} LANGUAGES C CXX ASM)
# complier options
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH
  ${CMAKE_MODULE_PATH}
  "${CMAKE_CURRENT_LIST_DIR}/cmake"
)
add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/include/MNN/VCS.h"
    COMMAND ${CMAKE_COMMAND} "-DNAMES=MNN"
    "-DMNN_SOURCE_DIR=${CMAKE_CURRENT_LIST_DIR}"
    "-DHEADER_FILE=${CMAKE_CURRENT_LIST_DIR}/include/MNN/VCS.h"
    -P "${CMAKE_CURRENT_LIST_DIR}/cmake/GenerateVersionFromVCS.cmake"
    COMMENT "Generating Version Control Info"
)
add_custom_target (GenVCSHDR DEPENDS "${CMAKE_CURRENT_LIST_DIR}/include/MNN/VCS.h")
# Required for OpenCL/OpenGL/Vulkan CodeGen
include(FindPythonInterp REQUIRED)
# build options
option(MNN_USE_SYSTEM_LIB "For opencl and vulkan, use system lib or use dlopen" OFF)
option(MNN_BUILD_HARD "Build -mfloat-abi=hard or not" OFF)
option(MNN_BUILD_SHARED_LIBS "MNN build shared or static lib" ON)
option(MNN_FORBID_MULTI_THREAD "Disable Multi Thread" OFF)
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)
option(MNN_BUILD_DEMO "Build demo/exec or not" OFF)
option(MNN_BUILD_TOOLS "Build tools/cpp or not" ON)
option(MNN_BUILD_QUANTOOLS "Build Quantized Tools or not" OFF)
option(MNN_EVALUATION "Build Evaluation Tools or not" OFF)
option(MNN_BUILD_CONVERTER "Build Converter" OFF)
option(MNN_SUPPORT_TFLITE_QUAN "Enable MNN's tflite quantized op" ON)
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_OPENCL_LWS_TUNE "Enable MNN OpenCL Lws Tuning" ON)
option(MNN_PORTABLE_BUILD "Link the static version of third party libraries where possible to improve the portability of built executables" OFF)
option(MNN_SEP_BUILD "Build MNN Backends and expression seperately. Only works with MNN_BUILD_SHARED_LIBS=ON" ON)
option(NATIVE_LIBRARY_OUTPUT "Native Library Path" OFF)
option(NATIVE_INCLUDE_OUTPUT "Native Include Path" OFF)
option(MNN_AAPL_FMWK "Build MNN.framework instead of traditional .a/.dylib" OFF)
option(MNN_FMA_ENABLE "x86 routine use fma extension" OFF)
option(MNN_WITH_PLUGIN "Build with plugin op support." OFF)

IF(NOT MNN_BUILD_SHARED_LIBS)
  message(WARNING "Close MNN_SEP_BUILD for static library")
  SET(MNN_SEP_BUILD OFF CACHE BOOL "<docstring>" FORCE)
ENDIF()
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")
  SET(MNN_SEP_BUILD OFF CACHE BOOL "<docstring>" FORCE)
ENDIF()
IF(MSVC OR WIN32)
  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()
  SET(MNN_USE_SYSTEM_LIB ON CACHE BOOL "<docstring>" FORCE)

  # 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")

  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4018 /wd4251 /wd4996 /wd4244 /wd4146 /wd4129 /wd4305 /wd4275")
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4018 /wd4251 /wd4996 /wd4244 /wd4146 /wd4129 /wd4305 /wd4275")
ENDIF()

include(${CMAKE_CURRENT_LIST_DIR}/cmake/macros.cmake)

IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT MNN_BUILD_SHARED_LIBS AND NOT (MSVC OR WIN32))
  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
  SET(MNN_SEP_BUILD OFF CACHE BOOL "<docstring>" FORCE)
  IF(MNN_BUILD_CONVERTER)
    SET(MNN_PORTABLE_BUILD ON CACHE BOOL "<docstring>" FORCE)
  ENDIF()
ENDIF()

if (MNN_USE_THREAD_POOL)
    set(MNN_OPENMP OFF)
    add_definitions(-DMNN_USE_THREAD_POOL)
endif()

if(MNN_FORBID_MULTI_THREAD)
    add_definitions(-DMNN_FORBIT_MULTI_THREADS)
endif()
if(MNN_SUPPORT_TFLITE_QUAN)
    add_definitions(-DMNN_SUPPORT_TFLITE_QUAN)
endif()

# 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()
if(MNN_OPENCL_LWS_TUNE)
    add_definitions(-DMNN_OPENCL_LWS_TUNE)
endif()

# backend options
option(MNN_METAL "Enable Metal" OFF)
option(MNN_OPENCL "Enable OpenCL" ON)
option(MNN_OPENGL "Enable OpenGL" ON)
option(MNN_VULKAN "Enable Vulkan" ON)
option(MNN_ARM82 "Enable ARM82" OFF)

# codegen register ops
if (MNN_METAL)
    add_definitions(-DMNN_CODEGEN_REGISTER)
endif()

# target options
option(MNN_BUILD_BENCHMARK "Build benchmark or not" OFF)
option(MNN_BUILD_TEST "Build tests or not" OFF)
option(MNN_BUILD_FOR_ANDROID_COMMAND "Build from command" OFF)
option(MNN_USE_LOGCAT "Use Logcat intead of print for info" ON)
set (MNN_HIDDEN FALSE)
IF(CMAKE_BUILD_TYPE MATCHES Debug)
ELSE()
    set(MNN_HIDDEN TRUE)
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)

message(STATUS ">>>>>>>>>>>>>")
message(STATUS "MNN BUILD INFO:")
message(STATUS "\tSystem: ${CMAKE_SYSTEM_NAME}")
message(STATUS "\tProcessor: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "\tMetal: ${MNN_METAL}")
message(STATUS "\tOpenCL: ${MNN_OPENCL}")
message(STATUS "\tOpenGL: ${MNN_OPENGL}")
message(STATUS "\tVulkan: ${MNN_VULKAN}")
message(STATUS "\tARM82: ${MNN_ARM82}")
message(STATUS "\tOpenMP: ${MNN_OPENMP}")
message(STATUS "\tHidden: ${MNN_HIDDEN}")
message(STATUS "\tBuild Path: ${CMAKE_CURRENT_BINARY_DIR}")

if(WIN32)
    if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
      message(FATAL_ERROR "MNN requires CMake 3.14+ to build on Windows!")
    endif()
    foreach(flag_var
        CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
        CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
        CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
        CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
        if (MNN_BUILD_SHARED_LIBS)
            if(${flag_var} MATCHES "/MT")
                string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
            endif()
        else ()
            if(${flag_var} MATCHES "/MD")
                string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
            endif()
        endif ()
    endforeach()
elseif(CMAKE_SYSTEM_NAME MATCHES "^Android" OR CMAKE_SYSTEM_NAME MATCHES "^Linux")
    add_definitions(-fPIC)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "^Android")
    add_definitions(-DMNN_BUILD_FOR_ANDROID)
    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
        add_definitions(-mfloat-abi=softfp -mfpu=neon)
    endif()
endif()
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")
        add_definitions(-mfpu=neon)    #please define in project/cross-compile/arm.toolchain.cmake
    endif()
    if(MNN_BUILD_HARD)
        add_definitions(-mfloat-abi=hard)  #better define in project/cross-compile/arm.toolchain.cmake
    endif()
endif()

IF(CMAKE_BUILD_TYPE MATCHES Debug)
    add_definitions(-DMNN_DEBUG -DDEBUG)
    if(MSVC)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DEBUG")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DEBUG")
    else()
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
    endif()
else()
    if (MSVC)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2")
    else()
        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)
                set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
                set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie -fPIE -s")
                set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
            endif()
        endif()
    endif()
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()

if(${CMAKE_SYSTEM_NAME} MATCHES "^Linux")
    if((CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64"))
        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()
include_directories(${CMAKE_CURRENT_LIST_DIR}/include/
                    ${CMAKE_CURRENT_LIST_DIR}/source/
                    ${CMAKE_CURRENT_LIST_DIR}/schema/current/
                    ${CMAKE_CURRENT_LIST_DIR}/3rd_party/
                    ${CMAKE_CURRENT_LIST_DIR}/3rd_party/flatbuffers/include
                    ${CMAKE_CURRENT_LIST_DIR}/3rd_party/half
                    ${CMAKE_CURRENT_LIST_DIR}/3rd_party/imageHelper
                    ${CMAKE_CURRENT_LIST_DIR}/3rd_party/OpenCLHeaders/
                  )

set(MNN_OBJECTS_TO_LINK "")
set(MNN_TARGETS "")

# Core
FILE(GLOB MNN_Core_SRC ${CMAKE_CURRENT_LIST_DIR}/source/core/*)
add_library(MNNCore OBJECT ${MNN_Core_SRC})
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNCore>)
list(APPEND MNN_TARGETS MNNCore)

# CV
FILE(GLOB MNN_CV_SRC ${CMAKE_CURRENT_LIST_DIR}/source/cv/*)
add_library(MNNCV OBJECT ${MNN_CV_SRC})
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNCV>)
list(APPEND MNN_TARGETS MNNCV)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(X86_64)|(x64)|(X64)|(amd64)|(AMD64)|(i686)")
    if(WIN32 OR MSVC)
        target_compile_options(MNNCV PRIVATE /arch:AVX)
    else()
        target_compile_options(MNNCV PRIVATE -msse3)
        target_compile_options(MNNCV PRIVATE -mavx)
    endif()
endif()

# Math
FILE(GLOB MNN_Math_SRC ${CMAKE_CURRENT_LIST_DIR}/source/math/*)
add_library(MNNMath OBJECT ${MNN_Math_SRC})
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNMath>)
list(APPEND MNN_TARGETS MNNMath)

# Shape
FILE(GLOB MNN_Shape_SRC ${CMAKE_CURRENT_LIST_DIR}/source/shape/*)
add_library(MNNShape OBJECT ${MNN_Shape_SRC})
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNShape>)
list(APPEND MNN_TARGETS MNNShape)

# Compute
FILE(GLOB MNN_Compute_SRC ${CMAKE_CURRENT_LIST_DIR}/source/backend/cpu/compute/*)
add_library(MNNCompute OBJECT ${MNN_Compute_SRC})
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNCompute>)
list(APPEND MNN_TARGETS MNNCompute)

# CPU
FILE(GLOB MNN_CPU_SRC ${CMAKE_CURRENT_LIST_DIR}/source/backend/cpu/*)
add_library(MNNCPU OBJECT ${MNN_CPU_SRC})
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNCPU>)
list(APPEND MNN_TARGETS MNNCPU)

# X86_64 AVX/SSE
include(${CMAKE_CURRENT_LIST_DIR}/source/backend/cpu/x86_x64/CMakeLists.txt)

# AArch32/64 Assemblies
include(${CMAKE_CURRENT_LIST_DIR}/source/backend/cpu/arm/CMakeLists.txt)

IF(NOT DEFINED IOS_ARCH)
  set(IOS_ARCH "")
ENDIF()

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")
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")
list(APPEND MNN_EXPR_PUB_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/include/MNN/expr/Executor.hpp")

set(MNN_DEPS "")
set(MNN_EXTRA_DEPENDS "")

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)
          find_package(Threads REQUIRED)
          add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE)
          set_property(TARGET OpenMP::OpenMP_CXX
              PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS})
          # Only works if the same flag is passed to the linker; use CMake 3.9+ otherwise (Intel, AppleClang)
          set_property(TARGET OpenMP::OpenMP_CXX
              PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads)
      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}")
      if (WIN32)
          set(OpenMP_C_FLAGS "/openmp ${OpenMP_C_FLAGS}")
          set(OpenMP_CXX_FLAGS "/openmp ${OpenMP_CXX_FLAGS}")
      endif()
      list(APPEND MNN_EXTRA_DEPENDS OpenMP::OpenMP_CXX)
    endif()
endif()

set(CMAKE_CXX_FLAGS_ORIGIN ${CMAKE_CXX_FLAGS})
set(CMAKE_C_FLAGS_ORIGIN ${CMAKE_C_FLAGS})
if ((NOT (MSVC OR WIN32)) AND MNN_HIDDEN)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -fvisibility=hidden")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
    if (NOT APPLE)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer")
    endif()
endif()
if (NOT (MSVC OR WIN32))
    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")
endif()

# Metal
include(${CMAKE_CURRENT_LIST_DIR}/source/backend/metal/CMakeLists.txt)
list(APPEND MNN_DEPS MNN)

# Plugin
if(MNN_WITH_PLUGIN)
    add_definitions(-DMNN_WITH_PLUGIN)
    include(${CMAKE_CURRENT_LIST_DIR}/source/plugin/CMakeLists.txt)
endif()

# Vulkan
IF(MNN_VULKAN)
  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/source/backend/vulkan/)
  IF(MNN_SEP_BUILD)
    list(APPEND MNN_DEPS MNN_Vulkan)
  ELSE()
    list(APPEND MNN_TARGETS MNN_Vulkan)
    list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNN_Vulkan>)
    list(APPEND MNN_EXTRA_DEPENDS ${MNN_VULKAN_LIBS})
  ENDIF()
ENDIF()

# 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})
  ENDIF()
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()

IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64" OR IOS_ARCH STREQUAL "arm64")
# ARM82 Assemblies
  IF(MNN_ARM82)
    add_definitions(-DENABLE_ARMV82)
    add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/source/backend/arm82/)
    IF(MNN_SEP_BUILD)
      list(APPEND MNN_DEPS MNN_Arm82)
    ELSE()
      list(APPEND MNN_TARGETS MNN_Arm82)
      list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNN_Arm82>)
    ENDIF()
  ENDIF()
ENDIF()
# Express
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/express/)

IF(MNN_SEP_BUILD)
  add_library(MNN SHARED ${CMAKE_CURRENT_LIST_DIR}/cmake/dummy.cpp ${MNN_OBJECTS_TO_LINK} ${MNN_PUB_HDRS} ${MNN_EXPR_PUB_HDRS})
  target_link_libraries(MNN PUBLIC ${MNN_EXTRA_DEPENDS})
  list(APPEND MNN_DEPS MNN_Express)
ELSE()
  list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNExpress>)
  list(APPEND MNN_TARGETS MNNExpress)
  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})
    if (MSVC OR WIN32)
      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()
  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})
ENDIF()
if (MSVC OR WIN32)
  target_link_options(MNN PRIVATE "/IGNORE:4049,4217")
endif()

if(APPLE)
    IF(MNN_AAPL_FMWK)
      set_target_properties(MNN PROPERTIES FRAMEWORK TRUE)
      set_target_properties(MNN PROPERTIES
          MACOSX_FRAMEWORK_IDENTIFIER com.alibaba.MNN
          MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PACKAGE_VERSION}
          MACOSX_FRAMEWORK_BUNDLE_VERSION ${PACKAGE_VERSION}
          XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
      )
      set_target_properties(MNN PROPERTIES MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/project/ios/MNN/Info.plist)
    ENDIF()
    IF(MNN_METAL)
      find_library(FOUNDATION Foundation REQUIRED)
      target_link_libraries(MNN PUBLIC ${FOUNDATION})
      find_library(METAL Metal REQUIRED)
      target_link_libraries(MNN PUBLIC ${METAL})
    ENDIF()
endif()
add_dependencies(MNN MNNCore MNNCV MNNShape MNNMath MNNCompute MNNCPU GenVCSHDR)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tools/converter)

if(CMAKE_SYSTEM_NAME MATCHES "^Linux")
# 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
  target_link_libraries(MNN PUBLIC -pthread dl)
elseif(CMAKE_SYSTEM_NAME MATCHES "^Android")
  target_link_libraries(MNN PUBLIC log android m)
else()
endif()
if (NOT MNN_BUILD_SHARED_LIBS)
    if(APPLE)
        set(MNN_DEPS -Wl,-all_load ${MNN_DEPS} -Wl,-noall_load)
    elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
        # Static-link will not replace thread-related weak symbol in glibc with strong symbol
        # 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
        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()
    endif()
endif()
list(APPEND MNN_TARGETS MNN)
  FOREACH(TARGET ${MNN_TARGETS})
    IF((NOT MSVC) AND (NOT WIN32))
    else()
      target_compile_definitions(${TARGET} PRIVATE _CRT_SECURE_NO_WARNINGS)
    endif()
  ENDFOREACH()
list(REMOVE_ITEM MNN_TARGETS MNN)
IF(MNN_BUILD_DEMO)
include(${CMAKE_CURRENT_LIST_DIR}/demo/exec/CMakeLists.txt)
ENDIF()
IF(MNN_BUILD_TOOLS)
include(${CMAKE_CURRENT_LIST_DIR}/tools/cpp/CMakeLists.txt)
ENDIF()
IF (MNN_BUILD_TRAIN)
  add_subdirectory(tools/train)
ENDIF()
IF(MNN_BUILD_TEST)
include(${CMAKE_CURRENT_LIST_DIR}/test/CMakeLists.txt)
ENDIF()
IF(MNN_BUILD_BENCHMARK)
include(${CMAKE_CURRENT_LIST_DIR}/benchmark/CMakeLists.txt)
ENDIF()
IF(MNN_BUILD_QUANTOOLS)
include(${CMAKE_CURRENT_LIST_DIR}/tools/quantization/CMakeLists.txt)
ENDIF()
IF(MNN_EVALUATION)
include(${CMAKE_CURRENT_LIST_DIR}/tools/evaluation/CMakeLists.txt)
ENDIF()

# 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()
    set(MNN_INCLUDE_OUTPUT ${NATIVE_INCLUDE_OUTPUT}/MNN)
    add_custom_command(
      TARGET MNN
      POST_BUILD
      COMMAND ${CMAKE_COMMAND}
      -E make_directory "${MNN_INCLUDE_OUTPUT}/"
    )
    add_custom_command(
      TARGET MNN
      POST_BUILD
      COMMAND ${CMAKE_COMMAND}
      -E make_directory "${MNN_INCLUDE_OUTPUT}/expr/"
    )
    FOREACH(header ${MNN_PUB_HDRS})
      add_custom_command(
        TARGET MNN
        POST_BUILD
        COMMAND ${CMAKE_COMMAND}
        ARGS -E copy ${header} "${MNN_INCLUDE_OUTPUT}/"
      )
    ENDFOREACH()
    FOREACH(header ${MNN_EXPR_PUB_HDRS})
      add_custom_command(
        TARGET MNN
        POST_BUILD
        COMMAND ${CMAKE_COMMAND}
        ARGS -E copy ${header} "${MNN_INCLUDE_OUTPUT}/expr/"
      )
    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
      LIBRARY DESTINATION lib
      ARCHIVE DESTINATION lib
  )
ELSE()
  install(TARGETS MNN
      LIBRARY DESTINATION lib
      ARCHIVE DESTINATION lib
      FRAMEWORK DESTINATION /Library/Frameworks/
  )
  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()
  IF(MNN_METAL)
    SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/mnn.metallib PROPERTIES MACOSX_PACKAGE_LOCATION Resources/)
  ENDIF()
ENDIF()

编译脚本:

#!/bin/bash
cmake ../../../ \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_ABI="armeabi-v7a" \
-DANDROID_STL=c++_static \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_NATIVE_API_LEVEL=android-21 \
-DANDROID_TOOLCHAIN=clang \
-DMNN_USE_LOGCAT=false \
-DMNN_BUILD_FOR_ANDROID_COMMAND=true \
-DNATIVE_LIBRARY_OUTPUT=. -DNATIVE_INCLUDE_OUTPUT=. $1 $2 $3

make -j4

编译日志:

Build Log:

-- The ASM compiler identification is Clang
-- Found assembler: /opt/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- Check for working C compiler: /opt/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- Check for working C compiler: /opt/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
-- Check for working CXX compiler: /opt/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.17") 
-- >>>>>>>>>>>>>
-- MNN BUILD INFO:
--  System: Android
--  Processor: armv7-a
--  Metal: OFF
--  OpenCL: ON
--  OpenGL: ON
--  Vulkan: ON
--  ARM82: OFF
--  OpenMP: OFF
--  Hidden: TRUE
--  Build Path: /home/ran/p/MNN-master/project/android/32
-- Enabling AArch32 Assemblies
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ran/p/MNN-master/project/android/32
Scanning dependencies of target MNNARM32
[  0%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNAddBias.S.o
Scanning dependencies of target MNNCompute
[  1%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNAddBiasRelu.S.o
[  1%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNAddBiasRelu6.S.o
[  1%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/BlstmComputer.cpp.o
Scanning dependencies of target MNNShape
[  1%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNAddC4WithStride.S.o
[  1%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNAxByClampBroadcastC4.S.o
[  1%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeArgMax.cpp.o
[  2%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNBilinearProcC1.S.o
[  2%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNBlitC1ToFloatRGBA.S.o
Scanning dependencies of target MNNCPU
[  2%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNBlitC3ToFloatRGBA.S.o
[  3%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUArgMax.cpp.o
[  3%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNCoefLine.S.o
[  3%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvDwF23MulTransUnit.S.o
[  4%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvDwF23SourceTransUnit.S.o
[  4%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvRunForLineDepthWiseInt8.S.o
[  4%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvRunForLineDepthWiseUint8.S.o
[  4%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvRunForLineDepthwise.S.o
[  5%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvRunForUnitDepthWise.S.o
[  5%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvRunForUnitDepthWiseInt8.S.o
[  5%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNConvRunForUnitDepthWiseUint8.S.o
[  5%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNCopyC4WithStride.S.o
[  5%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNCubicLineC4.S.o
[  6%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNCubicSampleC4.S.o
[  6%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNDeconvRunForUnitDepthWise.S.o
[  6%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNDepthWiseInt8AddBiasScaleUnit.S.o
[  6%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNExpC8.S.o
[  7%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNFloat2Int8.S.o
[  7%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmFloatCommon_4.S.o
[  7%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmFloatOne_4.S.o
[  7%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmFloatUnit_4.S.o
[  7%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmInt16to32_4x4_Common.S.o
[  8%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmInt16to32_4x4_Unit.S.o
[  8%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmInt8AddBiasScale_16x4_Unit.S.o
[  8%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmInt8AddBiasScale_16x4_Unit_FAST.S.o
[  8%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmInt8AddBiasScale_8x4_Unit.S.o
[  9%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmInt8toFloat32_8x4_Unit.S.o
[  9%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNGemmint8to32_8x4_Unit.S.o
[  9%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNInt8ScaleToFloat.S.o
[  9%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNLineDepthWiseInt8AddBiasScaleUnit.S.o
[ 10%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNLoadU8AndSum.S.o
[ 10%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNMatrixAdd.S.o
[ 10%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNMatrixMax.S.o
[ 10%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNMatrixProd.S.o
[ 10%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNMatrixSub.S.o
[ 11%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNMaxFloat.S.o
[ 11%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNMinFloat.S.o
[ 11%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNNV21ToBGRUnit.S.o
[ 11%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNNV21ToRGBAUnit.S.o
[ 12%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNNV21ToRGBUnit.S.o
[ 12%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeAsString.cpp.o
[ 12%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNPackC4.S.o
[ 12%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNPackC4ForMatMul_A.S.o
[ 12%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNPackedMatMul.S.o
[ 12%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNPackedMatMulRemain.S.o
[ 13%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNPowC8.S.o
[ 13%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNQuanToDestUint8.S.o
[ 13%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNReluInt8.S.o
[ 13%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNReluWithSlopeChannel.S.o
[ 13%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUAsString.cpp.o
[ 14%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNSamplerC1BilinearOpt.S.o
[ 14%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNSamplerC1NearestOpt.S.o
[ 14%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNSamplerC4BilinearOpt.S.o
[ 14%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNSamplerC4NearestOpt.S.o
[ 14%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNScaleAddInt8.S.o
[ 15%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNScaleAndAddBias.S.o
[ 15%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNStrassenMergeCFunction.S.o
[ 15%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNUInt8ToInt16WithOffsetC4Common.S.o
[ 15%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNUInt8ToInt16WithOffsetC4Fast.S.o
[ 16%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNUnPackC4.S.o
[ 16%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNWinogradMatrixProductLeft.S.o
[ 16%] Building ASM object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/arm32/MNNWinogradMatrixProductRight.S.o
[ 16%] Building CXX object CMakeFiles/MNNARM32.dir/source/backend/cpu/arm/CommonOptFunctionNeon.cpp.o
[ 16%] Built target MNNARM32
[ 16%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUBackend.cpp.o
[ 16%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/CommonOptFunction.cpp.o
[ 16%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeBatchMatMul.cpp.o
[ 16%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvOpt.cpp.o
[ 17%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/Convolution1x1Strassen.cpp.o
[ 18%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeBatchToSpaceND.cpp.o
Scanning dependencies of target MNNMath
[ 18%] Building CXX object CMakeFiles/MNNMath.dir/source/math/Matrix.cpp.o
[ 18%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUBatchMatMul.cpp.o
[ 18%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeBinaryOp.cpp.o
[ 19%] Building CXX object CMakeFiles/MNNMath.dir/source/math/WingoradGenerater.cpp.o
[ 19%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/Convolution3D3x3.cpp.o
[ 19%] Built target MNNMath
[ 19%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionDepthwise3x3.cpp.o
[ 19%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeBroadcastTo.cpp.o
[ 19%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUBatchToSpaceND.cpp.o
[ 19%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeCast.cpp.o
[ 20%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUBinary.cpp.o
[ 20%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeConcat.cpp.o
[ 20%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionFloatFactory.cpp.o
[ 21%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionGroup.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeConst.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeConvolution.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionInt8Executor.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionIntFactory.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUBroadcastTo.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeConvolution3D.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeCosineSimilarity.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionTiledExecutor.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUCast.cpp.o
[ 22%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConcat.cpp.o
[ 23%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeCrop.cpp.o
[ 23%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeCropAndResize.cpp.o
[ 24%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConst.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionWinograd.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ConvolutionWinograd3D.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeDeconvolution.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConv2DBackPropFilter.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeDepthToSpace.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/DeconvolutionWithStride.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConvInt8.cpp.o
[ 25%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeDequantize.cpp.o
[ 26%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeDetectionOutput.cpp.o
[ 26%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/Int8FunctionsOpt.cpp.o
[ 26%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConvolution.cpp.o
[ 26%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConvolution3D.cpp.o
[ 26%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/OptimizedComputer.cpp.o
[ 27%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/ResizeFunction.cpp.o
[ 27%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeDetectionPostProcess.cpp.o
[ 27%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/StrassenMatmulComputor.cpp.o
[ 27%] Building CXX object CMakeFiles/MNNCompute.dir/source/backend/cpu/compute/WinogradOptFunction.cpp.o
[ 27%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeEltwise.cpp.o
Scanning dependencies of target MNNCV
[ 27%] Building CXX object CMakeFiles/MNNCV.dir/source/cv/ImageBlitter.cpp.o
[ 28%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUConvolutionDepthwise.cpp.o
[ 28%] Building CXX object CMakeFiles/MNNCV.dir/source/cv/ImageFloatBlitter.cpp.o
[ 28%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeExpandDims.cpp.o
[ 28%] Building CXX object CMakeFiles/MNNCV.dir/source/cv/ImageProcess.cpp.o
[ 29%] Building CXX object CMakeFiles/MNNCV.dir/source/cv/ImageSampler.cpp.o
[ 29%] Built target MNNCompute
[ 29%] Building CXX object CMakeFiles/MNNCV.dir/source/cv/Matrix_CV.cpp.o
[ 30%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeFill.cpp.o
[ 30%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeGather.cpp.o
[ 30%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUCosineSimilarity.cpp.o
[ 30%] Built target MNNCV
[ 30%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUCrop.cpp.o
[ 30%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUCropAndResize.cpp.o
[ 30%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeGatherND.cpp.o
[ 30%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeGatherV2.cpp.o
[ 31%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDeconvolution.cpp.o
[ 31%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDeconvolutionDepthwise.cpp.o
[ 31%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeInnerProduct.cpp.o
[ 31%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDepthToSpace.cpp.o
[ 32%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeInterp.cpp.o
Scanning dependencies of target GenVCSHDR
[ 32%] Built target GenVCSHDR
[ 32%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeLSTM.cpp.o
[ 32%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeLinSpace.cpp.o
[ 32%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDepthwiseConvInt8.cpp.o
[ 32%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDequantize.cpp.o
[ 33%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDetectionOutput.cpp.o
[ 33%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeMatMul.cpp.o
[ 34%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeMoments.cpp.o
[ 34%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeNonMaxSuppressionV2.cpp.o
[ 34%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDetectionPostProcess.cpp.o
Scanning dependencies of target MNNCore
[ 34%] Building CXX object CMakeFiles/MNNCore.dir/source/core/AutoTime.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Backend.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNCore.dir/source/core/BackendFactory.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeOneHot.cpp.o
Scanning dependencies of target MNN_CLCodeGen
[ 35%] Built target MNN_CLCodeGen
[ 35%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUDilation2D.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNCore.dir/source/core/BackendRegister.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUEltwise.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNCore.dir/source/core/BufferAllocator.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePack.cpp.o
[ 35%] Building CXX object CMakeFiles/MNNCore.dir/source/core/ConvolutionCommon.cpp.o
[ 36%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUEltwiseInt8.cpp.o
[ 37%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePadding.cpp.o
[ 37%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePermute.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Execution.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUElu.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUExpandDims.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePlugin.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePool.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCore.dir/source/core/FileLoader.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Interpreter.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePool3D.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUFill.cpp.o
[ 38%] Building CXX object CMakeFiles/MNNCore.dir/source/core/MNNMemoryUtils.cpp.o
[ 39%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapePriorbox.cpp.o
[ 40%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUFloatToInt8.cpp.o
[ 40%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeProposal.cpp.o
[ 40%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUGather.cpp.o
[ 40%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeQuantizedAvgPool.cpp.o
[ 40%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeQuantizedMaxPool.cpp.o
[ 41%] Building CXX object CMakeFiles/MNNCore.dir/source/core/OpCommonUtils.cpp.o
[ 41%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUGatherND.cpp.o
[ 41%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUGatherV2.cpp.o
[ 42%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeQuantizedReshape.cpp.o
[ 42%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Pipeline.cpp.o
[ 42%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Schedule.cpp.o
[ 42%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUInnerProduct.cpp.o
[ 42%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeRNNSequenceGRU.cpp.o
[ 42%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeROIPooling.cpp.o
[ 43%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUInstanceNorm.cpp.o
[ 43%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUInt8ToFloat.cpp.o
[ 43%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeRange.cpp.o
[ 43%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Session.cpp.o
[ 43%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUInterp.cpp.o
[ 43%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeRank.cpp.o
[ 44%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeReduceJoin.cpp.o
[ 44%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPULRN.cpp.o
[ 45%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPULSTM.cpp.o
[ 45%] Building CXX object CMakeFiles/MNNCore.dir/source/core/SizeComputer.cpp.o
[ 45%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeReduction.cpp.o
[ 46%] Building CXX object CMakeFiles/MNNCore.dir/source/core/Tensor.cpp.o
[ 46%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPULinSpace.cpp.o
[ 46%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeRegister.cpp.o
[ 46%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeReshape.cpp.o
[ 46%] Building CXX object CMakeFiles/MNNCore.dir/source/core/TensorUtils.cpp.o
[ 46%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUMatMul.cpp.o
[ 47%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeResize.cpp.o
[ 47%] Building CXX object CMakeFiles/MNNCore.dir/source/core/WrapExecution.cpp.o
[ 47%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUMatrixBandPart.cpp.o
[ 47%] Built target MNNCore
[ 47%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeScatterNd.cpp.o
[ 47%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUMoments.cpp.o
[ 47%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSelect.cpp.o
[ 47%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeShape.cpp.o
[ 48%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUNonMaxSuppressionV2.cpp.o
[ 48%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUNormalize.cpp.o
[ 48%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUOPRegister.cpp.o
[ 48%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSize.cpp.o
[ 49%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSlice.cpp.o
[ 49%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSliceTf.cpp.o
[ 49%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUOneHot.cpp.o
[ 50%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPack.cpp.o
[ 50%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSpaceToBatchND.cpp.o
[ 50%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSpaceToDepth.cpp.o
[ 50%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPadding.cpp.o
[ 50%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPermute.cpp.o
[ 50%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPlugin.cpp.o
[ 51%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeSqueeze.cpp.o
[ 51%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeStridedSlice.cpp.o
[ 51%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeTFQuantizedConv2D.cpp.o
[ 51%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPool.cpp.o
[ 52%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPoolGrad.cpp.o
[ 52%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPoolInt8.cpp.o
[ 52%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeTensorConvert.cpp.o
[ 53%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeTile.cpp.o
[ 53%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUPriorbox.cpp.o
[ 53%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeTopKV2.cpp.o
[ 53%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeTranspose.cpp.o
[ 53%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeUnpack.cpp.o
[ 53%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUProposal.cpp.o
[ 54%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuanConvolutionDepthwise.cpp.o
[ 54%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedAdd.cpp.o
[ 54%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeUnravelIndex.cpp.o
[ 55%] Building CXX object CMakeFiles/MNNShape.dir/source/shape/ShapeWhere.cpp.o
[ 55%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedAvgPool.cpp.o
[ 55%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedConcat.cpp.o
[ 56%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedLogistic.cpp.o
[ 56%] Built target MNNShape
[ 56%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedMaxPool.cpp.o
[ 56%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedReshape.cpp.o
[ 56%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUQuantizedSoftmax.cpp.o
[ 56%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPURNNSequenceGRU.cpp.o
[ 57%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUROIPooling.cpp.o
[ 57%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPURange.cpp.o
[ 57%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPURank.cpp.o
[ 57%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUReduceJoin.cpp.o
[ 58%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUReduction.cpp.o
[ 58%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPURelu.cpp.o
[ 58%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUReluGrad.cpp.o
[ 58%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUReshape.cpp.o
[ 58%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUResize.cpp.o
[ 59%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUReverseSequence.cpp.o
[ 59%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPURuntime.cpp.o
[ 59%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUScale.cpp.o
[ 59%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUScatterNd.cpp.o
[ 60%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSelect.cpp.o
[ 60%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSelu.cpp.o
[ 60%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSetDiff1D.cpp.o
[ 60%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUShape.cpp.o
[ 60%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSigmoid.cpp.o
[ 61%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSize.cpp.o
[ 61%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSlice.cpp.o
[ 61%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSliceTf.cpp.o
[ 61%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSoftmax.cpp.o
[ 62%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSoftmaxGrad.cpp.o
[ 62%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSpaceToBatchND.cpp.o
[ 62%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSpaceToDepth.cpp.o
[ 62%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSpatialProduct.cpp.o
[ 63%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUSqueeze.cpp.o
[ 63%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUStridedSlice.cpp.o
[ 63%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUTFQuantizedConv2D.cpp.o
[ 63%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUTanh.cpp.o
[ 63%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUTensorConvert.cpp.o
[ 64%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUThreshold.cpp.o
[ 64%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUTile.cpp.o
[ 64%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUTopKV2.cpp.o
[ 64%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUTranspose.cpp.o
[ 65%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUUnary.cpp.o
[ 65%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUUnpack.cpp.o
[ 65%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUUnravelIndex.cpp.o
[ 65%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUWhere.cpp.o
[ 65%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/CPUZeroLike.cpp.o
[ 66%] Building CXX object CMakeFiles/MNNCPU.dir/source/backend/cpu/ThreadPool.cpp.o
[ 66%] Built target MNNCPU
Scanning dependencies of target MNN
[ 66%] Building CXX object CMakeFiles/MNN.dir/cmake/dummy.cpp.o
[ 66%] Linking CXX shared library libMNN.so
[ 66%] Built target MNN
Scanning dependencies of target MNN_Express
[ 66%] Building CXX object express/CMakeFiles/MNN_Express.dir/Executor.cpp.o
Scanning dependencies of target MNN_GL
[ 66%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/AllShader.cpp.o
[ 66%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLBackend.cpp.o
Scanning dependencies of target MNN_Vulkan
Scanning dependencies of target MNN_CL
[ 67%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/backend/VulkanBackend.cpp.o
[ 67%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/BufferPool.cpp.o
[ 67%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/ImageBufferConvertor.cpp.o
[ 67%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLBinary.cpp.o
[ 67%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/ImagePool.cpp.o
[ 67%] Building CXX object express/CMakeFiles/MNN_Express.dir/Expr.cpp.o
[ 67%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/compiler/AllShader.cpp.o
[ 67%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/OpenCLBackend.cpp.o
[ 67%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/compiler/VulkanShaderMap.cpp.o
[ 68%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLConcat.cpp.o
[ 68%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanBuffer.cpp.o
[ 68%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanCommandPool.cpp.o
[ 68%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLContext.cpp.o
[ 69%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanDevice.cpp.o
[ 69%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLConverter.cpp.o
[ 69%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanFence.cpp.o
[ 69%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanImage.cpp.o
[ 70%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/OpenCLRunningUtils.cpp.o
[ 70%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanInstance.cpp.o
[ 71%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanMemoryPool.cpp.o
[ 71%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLConvolution.cpp.o
[ 71%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanPipeline.cpp.o
[ 71%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/runtime/OpenCLRuntime.cpp.o
[ 71%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLConvolutionDepthwise.cpp.o
[ 71%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanSemaphore.cpp.o
[ 71%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/component/VulkanTensor.cpp.o
[ 71%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanBasicExecution.cpp.o
[ 71%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/core/runtime/OpenCLWrapper.cpp.o
[ 72%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLConvolutionIm2col.cpp.o
[ 72%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/BatchToSpaceExecution.cpp.o
[ 73%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanBatchToSpaceND.cpp.o
[ 73%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLEltwise.cpp.o
[ 74%] Building CXX object express/CMakeFiles/MNN_Express.dir/MathOp.cpp.o
[ 74%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanBinary.cpp.o
[ 75%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/CommonExecution.cpp.o
[ 75%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLInterp.cpp.o
[ 75%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanConcat.cpp.o
[ 75%] Building CXX object express/CMakeFiles/MNN_Express.dir/MergeOptimizer.cpp.o
[ 75%] Building CXX object express/CMakeFiles/MNN_Express.dir/NeuralNetWorkOp.cpp.o
[ 75%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ConcatExecution.cpp.o
[ 75%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLLock.cpp.o
[ 76%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLPermute.cpp.o
[ 76%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanConvolution.cpp.o
[ 76%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLPool.cpp.o
[ 76%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/Conv2DBackPropFilter.cpp.o
[ 76%] Building CXX object express/CMakeFiles/MNN_Express.dir/Optimizer.cpp.o
[ 76%] Building CXX object express/CMakeFiles/MNN_Express.dir/Utils.cpp.o
[ 77%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanConvolutionImpl.cpp.o
[ 77%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLProgram.cpp.o
[ 77%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLROIPooling.cpp.o
[ 77%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ConvExecution.cpp.o
[ 78%] Linking CXX shared library ../libMNN_Express.so
[ 78%] Built target MNN_Express
[ 78%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ConvInt8Execution.cpp.o
[ 78%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLRelu.cpp.o
[ 78%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanConvolutionWinograd.cpp.o
[ 78%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanCrop.cpp.o
[ 79%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLReshape.cpp.o
[ 80%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ConvWinograd.cpp.o
[ 80%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ConvertExecution.cpp.o
[ 80%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanDeconvolution.cpp.o
[ 80%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLSSBOBuffer.cpp.o
[ 80%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLSoftmax.cpp.o
[ 80%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLSqueeze.cpp.o
[ 80%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/CropExecution.cpp.o
[ 80%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanDeconvolutionDepthwise.cpp.o
[ 81%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLTexture.cpp.o
[ 82%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanImageConverter.cpp.o
[ 82%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLUnary.cpp.o
[ 82%] Building CXX object source/backend/opengl/CMakeFiles/MNN_GL.dir/GLUtils.cpp.o
[ 82%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanInterp.cpp.o
[ 82%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/DeconvExecution.cpp.o
[ 83%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/DepthwiseConvExecution.cpp.o
[ 83%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanLRN.cpp.o
[ 83%] Linking CXX shared library ../../../libMNN_GL.so
[ 83%] Built target MNN_GL
[ 83%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/DepthwiseConvInt8Execution.cpp.o
[ 83%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/DepthwiseDeconvExecution.cpp.o
[ 83%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanLSTM.cpp.o
[ 84%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanMatMul.cpp.o
[ 84%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanMatrixMultier4x4.cpp.o
[ 84%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/EltwiseExecution.cpp.o
[ 84%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanNormalize.cpp.o
[ 85%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/FloatToInt8Execution.cpp.o
[ 85%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/Int8ToFloatExecution.cpp.o
[ 85%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanPermute.cpp.o
[ 86%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanPool.cpp.o
[ 86%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanROIPooling.cpp.o
[ 86%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/InterpExecution.cpp.o
[ 86%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/LrnExecution.cpp.o
[ 86%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/MatmulExecution.cpp.o
[ 86%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanReduce.cpp.o
[ 87%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/MultiInputConvExecution.cpp.o
[ 87%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/MultiInputDeconvExecution.cpp.o
[ 87%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanRelu.cpp.o
[ 87%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/NormalizeExecution.cpp.o
[ 87%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/PermuteExecution.cpp.o
[ 87%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanReshape.cpp.o
[ 88%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanResize.cpp.o
[ 88%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanScale.cpp.o
[ 89%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/PoolExecution.cpp.o
[ 89%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanSlice.cpp.o
[ 89%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/PoolGradExecution.cpp.o
[ 89%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanSoftmax.cpp.o
[ 89%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ReductionExecution.cpp.o
[ 90%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanSpaceToBatchND.cpp.o
[ 90%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanSpatialProduct.cpp.o
[ 90%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ReluExecution.cpp.o
[ 90%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ReluGradExecution.cpp.o
[ 90%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanTensorConvert.cpp.o
[ 91%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ReshapeExecution.cpp.o
[ 91%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/execution/VulkanUnary.cpp.o
[ 91%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ResizeExecution.cpp.o
[ 91%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/RoiPoolingExecution.cpp.o
[ 91%] Building CXX object source/backend/vulkan/CMakeFiles/MNN_Vulkan.dir/runtime/vulkan_wrapper.cpp.o
[ 92%] Linking CXX shared library ../../../libMNN_Vulkan.so
[ 92%] Built target MNN_Vulkan
[ 92%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ScaleExecution.cpp.o
[ 93%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/SliceExecution.cpp.o
[ 93%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/SoftmaxExecution.cpp.o
[ 93%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/SoftmaxGradExecution.cpp.o
[ 93%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/SpaceToBatchExecution.cpp.o
[ 93%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/SpatialProductExecution.cpp.o
[ 94%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/TrainableParamExecution.cpp.o
[ 94%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/UnaryExecution.cpp.o
[ 94%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/ZerosLikeExecution.cpp.o
[ 94%] Building CXX object source/backend/opencl/CMakeFiles/MNN_CL.dir/execution/cl/opencl_program.cc.o
[ 95%] Linking CXX shared library ../../../libMNN_CL.so
[ 96%] Built target MNN_CL
Scanning dependencies of target backendTest.out
Scanning dependencies of target mobilenetTest.out
[ 96%] Building CXX object CMakeFiles/backendTest.out.dir/tools/cpp/backendTest.cpp.o
[ 96%] Building CXX object CMakeFiles/mobilenetTest.out.dir/tools/cpp/mobilenetTest.cpp.o
Scanning dependencies of target testModel.out
Scanning dependencies of target timeProfile.out
[ 97%] Building CXX object CMakeFiles/testModel.out.dir/tools/cpp/testModel.cpp.o
[ 97%] Building CXX object CMakeFiles/timeProfile.out.dir/tools/cpp/timeProfile.cpp.o
[ 97%] Linking CXX executable testModel.out
[ 97%] Built target testModel.out
[ 97%] Building CXX object CMakeFiles/timeProfile.out.dir/tools/cpp/revertMNNModel.cpp.o
Scanning dependencies of target checkInvalidValue.out
[ 97%] Building CXX object CMakeFiles/checkInvalidValue.out.dir/tools/cpp/checkInvalidValue.cpp.o
[ 97%] Linking CXX executable backendTest.out
[ 97%] Built target backendTest.out
Scanning dependencies of target MNNV2Basic.out
[ 97%] Building CXX object CMakeFiles/MNNV2Basic.out.dir/tools/cpp/MNNV2Basic.cpp.o
[ 98%] Linking CXX executable checkInvalidValue.out
[ 98%] Built target checkInvalidValue.out
[ 98%] Building CXX object CMakeFiles/MNNV2Basic.out.dir/tools/cpp/revertMNNModel.cpp.o
[ 98%] Linking CXX executable mobilenetTest.out
[ 98%] Built target mobilenetTest.out
[ 98%] Building CXX object C1MakeFiles/timeProfile.out.dir/tools/cpp/Profiler.cpp.o
Scanning dependencies of target testModelWithDescrisbe.out
[ 98%] Building CXX object CMakeFiles/testModelWithDescrisbe.out.dir/tools/cpp/testModelWithDescrisbe.cpp.o
[ 98%] Building CXX object CMakeFiles/testModelWithDescrisbe.out.dir/tools/cpp/Config.cpp.o
Scanning dependencies of target getPerformance.out
[ 98%] Building CXX object CMakeFiles/getPerformance.out.dir/tools/cpp/getPerformance.cpp.o
[ 98%] Linking CXX executable getPerformance.out
[ 98%] Built target getPerformance.out
[ 99%] Linking CXX executable testModelWithDescrisbe.out
[ 99%] Built target testModelWithDescrisbe.out
[100%] Linking CXX executable timeProfile.out
[100%] Built target timeProfile.out
[100%] Linking CXX executable MNNV2Basic.out
[100%] Built target MNNV2Basic.out

问题描述:

  1. center-face项目迁移至andorid端MNN框架进行推理时 VULKAN、OPENGL后端输出结果错误,cpu推理输出结果正确 项目地址:https://github.com/Star-Clouds/CenterFace 其中包含了 MNN的推理代码(路径:https://github.com/Star-Clouds/CenterFace/tree/master/prj-mnn) 以及mnn的模型文件(路径:CenterFace/models/mnn/)

  2. 使用自己训练的 4层全连接层模型 输入 1,15 向量 输出 1,1 标量, 推理结果 同样不一致, 模型文件:https://github.com/zhra46/crnn.pytorch/raw/master/dist_mlp.mnn 输入 尺寸 15,1,1,1 输入测试数据: float input[15] = {0.4831, 0.3268, 0.5203, 0.4072, 0.9992, 0.4944, 0.3581, 0.5102, 0.3624,0.5007, 0.3761, 0.4934, 0.3852, 0.5067, 0.3886}; cpu输出:2.7199
    OPENGL输出: 1.67 VULKAN输出 : 1.84 (不同设备不一致) 测试代码:

    distmlp_interpreter_ = std::unique_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(model_path));
    MNN::ScheduleConfig schedule_config;
    schedule_config.type = MNN_FORWARD_OPENGL;
    schedule_config.numThread = 1;
    MNN::BackendConfig backend_config;
    backend_config.power = MNN::BackendConfig::Power_Normal;
    backend_config.precision = MNN::BackendConfig::Precision_Normal;
    schedule_config.backendConfig = &backend_config;
    
    // create session
    distmlp_sess_ = distmlp_interpreter_->createSession(schedule_config);
    input_tensor_ = distmlp_interpreter_->getSessionInput(distmlp_sess_, "input0");
    distmlp_interpreter_->resizeTensor(input_tensor_, 1, 15, 1, 1);
    distmlp_interpreter_->resizeSession(distmlp_sess_);
    float input[15] = {0.4831, 0.3268, 0.5203, 0.4072, 0.9992, 0.4944, 0.3581, 0.5102, 0.3624,0.5007, 0.3761, 0.4934, 0.3852, 0.5067, 0.3886};
    auto nchwTensor = new MNN::Tensor(input_tensor_, MNN::Tensor::CAFFE);
    for(int j =0;j<15;j++){
     nchwTensor->host<float>()[j] = input[j];
        }
    input_tensor_->copyFromHostTensor(nchwTensor);
    distmlp_interpreter_->runSession(distmlp_sess_);
    MNN::Tensor *vector = distmlp_interpreter_->getSessionOutput(distmlp_sess_, "output0");
    MNN::Tensor vector_host(vector, vector->getDimensionType());
    vector->copyToHostTensor(&vector_host);
    current_dist = vector_host.host<float>()[0];
hjchen2 commented 4 years ago

Maybe caused by the following issues: 1、For gpu backends (include VULKAN、OPENGL and OPENCL), there maybe a little precision loss. 2、Vulkan and opengl backends are not fully tested, and there maybe some bugs. We will release the newest version this month and please try it again.

1123

zhra46 commented 4 years ago

Maybe caused by the following issues: 1、For gpu backends (include VULKAN、OPENGL and OPENCL), there maybe a little precision loss. 2、Vulkan and opengl backends are not fully tested, and there maybe some bugs. We will release the newest version this month and please try it again.

1123

thank you for your reply. but i don't think this is a precision problem, in center-face case, gpu backends inference cannot even get a confidence score > 0.1 (with cpu backends, there are multiple predictions conf score is 0.88,same picture same code) looking forward to new version

gofugoo commented 4 years ago

with cpu backends, there are multiple predictions conf score is 0.88,same picture same code) looking forward to new version

I am in the same situation with yolov model, VULKAN and OPENCL take as much time as cpu, OPENGL is extremely faster. All of these do not work except the CPU, and the values of confidences are always zero.

eudora-jia commented 4 years ago

你可以将输入tensor 使用以下方式打印出来看看` auto nhwcTensor = new MNN::Tensor(inputTensor, inputTensor->getDimensionType(),true); // nhwcTensor-host()[x] = ... inputTensor->copyToHostTensor(nhwcTensor);

LOGI("after convert:%f,%f,%f,%f", nhwcTensor->host<float>()[0], 
                    nhwcTensor->host<float>()[1],
                    nhwcTensor->host<float>()[2],
                    nhwcTensor->host<float>()[3]);
delete nhwcTensor;

` 我的情况就是这个tensor 多次循环的情况下 没变过

jxt1234 commented 4 years ago

更新下代码测试一下 Vulkan / OpenCL 吧

eudora-jia commented 4 years ago

谢谢马上看看代码并测试一番