Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
e4d9989a
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看板
提交
e4d9989a
编写于
2月 08, 2018
作者:
L
Liu Yiqun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify the cmake of inference.
上级
b1869f16
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
24 addition
and
25 deletion
+24
-25
cmake/generic.cmake
cmake/generic.cmake
+9
-5
paddle/inference/CMakeLists.txt
paddle/inference/CMakeLists.txt
+5
-10
paddle/inference/tests/book/CMakeLists.txt
paddle/inference/tests/book/CMakeLists.txt
+10
-10
未找到文件。
cmake/generic.cmake
浏览文件 @
e4d9989a
...
...
@@ -179,20 +179,24 @@ function(cc_library TARGET_NAME)
set
(
oneValueArgs
""
)
set
(
multiValueArgs SRCS DEPS
)
cmake_parse_arguments
(
cc_library
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
if
(
cc_library_SRCS
)
if
(
cc_library_SHARED OR cc_library_shared
)
# build *.so
if
(
cc_library_SRCS
)
if
(
cc_library_SHARED OR cc_library_shared
)
# build *.so
add_library
(
${
TARGET_NAME
}
SHARED
${
cc_library_SRCS
}
)
else
()
add_library
(
${
TARGET_NAME
}
STATIC
${
cc_library_SRCS
}
)
endif
()
if
(
cc_library_DEPS
)
if
(
cc_library_DEPS
)
# Don't need link libwarpctc.so
if
(
"
${
cc_library_DEPS
}
;"
MATCHES
"warpctc;"
)
if
(
"
${
cc_library_DEPS
}
;"
MATCHES
"warpctc;"
)
list
(
REMOVE_ITEM cc_library_DEPS warpctc
)
add_dependencies
(
${
TARGET_NAME
}
warpctc
)
endif
()
# Support linking flags: --whole-archive (Linux) / -force_load (MacOS)
target_circle_link_libraries
(
${
TARGET_NAME
}
${
cc_library_DEPS
}
)
if
(
"
${
cc_library_DEPS
}
"
MATCHES
"ARCHIVE_START"
)
list
(
REMOVE_ITEM cc_library_DEPS ARCHIVE_START ARCHIVE_END
)
endif
()
add_dependencies
(
${
TARGET_NAME
}
${
cc_library_DEPS
}
)
target_link_libraries
(
${
TARGET_NAME
}
${
cc_library_DEPS
}
)
endif
()
# cpplint code style
...
...
paddle/inference/CMakeLists.txt
浏览文件 @
e4d9989a
...
...
@@ -4,19 +4,14 @@ cc_library(paddle_fluid_api
SRCS io.cc
DEPS
${
FLUID_CORE_MODULES
}
${
GLOB_OP_LIB
}
)
#
Merge all modules into a singl
e static library
#
Creat
e static library
cc_library
(
paddle_fluid DEPS paddle_fluid_api
${
FLUID_CORE_MODULES
}
${
GLOB_OP_LIB
}
)
# Create shared library
add_library
(
paddle_fluid_shared SHARED io.cc
)
target_circle_link_libraries
(
paddle_fluid_shared
ARCHIVE_START
${
GLOB_OP_LIB
}
${
FLUID_CORE_MODULES
}
ARCHIVE_END
)
SET_TARGET_PROPERTIES
(
paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid
)
cc_library
(
paddle_fluid_shared SHARED
SRCS io.cc
DEPS ARCHIVE_START
${
GLOB_OP_LIB
}
${
FLUID_CORE_MODULES
}
ARCHIVE_END
)
set_target_properties
(
paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid
)
if
(
WITH_TESTING
)
add_subdirectory
(
tests/book
)
...
...
paddle/inference/tests/book/CMakeLists.txt
浏览文件 @
e4d9989a
...
...
@@ -5,23 +5,23 @@ function(inference_test TARGET_NAME)
cmake_parse_arguments
(
inference_test
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
set
(
PYTHON_TESTS_DIR
${
PADDLE_SOURCE_DIR
}
/python/paddle/v2/fluid/tests
)
set
(
arg_list
""
)
if
(
inference_test_ARGS
)
foreach
(
arg
${
inference_test_ARGS
}
)
cc_test
(
test_inference_
${
TARGET_NAME
}
_
${
arg
}
SRCS test_inference_
${
TARGET_NAME
}
.cc
DEPS ARCHIVE_START paddle_fluid ARCHIVE_END
ARGS --dirname=
${
PYTHON_TESTS_DIR
}
/book/
${
TARGET_NAME
}
_
${
arg
}
.inference.model
)
set_tests_properties
(
test_inference_
${
TARGET_NAME
}
_
${
arg
}
PROPERTIES DEPENDS test_
${
TARGET_NAME
}
)
list
(
APPEND arg_list
"_
${
arg
}
"
)
endforeach
()
else
()
cc_test
(
test_inference_
${
TARGET_NAME
}
list
(
APPEND arg_list
"_"
)
endif
()
foreach
(
arg
${
arg_list
}
)
string
(
REGEX REPLACE
"^_$"
""
arg
"
${
arg
}
"
)
cc_test
(
test_inference_
${
TARGET_NAME
}${
arg
}
SRCS test_inference_
${
TARGET_NAME
}
.cc
DEPS ARCHIVE_START paddle_fluid ARCHIVE_END
ARGS --dirname=
${
PYTHON_TESTS_DIR
}
/book/
${
TARGET_NAME
}
.inference.model
)
set_tests_properties
(
test_inference_
${
TARGET_NAME
}
ARGS --dirname=
${
PYTHON_TESTS_DIR
}
/book/
${
TARGET_NAME
}
${
arg
}
.inference.model
)
set_tests_properties
(
test_inference_
${
TARGET_NAME
}
${
arg
}
PROPERTIES DEPENDS test_
${
TARGET_NAME
}
)
end
if
()
end
foreach
()
endfunction
(
inference_test
)
inference_test
(
recognize_digits ARGS mlp
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录