fix mindspore-static lib generation and fix cast infershape

This commit is contained in:
xuanyue 2020-10-09 19:35:06 +08:00
parent 7148109c06
commit 56df19e09e
3 changed files with 7 additions and 5 deletions

View File

@ -35,8 +35,9 @@ endif()
########################### build nnacl static library ########################
string(REPLACE "-fvisibility=hidden" "-fvisibility=default" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
add_library(nnacl STATIC ${KERNEL_SRC} ${TRAIN_SRC} ${ASSEMBLY_SRC})
add_library(nnacl_mid OBJECT ${KERNEL_SRC} ${TRAIN_SRC} ${ASSEMBLY_SRC})
########################### arm64 build optimize library ########################
if (PLATFORM_ARM64)
add_subdirectory(${NNACL_DIR}/optimize)
endif()
endif()

View File

@ -77,13 +77,14 @@ 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_mid nnacl)
target_link_libraries(mindspore-lite_static cpu_kernel_mid opencl_kernel_mid nnacl)
target_link_libraries(mindspore-lite_static cpu_kernel_mid opencl_kernel_mid nnacl_mid)
else ()
target_link_libraries(mindspore-lite cpu_kernel_mid nnacl)
target_link_libraries(mindspore-lite_static cpu_kernel_mid nnacl)
target_link_libraries(mindspore-lite_static cpu_kernel_mid nnacl_mid)
endif ()
if (PLATFORM_ARM32 OR PLATFORM_ARM64)
target_link_libraries(mindspore-lite log)
target_link_libraries(mindspore-lite_static log)
endif ()
if (BUILD_MINDDATA STREQUAL "lite")
target_link_libraries(mindspore-lite minddata_eager_mid minddata-lite)

View File

@ -39,8 +39,8 @@ constexpr uint32_t kDoubleNum = 2;
constexpr uint32_t kMultiNum = 3;
constexpr uint32_t kDimension_4d = 4;
const std::set<int> kSupportDataType = {kNumberTypeUInt8, kNumberTypeInt8, kNumberTypeInt32, kNumberTypeFloat32,
kNumberTypeFloat16};
const std::set<int> kSupportDataType = {kNumberTypeBool, kNumberTypeUInt8, kNumberTypeInt8,
kNumberTypeInt32, kNumberTypeFloat32, kNumberTypeFloat16};
#ifdef PRIMITIVE_WRITEABLE
using TensorPtr = std::shared_ptr<mindspore::tensor::Tensor>;