Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
ec3b976d
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看板
提交
ec3b976d
编写于
6月 27, 2019
作者:
Z
ZhenWang
提交者:
Zhen Wang
6月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add opencl ci
上级
9708152e
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
94 addition
and
38 deletion
+94
-38
.gitlab-ci.yml
.gitlab-ci.yml
+19
-0
paddle/fluid/lite/api/CMakeLists.txt
paddle/fluid/lite/api/CMakeLists.txt
+7
-1
paddle/fluid/lite/core/CMakeLists.txt
paddle/fluid/lite/core/CMakeLists.txt
+1
-1
paddle/fluid/lite/tools/build.sh
paddle/fluid/lite/tools/build.sh
+65
-35
paddle/fluid/lite/tools/debug/CMakeLists.txt
paddle/fluid/lite/tools/debug/CMakeLists.txt
+2
-1
未找到文件。
.gitlab-ci.yml
浏览文件 @
ec3b976d
...
...
@@ -87,6 +87,25 @@ build:mobile_android:
dependencies
:
-
build:server
build:mobile_android_cl:
tags
:
-
lite
stage
:
build_mobile
image
:
$MOBILE_LITE_DOCKER_IMAGE
cache
:
key
:
mobile_thirdparty
paths
:
-
build.lite.android.armv8.gcc.cl_enable/third_party
-
build.lite.android.armv7.gcc.cl_enable/third_party
-
~/.ccache
-
$CI_PROJECT_DIR/build_mobile_ccache_cl
script
:
-
export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_ccache_cl
-
./paddle/fluid/lite/tools/build.sh build_test_arm_opencl
dependencies
:
-
build:server
build:mobile_armlinux:
tags
:
-
lite
...
...
paddle/fluid/lite/api/CMakeLists.txt
浏览文件 @
ec3b976d
...
...
@@ -97,10 +97,12 @@ endif()
# TODO(Superjomn) support latter.
lite_cc_test
(
test_light_api_lite SRCS light_api_test.cc
DEPS light_api_lite program_lite mir_passes
CL_DEPS
${
opencl_kernels
}
ARGS --optimized_model=
${
LITE_MODEL_DIR
}
/lite_naive_model_opt SERIAL
)
lite_cc_test
(
test_apis_lite SRCS apis_test.cc
DEPS cxx_api_lite light_api_lite
${
ops_lite
}
CL_DEPS
${
opencl_kernels
}
X86_DEPS
${
x86_kernels
}
operator
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/lite_naive_model
--optimized_model=
${
LITE_MODEL_DIR
}
/lite_naive_model_opt SERIAL
)
...
...
@@ -125,6 +127,7 @@ lite_cc_test(test_paddle_api_lite SRCS paddle_api_test.cc DEPS paddle_api_full p
${
ops_lite
}
ARM_DEPS
${
arm_kernels
}
X86_DEPS
${
x86_kernels
}
CL_DEPS
${
opencl_kernels
}
ARGS --model_dir=
${
LITE_MODEL_DIR
}
/lite_naive_model SERIAL
)
lite_cc_test
(
test_model_bin SRCS model_test.cc DEPS paddle_api_full paddle_api_light
...
...
@@ -152,5 +155,8 @@ lite_cc_binary(cxx_api_lite_bin SRCS cxx_api_bin_int8.cc
target_wrapper_host
mir_passes
${
ops_lite
}
${
host_kernels
}
CL_DEPS
${
opencl_kernels
}
ARM_DEPS
${
arm_kernels
}
)
lite_cc_binary
(
model_optimize_tool SRCS model_optimize_tool.cc DEPS paddle_api_full
)
lite_cc_binary
(
model_optimize_tool SRCS model_optimize_tool.cc
DEPS paddle_api_full
CL_DEPS
${
opencl_kernels
}
)
paddle/fluid/lite/core/CMakeLists.txt
浏览文件 @
ec3b976d
...
...
@@ -19,12 +19,12 @@ endif()
proto_library
(
framework_proto_lite SRCS framework.proto
)
lite_cc_library
(
kernel_lite SRCS kernel.cc DEPS type_system target_wrapper_lite any_lite op_params_lite framework_proto_lite
${
tensor_lite
}
)
lite_cc_library
(
variable_lite SRCS variable.cc
)
lite_cc_library
(
op_registry_lite SRCS op_registry.cc DEPS framework_proto_lite
)
lite_cc_library
(
scope_lite SRCS scope.cc DEPS
${
tensor_lite
}
)
lite_cc_library
(
cpu_info_lite SRCS cpu_info.cc
)
lite_cc_library
(
context_lite SRCS context.cc DEPS
${
tensor_lite
}
any_lite cpu_info_lite X86_DEPS eigen3 CL_DEPS cl_helper
)
lite_cc_library
(
kernel_lite SRCS kernel.cc DEPS context_lite type_system target_wrapper_lite any_lite op_params_lite framework_proto_lite
${
tensor_lite
}
)
lite_cc_library
(
op_lite SRCS op_lite.cc DEPS scope_lite op_registry_lite target_wrapper_lite kernel_lite
cpp_op_desc_lite
${
tensor_lite
}
)
lite_cc_library
(
types_lite SRCS types.cc
)
...
...
paddle/fluid/lite/tools/build.sh
浏览文件 @
ec3b976d
...
...
@@ -33,23 +33,6 @@ function cmake_x86 {
cmake ..
-DWITH_GPU
=
OFF
-DWITH_MKLDNN
=
OFF
-DLITE_WITH_X86
=
ON
${
common_flags
}
}
function
cmake_opencl
{
# $1: ARM_TARGET_OS in "android" , "armlinux"
# $2: ARM_TARGET_ARCH_ABI in "arm64-v8a", "armeabi-v7a" ,"armeabi-v7a-hf"
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
}
# This method is only called in CI.
function
cmake_x86_for_CI
{
prepare_workspace
# fake an empty __generated_code__.cc to pass cmake.
...
...
@@ -221,7 +204,16 @@ 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
\
...
...
@@ -230,16 +222,30 @@ function cmake_arm {
-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
-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
}
# $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
...
...
@@ -263,11 +269,11 @@ function build_arm {
return
0
fi
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
build_dir
=
$cur_dir
/build.lite.
${
os
}
.
${
abi
}
.
${
lang
}
.
${
opencl
}
mkdir
-p
$build_dir
cd
$build_dir
cmake_arm
${
os
}
${
abi
}
${
lang
}
cmake_arm
${
os
}
${
abi
}
${
lang
}
${
opencl
}
build
$TESTS_FILE
# test publish inference lib
...
...
@@ -331,6 +337,21 @@ function arm_push_necessary_file {
adb
-s
emulator-
${
port
}
push
${
testpath
}
${
adb_work_dir
}
}
function
build_test_arm_opencl
{
########################################################################
# job 1-4 must be in one runner
cur
=
$PWD
# job 5
build_arm
"android"
"armv8"
"gcc"
"cl_enable"
cd
$cur
# job 6
build_arm
"android"
"armv7"
"gcc"
"cl_enable"
cd
$cur
echo
"Done"
}
# We split the arm unittest into several sub-tasks to parallel and reduce the overall CI timetime.
# sub-task1
...
...
@@ -378,17 +399,17 @@ function build_test_arm_subtask_armlinux {
cur
=
$PWD
# job 5
build_arm
"armlinux"
"armv8"
"gcc"
$port_armv8
build_arm
"armlinux"
"armv8"
"gcc"
test_arm
"armlinux"
"armv8"
"gcc"
$port_armv8
cd
$cur
# job 6
build_arm
"armlinux"
"armv7"
"gcc"
$port_armv8
build_arm
"armlinux"
"armv7"
"gcc"
test_arm
"armlinux"
"armv7"
"gcc"
$port_armv8
cd
$cur
# job 7
build_arm
"armlinux"
"armv7hf"
"gcc"
$port_armv8
build_arm
"armlinux"
"armv7hf"
"gcc"
test_arm
"armlinux"
"armv7hf"
"gcc"
$port_armv8
cd
$cur
...
...
@@ -498,6 +519,11 @@ function main {
ARM_PORT
=
"
${
i
#*=
}
"
shift
;;
--opencl
=
*
)
OPENCL
=
"
${
i
#*=
}
"
shift
;;
build
)
build
$TESTS_FILE
build
$LIBS_FILE
...
...
@@ -520,11 +546,11 @@ function main {
shift
;;
cmake_arm
)
cmake_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
cmake_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
$OPENCL
shift
;;
build_arm
)
build_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
build_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
$OPENCL
shift
;;
test_server
)
...
...
@@ -532,7 +558,7 @@ function main {
shift
;;
test_arm
)
build
_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
$ARM_PORT
test
_arm
$ARM_OS
$ARM_ABI
$ARM_LANG
$ARM_PORT
shift
;;
test_arm_android
)
...
...
@@ -547,6 +573,10 @@ function main {
build_test_arm
shift
;;
build_test_arm_opencl
)
build_test_arm_opencl
shift
;;
build_test_arm_subtask_android
)
build_test_arm_subtask_android
shift
...
...
paddle/fluid/lite/tools/debug/CMakeLists.txt
浏览文件 @
ec3b976d
...
...
@@ -9,4 +9,5 @@ lite_cc_binary(lite_model_debug_tool SRCS model_debug_tool.cc
mir_passes
${
ops_lite
}
${
host_kernels
}
X86_DEPS
${
x86_kernels
}
ARM_DEPS
${
arm_kernels
}
)
ARM_DEPS
${
arm_kernels
}
CL_DEPS
${
opencl_kernels
}
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录