Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
d0386c7b
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d0386c7b
编写于
6月 28, 2019
作者:
Z
Zhen Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use separated CI functions for OpenCL. test=develop
上级
2eadbf9a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
87 addition
and
49 deletion
+87
-49
.gitlab-ci.yml
.gitlab-ci.yml
+2
-2
paddle/fluid/lite/tools/build.sh
paddle/fluid/lite/tools/build.sh
+85
-47
未找到文件。
.gitlab-ci.yml
浏览文件 @
d0386c7b
...
...
@@ -95,8 +95,8 @@ build:mobile_android_cl:
cache
:
key
:
mobile_thirdparty
paths
:
-
build.lite.android.armv8.gcc.
cl_enable
/third_party
-
build.lite.android.armv7.gcc.
cl_enable
/third_party
-
build.lite.android.armv8.gcc.
opencl
/third_party
-
build.lite.android.armv7.gcc.
opencl
/third_party
-
~/.ccache
-
$CI_PROJECT_DIR/build_mobile_ccache_cl
script
:
...
...
paddle/fluid/lite/tools/build.sh
浏览文件 @
d0386c7b
...
...
@@ -33,6 +33,65 @@ function cmake_x86 {
cmake ..
-DWITH_GPU
=
OFF
-DWITH_MKLDNN
=
OFF
-DLITE_WITH_X86
=
ON
${
common_flags
}
}
function
cmake_opencl
{
prepare_workspace
# $1: ARM_TARGET_OS in "android" , "armlinux"
# $2: ARM_TARGET_ARCH_ABI in "armv8", "armv7" ,"armv7hf"
# $3: ARM_TARGET_LANG in "gcc" "clang"
cmake ..
\
-DLITE_WITH_OPENCL
=
ON
\
-DWITH_GPU
=
OFF
\
-DWITH_MKL
=
OFF
\
-DWITH_LITE
=
ON
\
-DLITE_WITH_CUDA
=
OFF
\
-DLITE_WITH_X86
=
OFF
\
-DLITE_WITH_ARM
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
ON
\
-DARM_TARGET_OS
=
$1
-DARM_TARGET_ARCH_ABI
=
$2
-DARM_TARGET_LANG
=
$3
}
# $1: ARM_TARGET_OS in "android" , "armlinux"
# $2: ARM_TARGET_ARCH_ABI in "armv8", "armv7" ,"armv7hf"
# $3: ARM_TARGET_LANG in "gcc" "clang"
function
build_opencl
{
os
=
$1
abi
=
$2
lang
=
$3
cur_dir
=
$(
pwd
)
if
[[
${
os
}
==
"armlinux"
]]
;
then
# TODO(hongming): enable compile armv7 and armv7hf on armlinux, and clang compile
if
[[
${
lang
}
==
"clang"
]]
;
then
echo
"clang is not enabled on armlinux yet"
return
0
fi
if
[[
${
abi
}
==
"armv7hf"
]]
;
then
echo
"armv7hf is not supported on armlinux yet"
return
0
fi
if
[[
${
abi
}
==
"armv7"
]]
;
then
echo
"armv7 is not supported on armlinux yet"
return
0
fi
fi
if
[[
${
os
}
==
"android"
&&
${
abi
}
==
"armv7hf"
]]
;
then
echo
"android do not need armv7hf"
return
0
fi
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
.opencl
mkdir
-p
$build_dir
cd
$build_dir
cmake_opencl
${
os
}
${
abi
}
${
lang
}
build
$TESTS_FILE
# test publish inference lib
make publish_inference_lite
}
# This method is only called in CI.
function
cmake_x86_for_CI
{
prepare_workspace
# fake an empty __generated_code__.cc to pass cmake.
...
...
@@ -204,48 +263,25 @@ function cmake_arm {
# $1: ARM_TARGET_OS in "android" , "armlinux"
# $2: ARM_TARGET_ARCH_ABI in "armv8", "armv7" ,"armv7hf"
# $3: ARM_TARGET_LANG in "gcc" "clang"
# $4: LITE_WITH_OPENCL in ON OFF
os
=
$1
abi
=
$2
lang
=
$3
opencl
=
$4
if
[[
${
opencl
}
==
"cl_enable"
]]
;
then
echo
"-- Enable OpenCL --"
cmake ..
\
-DLITE_WITH_OPENCL
=
ON
\
-DWITH_GPU
=
OFF
\
-DWITH_MKL
=
OFF
\
-DWITH_LITE
=
ON
\
-DLITE_WITH_CUDA
=
OFF
\
-DLITE_WITH_X86
=
OFF
\
-DLITE_WITH_ARM
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
ON
\
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
else
cmake ..
\
-DWITH_GPU
=
OFF
\
-DWITH_MKL
=
OFF
\
-DWITH_LITE
=
ON
\
-DLITE_WITH_CUDA
=
OFF
\
-DLITE_WITH_X86
=
OFF
\
-DLITE_WITH_ARM
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
ON
\
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
fi
cmake ..
\
-DWITH_GPU
=
OFF
\
-DWITH_MKL
=
OFF
\
-DWITH_LITE
=
ON
\
-DLITE_WITH_CUDA
=
OFF
\
-DLITE_WITH_X86
=
OFF
\
-DLITE_WITH_ARM
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
ON
\
-DARM_TARGET_OS
=
$1
-DARM_TARGET_ARCH_ABI
=
$2
-DARM_TARGET_LANG
=
$3
}
# $1: ARM_TARGET_OS in "android" , "armlinux"
# $2: ARM_TARGET_ARCH_ABI in "armv8", "armv7" ,"armv7hf"
# $3: ARM_TARGET_LANG in "gcc" "clang"
# $4: LITE_WITH_OPENCL in ON OFF
function
build_arm
{
os
=
$1
abi
=
$2
lang
=
$3
opencl
=
$4
cur_dir
=
$(
pwd
)
if
[[
${
os
}
==
"armlinux"
]]
;
then
...
...
@@ -269,11 +305,11 @@ function build_arm {
return
0
fi
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
.
${
opencl
}
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
mkdir
-p
$build_dir
cd
$build_dir
cmake_arm
${
os
}
${
abi
}
${
lang
}
${
opencl
}
cmake_arm
${
os
}
${
abi
}
${
lang
}
build
$TESTS_FILE
# test publish inference lib
...
...
@@ -339,15 +375,14 @@ function arm_push_necessary_file {
function
build_test_arm_opencl
{
########################################################################
# job 1-4 must be in one runner
cur
=
$PWD
# job
5
build_
arm
"android"
"armv8"
"gcc"
"cl_enable
"
# job
1
build_
opencl
"android"
"armv8"
"gcc
"
cd
$cur
# job
6
build_
arm
"android"
"armv7"
"gcc"
"cl_enable
"
# job
2
build_
opencl
"android"
"armv7"
"gcc
"
cd
$cur
echo
"Done"
...
...
@@ -519,11 +554,6 @@ function main {
ARM_PORT
=
"
${
i
#*=
}
"
shift
;;
--opencl
=
*
)
OPENCL
=
"
${
i
#*=
}
"
shift
;;
build
)
build
$TESTS_FILE
build
$LIBS_FILE
...
...
@@ -537,16 +567,24 @@ function main {
cmake_x86
shift
;;
cmake_opencl
)
cmake_opencl
$ARM_OS
$ARM_ABI
$ARM_LANG
shift
;;
cmake_cuda
)
cmake_cuda
shift
;;
cmake_arm
)
cmake_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
$OPENCL
cmake_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
shift
;;
build_opencl
)
build_opencl
$ARM_OS
$ARM_ABI
$ARM_LANG
shift
;;
build_arm
)
build_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
$OPENCL
build_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
shift
;;
test_server
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录