Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
08968c27
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
08968c27
编写于
4月 21, 2020
作者:
D
dengwentao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify tvm build
上级
5519bce8
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
145 addition
and
131 deletion
+145
-131
CMakeLists.txt
CMakeLists.txt
+0
-2
cmake/external_libs/dmlc_core.cmake
cmake/external_libs/dmlc_core.cmake
+1
-1
cmake/external_libs/tvm_gpu.cmake
cmake/external_libs/tvm_gpu.cmake
+10
-3
cmake/package.cmake
cmake/package.cmake
+9
-3
cmake/utils.cmake
cmake/utils.cmake
+21
-7
mindspore/ccsrc/CMakeLists.txt
mindspore/ccsrc/CMakeLists.txt
+0
-111
third_party/patch/incubator-tvm/CMakeLists.txt
third_party/patch/incubator-tvm/CMakeLists.txt
+100
-0
third_party/patch/incubator-tvm/find_library.patch
third_party/patch/incubator-tvm/find_library.patch
+4
-4
未找到文件。
CMakeLists.txt
浏览文件 @
08968c27
cmake_minimum_required
(
VERSION 3.14
)
project
(
MindSpore
)
include
(
${
CMAKE_SOURCE_DIR
}
/cmake/options.cmake
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake/modules/"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
...
...
cmake/external_libs/dmlc_core.cmake
浏览文件 @
08968c27
mindspore_add_pkg
(
dmlc
_
core
mindspore_add_pkg
(
dmlc
-
core
VER 0.3
HEAD_ONLY ./
URL https://github.com/dmlc/dmlc-core/archive/808f485387f9a03f78fa9f1159f387d0d91b7a28.zip
...
...
cmake/external_libs/tvm_gpu.cmake
浏览文件 @
08968c27
...
...
@@ -2,7 +2,14 @@ set(incubator_tvm_gpu_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set
(
incubator_tvm_gpu_CFLAGS
"-D_FORTIFY_SOURCE=2 -O2"
)
mindspore_add_pkg
(
incubator_tvm_gpu
VER 0.6.0
HEAD_ONLY ./
LIBS tvm
URL https://github.com/apache/incubator-tvm/archive/v0.6.0.tar.gz
MD5 9cbbd32545a776023acabbba270449fe
)
MD5 9cbbd32545a776023acabbba270449fe
CUSTOM_CMAKE
${
CMAKE_SOURCE_DIR
}
/third_party/patch/incubator-tvm/
SUBMODULES
${
dlpack_DIRPATH
}
${
dmlc-core_DIRPATH
}
${
rang_DIRPATH
}
SOURCEMODULES topi/python/topi python/tvm
PATCHES
${
CMAKE_SOURCE_DIR
}
/third_party/patch/incubator-tvm/find_library.patch
${
CMAKE_SOURCE_DIR
}
/third_party/patch/incubator-tvm/include.patch
${
CMAKE_SOURCE_DIR
}
/third_party/patch/incubator-tvm/src_pass.patch
CMAKE_OPTION
" "
)
add_library
(
mindspore::tvm ALIAS incubator_tvm_gpu::tvm
)
\ No newline at end of file
cmake/package.cmake
浏览文件 @
08968c27
...
...
@@ -191,11 +191,17 @@ if (ENABLE_GPU)
DESTINATION
${
INSTALL_PY_DIR
}
/../
COMPONENT mindspore
)
if
(
EXISTS
${
CMAKE_BINARY_DIR
}
/incubator-tvm
)
if
(
EXISTS
${
incubator_tvm_gpu_ROOT
}
)
file
(
GLOB_RECURSE GLOG_LIB_LIST
${
incubator_tvm_gpu_LIBPATH
}
/lib*
)
install
(
FILES
${
GLOG_LIB_LIST
}
DESTINATION
${
INSTALL_LIB_DIR
}
COMPONENT mindspore
)
install
(
DIRECTORY
${
CMAKE_BINARY_DIR
}
/incubator-tvm
/topi/python/topi
${
CMAKE_BINARY_DIR
}
/incubator-tvm
/python/tvm
${
incubator_tvm_gpu_ROOT
}
/topi/python/topi
${
incubator_tvm_gpu_ROOT
}
/python/tvm
DESTINATION
${
INSTALL_PY_DIR
}
/../_akg
COMPONENT mindspore
)
...
...
cmake/utils.cmake
浏览文件 @
08968c27
...
...
@@ -205,8 +205,8 @@ set(MS_FIND_NO_DEFAULT_PATH ${MS_FIND_NO_DEFAULT_PATH} PARENT_SCOPE)
function
(
mindspore_add_pkg pkg_name
)
set
(
options
)
set
(
oneValueArgs URL MD5 GIT_REPOSITORY GIT_TAG VER EXE DIR HEAD_ONLY CMAKE_PATH RELEASE LIB_PATH
)
set
(
multiValueArgs CMAKE_OPTION LIBS PRE_CONFIGURE_COMMAND CONFIGURE_COMMAND BUILD_OPTION INSTALL_INCS INSTALL_LIBS PATCHES
)
set
(
oneValueArgs URL MD5 GIT_REPOSITORY GIT_TAG VER EXE DIR HEAD_ONLY CMAKE_PATH RELEASE LIB_PATH
CUSTOM_CMAKE
)
set
(
multiValueArgs CMAKE_OPTION LIBS PRE_CONFIGURE_COMMAND CONFIGURE_COMMAND BUILD_OPTION INSTALL_INCS INSTALL_LIBS PATCHES
SUBMODULES SOURCEMODULES
)
cmake_parse_arguments
(
PKG
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
if
(
NOT PKG_LIB_PATH
)
...
...
@@ -270,11 +270,17 @@ function(mindspore_add_pkg pkg_name )
endif
()
if
(
NOT PKG_DIR
)
if
(
PKG_GIT_REPOSITORY
)
__download_pkg_with_git
(
${
pkg_name
}
${
PKG_GIT_REPOSITORY
}
${
PKG_GIT_TAG
}
${
PKG_MD5
}
)
else
()
if
(
PKG_GIT_REPOSITORY
)
__download_pkg_with_git
(
${
pkg_name
}
${
PKG_GIT_REPOSITORY
}
${
PKG_GIT_TAG
}
${
PKG_MD5
}
)
else
()
__download_pkg
(
${
pkg_name
}
${
PKG_URL
}
${
PKG_MD5
}
)
endif
()
endif
()
foreach
(
_SUBMODULE_FILE
${
PKG_SUBMODULES
}
)
STRING
(
REGEX REPLACE
"(.+)_(.+)"
"
\\
1"
_SUBMODEPATH
${
_SUBMODULE_FILE
}
)
STRING
(
REGEX REPLACE
"(.+)/(.+)"
"
\\
2"
_SUBMODENAME
${
_SUBMODEPATH
}
)
file
(
GLOB
${
pkg_name
}
_INSTALL_SUBMODULE
${
_SUBMODULE_FILE
}
/*
)
file
(
COPY
${${
pkg_name
}
_INSTALL_SUBMODULE
}
DESTINATION
${${
pkg_name
}
_SOURCE_DIR
}
/3rdparty/
${
_SUBMODENAME
}
)
endforeach
(
_SUBMODULE_FILE
)
else
()
set
(
${
pkg_name
}
_SOURCE_DIR
${
PKG_DIR
}
)
endif
()
...
...
@@ -294,12 +300,20 @@ function(mindspore_add_pkg pkg_name )
message
(
FATAL_ERROR
"Failed patch:
${
_LF_PATCH_FILE
}
"
)
endif
()
endforeach
(
_PATCH_FILE
)
foreach
(
_SOURCE_DIR
${
PKG_SOURCEMODULES
}
)
file
(
GLOB
${
pkg_name
}
_INSTALL_SOURCE
${${
pkg_name
}
_SOURCE_DIR
}
/
${
_SOURCE_DIR
}
/*
)
file
(
COPY
${${
pkg_name
}
_INSTALL_SOURCE
}
DESTINATION
${${
pkg_name
}
_BASE_DIR
}
/
${
_SOURCE_DIR
}
/
)
endforeach
(
_SUBMODULE_FILE
)
file
(
LOCK
${${
pkg_name
}
_BASE_DIR
}
DIRECTORY GUARD FUNCTION RESULT_VARIABLE
${
pkg_name
}
_LOCK_RET TIMEOUT 600
)
if
(
NOT
${
pkg_name
}
_LOCK_RET EQUAL
"0"
)
message
(
FATAL_ERROR
"error! when try lock
${${
pkg_name
}
_BASE_DIR
}
:
${${
pkg_name
}
_LOCK_RET
}
"
)
endif
()
if
(
PKG_CUSTOM_CMAKE
)
file
(
GLOB
${
pkg_name
}
_cmake
${
PKG_CUSTOM_CMAKE
}
/CMakeLists.txt
)
file
(
COPY
${${
pkg_name
}
_cmake
}
DESTINATION
${${
pkg_name
}
_SOURCE_DIR
}
)
endif
()
if
(
${
pkg_name
}
_SOURCE_DIR
)
if
(
PKG_HEAD_ONLY
)
file
(
GLOB
${
pkg_name
}
_SOURCE_SUBDIRS
${${
pkg_name
}
_SOURCE_DIR
}
/*
)
...
...
mindspore/ccsrc/CMakeLists.txt
浏览文件 @
08968c27
...
...
@@ -394,117 +394,6 @@ if(USE_GLOG)
target_link_libraries
(
_c_expression PRIVATE mindspore::glog
)
endif
()
if
(
ENABLE_GPU
)
execute_process
(
COMMAND bash
${
CMAKE_SOURCE_DIR
}
/third_party/apply_patches.sh
${
CMAKE_BINARY_DIR
}
${
dlpack_DIRPATH
}
${
dmlc_core_DIRPATH
}
${
rang_DIRPATH
}
${
incubator_tvm_gpu_DIRPATH
}
)
set
(
TVM_DIR
"
${
CMAKE_BINARY_DIR
}
/incubator-tvm"
)
# Utility functions
include
(
${
TVM_DIR
}
/cmake/util/Util.cmake
)
include
(
${
TVM_DIR
}
/cmake/util/FindCUDA.cmake
)
# include directories
include_directories
(
AFTER
"
${
TVM_DIR
}
/include"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/src"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/src/schedule"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/dmlc-core/include"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/dlpack/include"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/compiler-rt"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/rang/include"
)
# lib contain dlopen and dlclose
set
(
TVM_RUNTIME_LINKER_LIBS
${
CMAKE_DL_LIBS
}
)
# add source group
file
(
GLOB_RECURSE GROUP_SOURCE
"
${
TVM_DIR
}
/src/*.cc"
"src/*.cc"
)
file
(
GLOB_RECURSE GROUP_INCLUDE
"
${
TVM_DIR
}
/src/*.h"
"
${
TVM_DIR
}
/include/*.h"
"src/*.h"
"include/*.h"
)
assign_source_group
(
"Source"
${
GROUP_SOURCE
}
)
assign_source_group
(
"Include"
${
GROUP_INCLUDE
}
)
file
(
GLOB COMPILER_SRCS
"pre_activate/gpu/*.cc"
${
TVM_DIR
}
/src/api/*.cc
${
TVM_DIR
}
/src/arithmetic/*.cc
${
TVM_DIR
}
/src/autotvm/*.cc
${
TVM_DIR
}
/src/codegen/*.cc
${
TVM_DIR
}
/src/lang/*.cc
${
TVM_DIR
}
/src/pass/*.cc
${
TVM_DIR
}
/src/op/*.cc
${
TVM_DIR
}
/src/node/*.cc
${
TVM_DIR
}
/src/schedule/*.cc
${
TVM_DIR
}
/src/runtime/*.cc
${
TVM_DIR
}
/src/runtime/vm/*.cc
${
TVM_DIR
}
/src/runtime/vm/profiler/*.cc
${
TVM_DIR
}
/src/codegen/stackvm/*.cc
)
file
(
GLOB_RECURSE RELAY_SRCS
${
TVM_DIR
}
/src/relay/*.cc
)
list
(
APPEND COMPILER_SRCS
${
RELAY_SRCS
}
)
file
(
GLOB DATATYPE_SRCS
${
TVM_DIR
}
/src/codegen/datatype/*.cc
)
list
(
APPEND COMPILER_SRCS
${
DATATYPE_SRCS
}
)
file
(
GLOB COMPILER_VERILOG_SRCS
${
TVM_DIR
}
/src/codegen/verilog/*.cc
)
list
(
APPEND COMPILER_SRCS
${
COMPILER_VERILOG_SRCS
}
)
file
(
GLOB TOPI_SRCS
${
TVM_DIR
}
/topi/src/*.cc
)
file
(
GLOB RUNTIME_SRCS
${
TVM_DIR
}
/src/runtime/*.cc
${
TVM_DIR
}
/src/runtime/vm/*.cc
${
TVM_DIR
}
/src/runtime/stub/*.cc
${
TVM_DIR
}
/src/runtime/stackvm/*.cc
)
file
(
GLOB COMPILER_OFF_SRCS
${
TVM_DIR
}
/src/codegen/opt/build_*_off.cc
)
set
(
USE_CUDA
"OFF"
)
if
(
ENABLE_GPU
)
list
(
REMOVE_ITEM COMPILER_OFF_SRCS
${
TVM_DIR
}
/src/codegen/opt/build_cuda_off.cc
)
set
(
USE_CUDA
"ON"
)
endif
()
list
(
APPEND COMPILER_SRCS
${
COMPILER_OFF_SRCS
}
)
# Module rules
include
(
${
TVM_DIR
}
/cmake/modules/CUDA.cmake
)
set
(
CMAKE_C_FLAGS_AKG -pipe -Wall -fPIC -fstack-protector-all
)
set
(
CMAKE_C_FLAGS_AKG
${
CMAKE_C_FLAGS_AKG
}
-Wl,-z,relro,-z,now,-z,noexecstack
)
set
(
CMAKE_CXX_FLAGS_AKG -std=c++11 -pipe -Wall -fPIC -fstack-protector-all
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-Wl,-z,relro,-z,now,-z,noexecstack
)
if
(
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Debug"
)
message
(
"-- Build in Debug mode"
)
set
(
CMAKE_C_FLAGS_AKG
${
CMAKE_C_FLAGS_AKG
}
-O0 -g -rdynamic
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-O0 -g -rdynamic
)
else
()
message
(
"-- Build in Release mode"
)
set
(
CMAKE_C_FLAGS_AKG
${
CMAKE_C_FLAGS_AKG
}
-O2 -Werror
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-O2 -Werror
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
AND CMAKE_CXX_COMPILER_VERSION
VERSION_GREATER 7.0
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-faligned-new
)
endif
()
add_library
(
akg OBJECT
${
COMPILER_SRCS
}
${
RUNTIME_SRCS
}
${
TOPI_SRCS
}
)
target_link_libraries
(
akg
${
TVM_LINKER_LIBS
}
${
TVM_RUNTIME_LINKER_LIBS
}
)
target_compile_options
(
akg PRIVATE
$<$<COMPILE_LANGUAGE:C>:
${
CMAKE_C_FLAGS_AKG
}
>
$<$<COMPILE_LANGUAGE:CXX>:
${
CMAKE_CXX_FLAGS_AKG
}
>
)
target_include_directories
(
akg PRIVATE
"
${
TVM_DIR
}
/topi/include"
)
add_dependencies
(
_c_expression akg
)
target_link_libraries
(
_c_expression PRIVATE akg
)
endif
()
if
(
ENABLE_DUMP_PROTO
)
target_link_libraries
(
_c_expression PRIVATE mindspore::protobuf
)
endif
()
...
...
third_party/patch/incubator-tvm/CMakeLists.txt
0 → 100644
浏览文件 @
08968c27
cmake_minimum_required
(
VERSION 3.2
)
project
(
tvm C CXX
)
set
(
TVM_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
# Utility functions
include
(
${
TVM_DIR
}
/cmake/util/Util.cmake
)
include
(
${
TVM_DIR
}
/cmake/util/FindCUDA.cmake
)
# include directories
include_directories
(
AFTER
"
${
TVM_DIR
}
/include"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/src"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/src/schedule"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/dmlc-core/include"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/dlpack/include"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/compiler-rt"
)
include_directories
(
AFTER
"
${
TVM_DIR
}
/3rdparty/rang/include"
)
# lib contain dlopen and dlclose
set
(
TVM_RUNTIME_LINKER_LIBS
${
CMAKE_DL_LIBS
}
)
# add source group
file
(
GLOB_RECURSE GROUP_SOURCE
"
${
TVM_DIR
}
/src/*.cc"
"src/*.cc"
)
file
(
GLOB_RECURSE GROUP_INCLUDE
"
${
TVM_DIR
}
/src/*.h"
"
${
TVM_DIR
}
/include/*.h"
"src/*.h"
"include/*.h"
)
assign_source_group
(
"Source"
${
GROUP_SOURCE
}
)
assign_source_group
(
"Include"
${
GROUP_INCLUDE
}
)
file
(
GLOB COMPILER_SRCS
"pre_activate/gpu/*.cc"
${
TVM_DIR
}
/src/api/*.cc
${
TVM_DIR
}
/src/arithmetic/*.cc
${
TVM_DIR
}
/src/autotvm/*.cc
${
TVM_DIR
}
/src/codegen/*.cc
${
TVM_DIR
}
/src/lang/*.cc
${
TVM_DIR
}
/src/pass/*.cc
${
TVM_DIR
}
/src/op/*.cc
${
TVM_DIR
}
/src/node/*.cc
${
TVM_DIR
}
/src/schedule/*.cc
${
TVM_DIR
}
/src/runtime/*.cc
${
TVM_DIR
}
/src/runtime/vm/*.cc
${
TVM_DIR
}
/src/runtime/vm/profiler/*.cc
${
TVM_DIR
}
/src/codegen/stackvm/*.cc
)
file
(
GLOB_RECURSE RELAY_SRCS
${
TVM_DIR
}
/src/relay/*.cc
)
list
(
APPEND COMPILER_SRCS
${
RELAY_SRCS
}
)
file
(
GLOB DATATYPE_SRCS
${
TVM_DIR
}
/src/codegen/datatype/*.cc
)
list
(
APPEND COMPILER_SRCS
${
DATATYPE_SRCS
}
)
file
(
GLOB COMPILER_VERILOG_SRCS
${
TVM_DIR
}
/src/codegen/verilog/*.cc
)
list
(
APPEND COMPILER_SRCS
${
COMPILER_VERILOG_SRCS
}
)
file
(
GLOB TOPI_SRCS
${
TVM_DIR
}
/topi/src/*.cc
)
file
(
GLOB RUNTIME_SRCS
${
TVM_DIR
}
/src/runtime/*.cc
${
TVM_DIR
}
/src/runtime/vm/*.cc
${
TVM_DIR
}
/src/runtime/stub/*.cc
${
TVM_DIR
}
/src/runtime/stackvm/*.cc
)
file
(
GLOB COMPILER_OFF_SRCS
${
TVM_DIR
}
/src/codegen/opt/build_*_off.cc
)
list
(
REMOVE_ITEM COMPILER_OFF_SRCS
${
TVM_DIR
}
/src/codegen/opt/build_cuda_off.cc
)
set
(
USE_CUDA
"ON"
)
list
(
APPEND COMPILER_SRCS
${
COMPILER_OFF_SRCS
}
)
# Module rules
include
(
${
TVM_DIR
}
/cmake/modules/CUDA.cmake
)
set
(
CMAKE_C_FLAGS_AKG -pipe -Wall -fPIC -fstack-protector-all
)
set
(
CMAKE_C_FLAGS_AKG
${
CMAKE_C_FLAGS_AKG
}
-Wl,-z,relro,-z,now,-z,noexecstack
)
set
(
CMAKE_CXX_FLAGS_AKG -std=c++11 -pipe -Wall -fPIC -fstack-protector-all
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-Wl,-z,relro,-z,now,-z,noexecstack
)
if
(
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Debug"
)
message
(
"-- Build in Debug mode"
)
set
(
CMAKE_C_FLAGS_AKG
${
CMAKE_C_FLAGS_AKG
}
-O0 -g -rdynamic
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-O0 -g -rdynamic
)
else
()
message
(
"-- Build in Release mode"
)
set
(
CMAKE_C_FLAGS_AKG
${
CMAKE_C_FLAGS_AKG
}
-O2 -Werror
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-O2 -Werror
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
AND CMAKE_CXX_COMPILER_VERSION
VERSION_GREATER 7.0
)
set
(
CMAKE_CXX_FLAGS_AKG
${
CMAKE_CXX_FLAGS_AKG
}
-faligned-new
)
endif
()
add_library
(
tvm SHARED
${
COMPILER_SRCS
}
${
RUNTIME_SRCS
}
${
TOPI_SRCS
}
)
target_link_libraries
(
tvm
${
TVM_LINKER_LIBS
}
${
TVM_RUNTIME_LINKER_LIBS
}
)
target_compile_options
(
tvm PRIVATE
$<$<COMPILE_LANGUAGE:C>:
${
CMAKE_C_FLAGS_AKG
}
>
$<$<COMPILE_LANGUAGE:CXX>:
${
CMAKE_CXX_FLAGS_AKG
}
>
)
target_include_directories
(
tvm PRIVATE
"
${
TVM_DIR
}
/topi/include"
)
install
(
TARGETS tvm
)
\ No newline at end of file
third_party/patch/incubator-tvm/find_library.patch
浏览文件 @
08968c27
...
...
@@ -18,11 +18,11 @@
- lib_path = libinfo.find_lib_path()
+ """Load library by searching possible path."""
+ pwd = os.path.dirname(os.path.realpath(__file__))
+ path = os.path.realpath(pwd+"/../../../mindspore")
+ path = os.path.realpath(pwd+"/../../../mindspore
/lib
")
+ lib_path = []
+ files = os.listdir(path)
+ for f in files:
+ if f.startswith("
_c_expression
.") and f.endswith(".so"):
+ if f.startswith("
libtvm
.") and f.endswith(".so"):
+ lib_path.append(path+"/"+f)
+ break
+ if not lib_path:
...
...
@@ -56,11 +56,11 @@ diff -Npur tvm/topi/python/topi/cpp/impl.py tvm_new/topi/python/topi/cpp/impl.py
- return None, None
+ """Load library by searching possible path."""
+ pwd = os.path.dirname(os.path.realpath(__file__))
+ path = os.path.realpath(pwd+"/../../../mindspore")
+ path = os.path.realpath(pwd+"/../../../mindspore
/lib
")
+ lib_path = []
+ files = os.listdir(path)
+ for f in files:
+ if f.startswith("
_c_expression
.") and f.endswith(".so"):
+ if f.startswith("
libtvm
.") and f.endswith(".so"):
+ lib_path.append(path+"/"+f)
+ break
+ if not lib_path:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录