Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
c2289777
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
692
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c2289777
编写于
6月 27, 2018
作者:
Y
Yan Chunwei
提交者:
GitHub
6月 27, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add anakin release (#11747)
上级
f2459aaf
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
34 addition
and
17 deletion
+34
-17
cmake/external/anakin.cmake
cmake/external/anakin.cmake
+9
-7
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+21
-9
paddle/contrib/inference/CMakeLists.txt
paddle/contrib/inference/CMakeLists.txt
+4
-1
未找到文件。
cmake/external/anakin.cmake
浏览文件 @
c2289777
...
@@ -26,13 +26,15 @@ function(fetch_include_recursively root_dir)
...
@@ -26,13 +26,15 @@ function(fetch_include_recursively root_dir)
endforeach
()
endforeach
()
endfunction
()
endfunction
()
# download library
if
(
NOT EXISTS
"
${
ANAKIN_INSTALL_DIR
}
"
)
message
(
STATUS
"Download Anakin library from
${
ANAKIN_LIBRARY_URL
}
"
)
# download library
execute_process
(
COMMAND bash -c
"mkdir -p
${
ANAKIN_INSTALL_DIR
}
"
)
message
(
STATUS
"Download Anakin library from
${
ANAKIN_LIBRARY_URL
}
"
)
execute_process
(
COMMAND bash -c
"rm -rf
${
ANAKIN_INSTALL_DIR
}
/*"
)
execute_process
(
COMMAND bash -c
"mkdir -p
${
ANAKIN_INSTALL_DIR
}
"
)
execute_process
(
COMMAND bash -c
"cd
${
ANAKIN_INSTALL_DIR
}
; wget -q
${
ANAKIN_LIBRARY_URL
}
"
)
execute_process
(
COMMAND bash -c
"rm -rf
${
ANAKIN_INSTALL_DIR
}
/*"
)
execute_process
(
COMMAND bash -c
"mkdir -p
${
ANAKIN_INSTALL_DIR
}
"
)
execute_process
(
COMMAND bash -c
"cd
${
ANAKIN_INSTALL_DIR
}
; wget -q
${
ANAKIN_LIBRARY_URL
}
"
)
execute_process
(
COMMAND bash -c
"cd
${
ANAKIN_INSTALL_DIR
}
; tar xzf anakin_release_simple.tar.gz"
)
execute_process
(
COMMAND bash -c
"mkdir -p
${
ANAKIN_INSTALL_DIR
}
"
)
execute_process
(
COMMAND bash -c
"cd
${
ANAKIN_INSTALL_DIR
}
; tar xzf anakin_release_simple.tar.gz"
)
endif
()
if
(
WITH_ANAKIN
)
if
(
WITH_ANAKIN
)
message
(
STATUS
"Anakin for inference is enabled"
)
message
(
STATUS
"Anakin for inference is enabled"
)
...
...
cmake/inference_lib.cmake
浏览文件 @
c2289777
...
@@ -149,21 +149,33 @@ copy(memory_lib
...
@@ -149,21 +149,33 @@ copy(memory_lib
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
/detail
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
/detail
)
)
set
(
module
"inference"
)
set
(
inference_deps paddle_fluid_shared paddle_fluid
)
copy
(
inference_lib DEPS paddle_fluid_shared paddle_fluid
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
PADDLE_BINARY_DIR
}
/paddle/fluid/inference/libpaddle_fluid.*
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
)
if
(
WITH_CONTRIB
)
if
(
WITH_CONTRIB
)
message
(
STATUS
"installing contrib"
)
set
(
contrib_dst_dir
"
${
FLUID_INSTALL_DIR
}
/contrib/inference"
)
set
(
contrib_dst_dir
"
${
FLUID_INSTALL_DIR
}
/contrib/inference"
)
if
(
WITH_ANAKIN
)
copy
(
contrib_anakin_inference_lib DEPS paddle_inference_api inference_anakin_api
SRCS
${
PADDLE_BINARY_DIR
}
/paddle/contrib/inference/libinference_anakin_api*
# compiled anakin api
${
PADDLE_BINARY_DIR
}
/third_party/install/anakin/*.tar.gz
# anakin release
DSTS
${
contrib_dst_dir
}
/anakin
${
contrib_dst_dir
}
/anakin
)
list
(
APPEND inference_deps contrib_anakin_inference_lib
)
endif
()
copy
(
contrib_inference_lib DEPS paddle_inference_api
copy
(
contrib_inference_lib DEPS paddle_inference_api
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/contrib/inference/paddle_inference_api.h
SRCS
${
PADDLE_SOURCE_DIR
}
/paddle/contrib/inference/paddle_inference_api.h
${
PADDLE_BINARY_DIR
}
/paddle/contrib/inference/libpaddle_inference_api.*
${
PADDLE_BINARY_DIR
}
/paddle/contrib/inference/libpaddle_inference_api.*
DSTS
${
contrib_dst_dir
}
${
contrib_dst_dir
}
DSTS
${
contrib_dst_dir
}
${
contrib_dst_dir
}
)
)
list
(
APPEND inference_deps contrib_inference_lib
)
endif
()
endif
()
set
(
module
"inference"
)
copy
(
inference_lib DEPS
${
inference_deps
}
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
PADDLE_BINARY_DIR
}
/paddle/fluid/inference/libpaddle_fluid.*
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
)
set
(
module
"platform"
)
set
(
module
"platform"
)
copy
(
platform_lib DEPS profiler_py_proto
copy
(
platform_lib DEPS profiler_py_proto
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
src_dir
}
/
${
module
}
/dynload/*.h
${
src_dir
}
/
${
module
}
/details/*.h
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
src_dir
}
/
${
module
}
/dynload/*.h
${
src_dir
}
/
${
module
}
/details/*.h
...
...
paddle/contrib/inference/CMakeLists.txt
浏览文件 @
c2289777
...
@@ -54,9 +54,12 @@ if (WITH_ANAKIN AND WITH_TESTING) # only needed in CI
...
@@ -54,9 +54,12 @@ if (WITH_ANAKIN AND WITH_TESTING) # only needed in CI
# Due to Anakin do not have official library releases and the versions of protobuf and cuda do not match Paddle's,
# Due to Anakin do not have official library releases and the versions of protobuf and cuda do not match Paddle's,
# so anakin library will not be merged to our official inference library. To use anakin prediction API, one need to
# so anakin library will not be merged to our official inference library. To use anakin prediction API, one need to
# compile the libinference_anakin_api.a and compile with anakin.so.
# compile the libinference_anakin_api.a and compile with anakin.so.
nv_library
(
inference_anakin_api SHARED SRCS paddle_inference_api.cc paddle_inference_api_anakin_engine.cc
)
nv_library
(
inference_anakin_api SRCS paddle_inference_api.cc paddle_inference_api_anakin_engine.cc
)
nv_library
(
inference_anakin_api_shared SHARED SRCS paddle_inference_api.cc paddle_inference_api_anakin_engine.cc
)
target_compile_options
(
inference_anakin_api BEFORE PUBLIC
${
ANAKIN_COMPILE_EXTRA_FLAGS
}
)
target_compile_options
(
inference_anakin_api BEFORE PUBLIC
${
ANAKIN_COMPILE_EXTRA_FLAGS
}
)
target_compile_options
(
inference_anakin_api_shared BEFORE PUBLIC
${
ANAKIN_COMPILE_EXTRA_FLAGS
}
)
target_link_libraries
(
inference_anakin_api anakin anakin_saber_common
)
target_link_libraries
(
inference_anakin_api anakin anakin_saber_common
)
target_link_libraries
(
inference_anakin_api_shared anakin anakin_saber_common
)
cc_test
(
inference_anakin_test SRCS paddle_inference_api_anakin_engine_tester.cc
cc_test
(
inference_anakin_test SRCS paddle_inference_api_anakin_engine_tester.cc
ARGS --model=
${
ANAKIN_INSTALL_DIR
}
/mobilenet_v2.anakin.bin
ARGS --model=
${
ANAKIN_INSTALL_DIR
}
/mobilenet_v2.anakin.bin
DEPS inference_anakin_api
)
DEPS inference_anakin_api
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录