Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
正统之独孤求败
mindspore
提交
320d3315
M
mindspore
项目概览
正统之独孤求败
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
320d3315
编写于
8月 05, 2020
作者:
H
hangq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add -e gpu & add -DBUILD_MINDDATA
上级
34214e8f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
8 deletion
+19
-8
build.sh
build.sh
+18
-7
mindspore/lite/CMakeLists.txt
mindspore/lite/CMakeLists.txt
+1
-1
未找到文件。
build.sh
浏览文件 @
320d3315
...
@@ -26,7 +26,7 @@ usage()
...
@@ -26,7 +26,7 @@ usage()
echo
"bash build.sh [-d] [-r] [-v] [-c on|off] [-t on|off] [-g on|off] [-h] [-b ge] [-m infer|train]
\\
"
echo
"bash build.sh [-d] [-r] [-v] [-c on|off] [-t on|off] [-g on|off] [-h] [-b ge] [-m infer|train]
\\
"
echo
" [-a on|off] [-Q on|off] [-p on|off] [-i] [-L] [-R] [-D on|off] [-j[n]] [-e gpu|d|cpu]
\\
"
echo
" [-a on|off] [-Q on|off] [-p on|off] [-i] [-L] [-R] [-D on|off] [-j[n]] [-e gpu|d|cpu]
\\
"
echo
" [-P on|off] [-z [on|off]] [-M on|off] [-V 9.2|10.1] [-I arm64|arm32|x86_64] [-K]
\\
"
echo
" [-P on|off] [-z [on|off]] [-M on|off] [-V 9.2|10.1] [-I arm64|arm32|x86_64] [-K]
\\
"
echo
" [-B on|off] [-w on|off] [-E] [-l on|off]"
echo
" [-B on|off] [-w on|off] [-E] [-l on|off]
[-n]
"
echo
""
echo
""
echo
"Options:"
echo
"Options:"
echo
" -d Debug mode"
echo
" -d Debug mode"
...
@@ -50,6 +50,7 @@ usage()
...
@@ -50,6 +50,7 @@ usage()
echo
" -Q Enable dump memory, default off"
echo
" -Q Enable dump memory, default off"
echo
" -D Enable dumping of function graph ir, default on"
echo
" -D Enable dumping of function graph ir, default on"
echo
" -z Compile dataset & mindrecord, default on"
echo
" -z Compile dataset & mindrecord, default on"
echo
" -n Compile minddata lite"
echo
" -M Enable MPI and NCCL for GPU training, gpu default on"
echo
" -M Enable MPI and NCCL for GPU training, gpu default on"
echo
" -V Specify the minimum required cuda version, default CUDA 10.1"
echo
" -V Specify the minimum required cuda version, default CUDA 10.1"
echo
" -I Compile lite"
echo
" -I Compile lite"
...
@@ -92,6 +93,7 @@ checkopts()
...
@@ -92,6 +93,7 @@ checkopts()
ENABLE_DUMPE2E
=
"off"
ENABLE_DUMPE2E
=
"off"
ENABLE_DUMP_IR
=
"on"
ENABLE_DUMP_IR
=
"on"
COMPILE_MINDDATA
=
"on"
COMPILE_MINDDATA
=
"on"
COMPILE_MINDDATA_LITE
=
"off"
ENABLE_MPI
=
"off"
ENABLE_MPI
=
"off"
CUDA_VERSION
=
"10.1"
CUDA_VERSION
=
"10.1"
COMPILE_LITE
=
"off"
COMPILE_LITE
=
"off"
...
@@ -104,15 +106,19 @@ checkopts()
...
@@ -104,15 +106,19 @@ checkopts()
ENABLE_DEBUGGER
=
"off"
ENABLE_DEBUGGER
=
"off"
ENABLE_IBVERBS
=
"off"
ENABLE_IBVERBS
=
"off"
ENABLE_PYTHON
=
"on"
ENABLE_PYTHON
=
"on"
ENABLE_GPU
=
"off"
# Process the options
# Process the options
while
getopts
'drvj:c:t:hsb:a:g:p:ie:m:l:I:LRP:Q:D:zM:V:K:swB:E'
opt
while
getopts
'drvj:c:t:hsb:a:g:p:ie:m:l:I:LRP:Q:D:zM:V:K:swB:E
n
'
opt
do
do
OPTARG
=
$(
echo
${
OPTARG
}
|
tr
'[A-Z]'
'[a-z]'
)
OPTARG
=
$(
echo
${
OPTARG
}
|
tr
'[A-Z]'
'[a-z]'
)
case
"
${
opt
}
"
in
case
"
${
opt
}
"
in
d
)
d
)
DEBUG_MODE
=
"on"
DEBUG_MODE
=
"on"
;;
;;
n
)
COMPILE_MINDDATA_LITE
=
"on"
;;
r
)
r
)
DEBUG_MODE
=
"off"
DEBUG_MODE
=
"off"
;;
;;
...
@@ -567,7 +573,7 @@ build_lite()
...
@@ -567,7 +573,7 @@ build_lite()
{
{
echo
"start build mindspore lite project"
echo
"start build mindspore lite project"
if
[
"
${
ENABLE_GPU
}
"
==
"on"
]
||
[
"
${
LITE_PLATFORM
}
"
==
"arm64"
]
;
then
if
[
"
${
ENABLE_GPU
}
"
==
"on"
]
&&
[
"
${
LITE_PLATFORM
}
"
==
"arm64"
]
;
then
echo
"start build opencl"
echo
"start build opencl"
build_opencl
build_opencl
fi
fi
...
@@ -577,7 +583,9 @@ build_lite()
...
@@ -577,7 +583,9 @@ build_lite()
build_flatbuffer
build_flatbuffer
build_gtest
build_gtest
build_minddata_lite_deps
if
[
"
${
COMPILE_MINDDATA_LITE
}
"
==
"on"
]
;
then
build_minddata_lite_deps
fi
cd
"
${
BASEPATH
}
/mindspore/lite"
cd
"
${
BASEPATH
}
/mindspore/lite"
if
[[
"
${
INC_BUILD
}
"
==
"off"
]]
;
then
if
[[
"
${
INC_BUILD
}
"
==
"off"
]]
;
then
...
@@ -596,17 +604,20 @@ build_lite()
...
@@ -596,17 +604,20 @@ build_lite()
-DANDROID_NDK
=
"
${
ANDROID_NDK
}
"
-DANDROID_ABI
=
"arm64-v8a"
-DANDROID_TOOLCHAIN_NAME
=
"aarch64-linux-android-clang"
\
-DANDROID_NDK
=
"
${
ANDROID_NDK
}
"
-DANDROID_ABI
=
"arm64-v8a"
-DANDROID_TOOLCHAIN_NAME
=
"aarch64-linux-android-clang"
\
-DANDROID_STL
=
"c++_shared"
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
-DSUPPORT_TRAIN
=
${
SUPPORT_TRAIN
}
\
-DANDROID_STL
=
"c++_shared"
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
-DSUPPORT_TRAIN
=
${
SUPPORT_TRAIN
}
\
-DBUILD_DEVICE
=
on
-DPLATFORM_ARM64
=
on
-DBUILD_CONVERTER
=
off
-DENABLE_NEON
=
on
-DENABLE_FP16
=
"off"
\
-DBUILD_DEVICE
=
on
-DPLATFORM_ARM64
=
on
-DBUILD_CONVERTER
=
off
-DENABLE_NEON
=
on
-DENABLE_FP16
=
"off"
\
-DSUPPORT_GPU
=
on
-DOFFLINE_COMPILE
=
${
OPENCL_OFFLINE_COMPILE
}
"
${
BASEPATH
}
/mindspore/lite"
-DSUPPORT_GPU
=
${
ENABLE_GPU
}
-DOFFLINE_COMPILE
=
${
OPENCL_OFFLINE_COMPILE
}
-DBUILD_MINDDATA
=
${
COMPILE_MINDDATA_LITE
}
\
"
${
BASEPATH
}
/mindspore/lite"
elif
[[
"
${
LITE_PLATFORM
}
"
==
"arm32"
]]
;
then
elif
[[
"
${
LITE_PLATFORM
}
"
==
"arm32"
]]
;
then
checkndk
checkndk
cmake
-DCMAKE_TOOLCHAIN_FILE
=
"
${
ANDROID_NDK
}
/build/cmake/android.toolchain.cmake"
-DANDROID_NATIVE_API_LEVEL
=
"19"
\
cmake
-DCMAKE_TOOLCHAIN_FILE
=
"
${
ANDROID_NDK
}
/build/cmake/android.toolchain.cmake"
-DANDROID_NATIVE_API_LEVEL
=
"19"
\
-DANDROID_NDK
=
"
${
ANDROID_NDK
}
"
-DANDROID_ABI
=
"armeabi-v7a"
-DANDROID_TOOLCHAIN_NAME
=
"clang"
\
-DANDROID_NDK
=
"
${
ANDROID_NDK
}
"
-DANDROID_ABI
=
"armeabi-v7a"
-DANDROID_TOOLCHAIN_NAME
=
"clang"
\
-DANDROID_STL
=
"c++_shared"
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
\
-DANDROID_STL
=
"c++_shared"
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
\
-DBUILD_DEVICE
=
on
-DPLATFORM_ARM32
=
on
-DENABLE_NEON
=
on
-DSUPPORT_TRAIN
=
${
SUPPORT_TRAIN
}
-DBUILD_CONVERTER
=
off
\
-DBUILD_DEVICE
=
on
-DPLATFORM_ARM32
=
on
-DENABLE_NEON
=
on
-DSUPPORT_TRAIN
=
${
SUPPORT_TRAIN
}
-DBUILD_CONVERTER
=
off
\
-DSUPPORT_GPU
=
${
ENABLE_GPU
}
-DOFFLINE_COMPILE
=
${
OPENCL_OFFLINE_COMPILE
}
"
${
BASEPATH
}
/mindspore/lite"
-DSUPPORT_GPU
=
${
ENABLE_GPU
}
-DOFFLINE_COMPILE
=
${
OPENCL_OFFLINE_COMPILE
}
-DBUILD_MINDDATA
=
${
COMPILE_MINDDATA_LITE
}
\
"
${
BASEPATH
}
/mindspore/lite"
else
else
cmake
-DBUILD_DEVICE
=
on
-DPLATFORM_ARM64
=
off
-DBUILD_CONVERTER
=
${
ENABLE_CONVERTER
}
-DSUPPORT_TRAIN
=
${
SUPPORT_TRAIN
}
\
cmake
-DBUILD_DEVICE
=
on
-DPLATFORM_ARM64
=
off
-DBUILD_CONVERTER
=
${
ENABLE_CONVERTER
}
-DSUPPORT_TRAIN
=
${
SUPPORT_TRAIN
}
\
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
-DSUPPORT_GPU
=
${
ENABLE_GPU
}
-DOFFLINE_COMPILE
=
${
OPENCL_OFFLINE_COMPILE
}
"
${
BASEPATH
}
/mindspore/lite"
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
-DSUPPORT_GPU
=
${
ENABLE_GPU
}
-DBUILD_MINDDATA
=
${
COMPILE_MINDDATA_LITE
}
\
-DOFFLINE_COMPILE
=
${
OPENCL_OFFLINE_COMPILE
}
"
${
BASEPATH
}
/mindspore/lite"
fi
fi
VERBOSE
=
2 make
-j
$THREAD_NUM
VERBOSE
=
2 make
-j
$THREAD_NUM
COMPILE_RET
=
$?
COMPILE_RET
=
$?
...
...
mindspore/lite/CMakeLists.txt
浏览文件 @
320d3315
...
@@ -33,7 +33,7 @@ option(BUILD_CONVERTER "if build converter" on)
...
@@ -33,7 +33,7 @@ option(BUILD_CONVERTER "if build converter" on)
option
(
ENABLE_FP16
"if build fp16 ops"
off
)
option
(
ENABLE_FP16
"if build fp16 ops"
off
)
option
(
SUPPORT_GPU
"if support gpu"
off
)
option
(
SUPPORT_GPU
"if support gpu"
off
)
option
(
OFFLINE_COMPILE
"if offline compile OpenCL kernel"
off
)
option
(
OFFLINE_COMPILE
"if offline compile OpenCL kernel"
off
)
option
(
BUILD_MINDDATA
""
o
n
)
option
(
BUILD_MINDDATA
""
o
ff
)
if
(
BUILD_DEVICE
)
if
(
BUILD_DEVICE
)
add_compile_definitions
(
BUILD_DEVICE
)
add_compile_definitions
(
BUILD_DEVICE
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录