提交 f06c890e 编写于 作者: M Megvii Engine Team 提交者: XindaH

fix(dnn/cambricon): make checksum bang-c kernel work for MLU370

GitOrigin-RevId: b29d6a1912a1ababdb757cf72d77ec72fb11e5e0
上级 396412e7
......@@ -798,14 +798,15 @@ endif()
if(MGE_WITH_CAMBRICON)
include_directories("$ENV{NEUWARE_HOME}/include")
link_directories("$ENV{NEUWARE_HOME}/lib64")
if (BANG_ARCH LESS 300)
include(cmake/cnml.cmake)
list(APPEND MGE_CAMBRICON_LIBS libcnml)
else()
list(APPEND MGE_CAMBRICON_LIBS libcnrt libcndev)
if (CNRT_VERSION_STRING VERSION_GREATER "5.0.0")
include(cmake/cnnl.cmake)
include(cmake/cnlight.cmake)
include(cmake/magicmind.cmake)
list(APPEND MGE_CAMBRICON_LIBS libcnnl libcnnl_extra libcnlight libmagicmind libmagicmid_runtime)
list(APPEND MGE_CAMBRICON_LIBS libcnnl libcnnl_extra libcnlight libmagicmind libmagicmind_runtime)
else()
include(cmake/cnml.cmake)
list(APPEND MGE_CAMBRICON_LIBS libcnml)
endif()
set(MGE_CAMBRICON_LIBS "${MGE_CAMBRICON_LIBS}")
endif()
......
......@@ -9,7 +9,7 @@ if(CNDEV_LIBRARY STREQUAL "CNDEV_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find CNDEV Library")
endif()
get_filename_component(__found_cndev_root "${CNDEV_LIBRARY}/../include" REALPATH)
get_filename_component(__found_cndev_root ${CNDEV_LIBRARY}/../.. REALPATH)
find_path(CNDEV_INCLUDE_DIR
NAMES cndev.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_cndev_root}
......
......@@ -9,7 +9,7 @@ if(CNLIGHT_LIBRARY STREQUAL "CNLIGHT_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find CNLIGHT Library")
endif()
get_filename_component(__found_cnlight_root "${CNLIGHT_LIBRARY}/../include" REALPATH)
get_filename_component(__found_cnlight_root "${CNLIGHT_LIBRARY}/../.." REALPATH)
find_path(CNLIGHT_INCLUDE_DIR
NAMES cnlight.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_cnlight_root}
......
......@@ -9,7 +9,7 @@ if(CNML_LIBRARY STREQUAL "CNML_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find CNML Library")
endif()
get_filename_component(__found_cnml_root "${CNML_LIBRARY}/../include" REALPATH)
get_filename_component(__found_cnml_root "${CNML_LIBRARY}/../.." REALPATH)
find_path(CNML_INCLUDE_DIR
NAMES cnml.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_cnml_root}
......
......@@ -9,7 +9,7 @@ if(CNNL_LIBRARY STREQUAL "CNNL_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find CNNL Library")
endif()
get_filename_component(__found_cnnl_root "${CNNL_LIBRARY}/../include" REALPATH)
get_filename_component(__found_cnnl_root "${CNNL_LIBRARY}/../.." REALPATH)
find_path(CNNL_INCLUDE_DIR
NAMES cnnl.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_cnnl_root}
......@@ -49,7 +49,7 @@ if(CNNL_EXTRA_LIBRARY STREQUAL "CNNL_EXTRA_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find CNNL_EXTRA Library")
endif()
get_filename_component(__found_cnnl_extra_root "${CNNL_EXTRA_LIBRARY}/../include" REALPATH)
get_filename_component(__found_cnnl_extra_root "${CNNL_EXTRA_LIBRARY}/../.." REALPATH)
find_path(CNNL_EXTRA_INCLUDE_DIR
NAMES cnnl_extra.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_cnnl_extra_root}
......
......@@ -9,7 +9,7 @@ if(CNRT_LIBRARY STREQUAL "CNRT_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find CNRT Library")
endif()
get_filename_component(__found_cnrt_root "${CNRT_LIBRARY}/../include" REALPATH)
get_filename_component(__found_cnrt_root ${CNRT_LIBRARY}/../../ REALPATH)
find_path(CNRT_INCLUDE_DIR
NAMES cnrt.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_cnrt_root}
......
......@@ -9,7 +9,7 @@ if(MAGICMIND_LIBRARY STREQUAL "MAGICMIND_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Can not find MAGICMIND Library")
endif()
get_filename_component(__found_magicmind_root "${MAGICMIND_LIBRARY}/../include" REALPATH)
get_filename_component(__found_magicmind_root "${MAGICMIND_LIBRARY}/../../" REALPATH)
find_path(MAGICMIND_INCLUDE_DIR
NAMES common.h
HINTS "$ENV{NEUWARE_HOME}/include" ${__found_magicmind_root}
......@@ -40,7 +40,7 @@ message(STATUS "Found MAGICMIND: ${__found_magicmind_root} (found version: ${MAG
find_library(MAGICMIND_RUNTIME_LIBRARY
NAMES libmagicmind_runtime.so
PATHS "${__found_magicmind_root}/../lib64"
PATHS "${__found_magicmind_root}/lib64"
)
if(MAGICMIND_RUNTIME_LIBRARY STREQUAL "MAGICMIND_RUNTIME_LIBRARY-NOTFOUND")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册