|
|
|
@ -41,40 +41,52 @@ endif()
|
|
|
|
|
if (SUPPORT_TRAIN)
|
|
|
|
|
set(ANF_SRC
|
|
|
|
|
${ANF_SRC}
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
set(PASS_SRC)
|
|
|
|
|
set(LITE_SRC
|
|
|
|
|
${LITE_SRC}
|
|
|
|
|
${ANF_SRC}
|
|
|
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/train/ops/train_ops.cc
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/train/train_populate_parameter.cc
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/train/train_session.cc
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lite_session.cc
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
file(GLOB_RECURSE C_OPS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/ops/*.cc)
|
|
|
|
|
add_subdirectory(runtime/kernel/arm)
|
|
|
|
|
|
|
|
|
|
add_library(mindspore-lite SHARED ${LITE_SRC} ${C_OPS_SRC})
|
|
|
|
|
set_target_properties(mindspore-lite PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
|
|
|
|
|
|
|
|
|
add_library(mindspore-lite_static STATIC ${LITE_SRC} ${C_OPS_SRC})
|
|
|
|
|
set_target_properties(mindspore-lite_static PROPERTIES OUTPUT_NAME "mindspore-lite")
|
|
|
|
|
set_target_properties(mindspore-lite_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
|
|
|
|
|
if (SUPPORT_GPU)
|
|
|
|
|
add_subdirectory(runtime/kernel/opencl)
|
|
|
|
|
target_link_libraries(mindspore-lite
|
|
|
|
|
cpu_kernel_mid_
|
|
|
|
|
opencl_kernel_lib_
|
|
|
|
|
cpu_kernel_mid
|
|
|
|
|
opencl_kernel_mid
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(mindspore-lite_static
|
|
|
|
|
cpu_kernel_mid
|
|
|
|
|
opencl_kernel_mid
|
|
|
|
|
)
|
|
|
|
|
else ()
|
|
|
|
|
target_link_libraries(mindspore-lite
|
|
|
|
|
cpu_kernel_mid_
|
|
|
|
|
cpu_kernel_mid
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(mindspore-lite_static
|
|
|
|
|
cpu_kernel_mid
|
|
|
|
|
)
|
|
|
|
|
endif ()
|
|
|
|
|
add_subdirectory(runtime/kernel/arm)
|
|
|
|
|
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
|
|
|
|
|
target_link_libraries(mindspore-lite log)
|
|
|
|
|
endif ()
|
|
|
|
|
if (BUILD_MINDDATA STREQUAL "lite")
|
|
|
|
|
target_link_libraries(mindspore-lite minddata-eager minddata-lite)
|
|
|
|
|
target_link_libraries(mindspore-lite minddata_eager_mid minddata-lite)
|
|
|
|
|
target_link_libraries(mindspore-lite_static minddata_eager_mid)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND (PLATFORM_ARM64 OR PLATFORM_ARM32))
|
|
|
|
|