-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2223 from alibaba/feature/sync
[MNN:Sync] Sync Internal 2.3.1
- Loading branch information
Showing
92 changed files
with
3,664 additions
and
2,038 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,20 @@ | ||
option(MNN_CODEGEN_LLVM "Build llvm backend for codegen." OFF) | ||
option(MNN_CODEGEN_C "Build C source backend for codegen." OFF) | ||
option(MNN_CODEGEN_OPENCL "Build OpenCL source backend for codegen." OFF) | ||
option(MNN_CODEGEN_JIT "Build jit for codegen." OFF) | ||
option(MNN_CODEGEN_OPENCL "Build OpenCL op fuse." OFF) | ||
option(MNN_CODEGEN_METAL "Build Metal op fuse." OFF) | ||
|
||
|
||
file(GLOB CODEGEN_HEADER "${CMAKE_CURRENT_LIST_DIR}/*.*") | ||
file(GLOB CPU_SRCS "${CMAKE_CURRENT_LIST_DIR}/cpu/*.*") | ||
file(GLOB JIT_SRCS "${CMAKE_CURRENT_LIST_DIR}/jit/*.*") | ||
list(APPEND MNN_CODEGEN_SRCS ${CODEGEN_HEADER}) | ||
list(APPEND MNN_CODEGEN_SRCS ${JIT_SRCS}) | ||
file(GLOB MNN_FUSE_SRCS "${CMAKE_CURRENT_LIST_DIR}/*.*") | ||
|
||
if(MNN_CODEGEN_OPENCL) | ||
add_definitions(-DMNN_CODEGEN_OPENCL) | ||
file(GLOB OPENCL_SRCS "${CMAKE_CURRENT_LIST_DIR}/opencl/*.*") | ||
list(APPEND MNN_CODEGEN_SRCS ${OPENCL_SRCS}) | ||
endif() | ||
|
||
if(MNN_CODEGEN_C) | ||
add_definitions(-DMNN_CODEGEN_CPU) | ||
add_definitions(-DMNN_CODEGEN_C) | ||
file(GLOB C_SRCS "${CMAKE_CURRENT_LIST_DIR}/cpu/c/*.*") | ||
list(APPEND MNN_CODEGEN_SRCS ${CPU_SRCS}) | ||
list(APPEND MNN_CODEGEN_SRCS ${C_SRCS}) | ||
list(APPEND MNN_FUSE_SRCS ${OPENCL_SRCS}) | ||
endif() | ||
|
||
if(MNN_CODEGEN_LLVM) | ||
add_definitions(-DMNN_CODEGEN_CPU) | ||
add_definitions(-DMNN_CODEGEN_LLVM) | ||
file(GLOB LLVM_SRCS "${CMAKE_CURRENT_LIST_DIR}/cpu/llvm/*.*") | ||
list(APPEND MNN_CODEGEN_SRCS ${CPU_SRCS}) | ||
list(APPEND MNN_CODEGEN_SRCS ${LLVM_SRCS}) | ||
# add llvm libs | ||
find_package(LLVM REQUIRED CONFIG) | ||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") | ||
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") | ||
include_directories(${LLVM_INCLUDE_DIRS}) | ||
add_definitions(${LLVM_DEFINITIONS}) | ||
llvm_map_components_to_libnames(llvm_libs core bitwriter OrcJIT Support nativecodegen native CodeGen) | ||
list(APPEND MNN_EXTRA_DEPENDS ${llvm_libs}) | ||
if(MNN_CODEGEN_METAL) | ||
add_definitions(-DMNN_CODEGEN_METAL) | ||
file(GLOB METAL_SRCS "${CMAKE_CURRENT_LIST_DIR}/metal/*.*") | ||
list(APPEND MNN_FUSE_SRCS ${METAL_SRCS}) | ||
endif() | ||
|
||
add_library(MNNCodegen OBJECT ${MNN_CODEGEN_SRCS}) | ||
set_property(TARGET MNNCodegen PROPERTY CXX_STANDARD 14) | ||
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNCodegen>) | ||
add_library(MNNFuse OBJECT ${MNN_FUSE_SRCS}) | ||
# set_property(TARGET MNNFuse PROPERTY CXX_STANDARD 14) | ||
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNNFuse>) |
Oops, something went wrong.