Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
45125ba5
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
接近 2 年 前同步成功
通知
707
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看板
提交
45125ba5
编写于
11月 08, 2018
作者:
P
peizhilin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix share library issue
上级
869487a2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
17 deletion
+17
-17
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/generic.cmake
cmake/generic.cmake
+6
-11
paddle/fluid/inference/CMakeLists.txt
paddle/fluid/inference/CMakeLists.txt
+1
-0
paddle/fluid/inference/api/api_impl.cc
paddle/fluid/inference/api/api_impl.cc
+0
-4
paddle/fluid/platform/device_context.h
paddle/fluid/platform/device_context.h
+1
-1
paddle/fluid/platform/init.cc
paddle/fluid/platform/init.cc
+8
-0
未找到文件。
CMakeLists.txt
浏览文件 @
45125ba5
...
@@ -77,7 +77,7 @@ option(WITH_INFERENCE_API_TEST "Test fluid inference high-level api interface"
...
@@ -77,7 +77,7 @@ option(WITH_INFERENCE_API_TEST "Test fluid inference high-level api interface"
option
(
WITH_SYSTEM_BLAS
"Use system blas library"
OFF
)
option
(
WITH_SYSTEM_BLAS
"Use system blas library"
OFF
)
option
(
PY_VERSION
"Compile PaddlePaddle with python3 support"
${
PY_VERSION
}
)
option
(
PY_VERSION
"Compile PaddlePaddle with python3 support"
${
PY_VERSION
}
)
option
(
WITH_FAST_MATH
"Make use of fast math library, might affect the precision to some extent"
ON
)
option
(
WITH_FAST_MATH
"Make use of fast math library, might affect the precision to some extent"
ON
)
option
(
WITH_PREBUILD_OPENBLAS
"Make use of the pre-built openblas library"
ON
)
option
(
WITH_PREBUILD_OPENBLAS
"Make use of the pre-built openblas library"
${
WIN32
}
)
# PY_VERSION
# PY_VERSION
if
(
NOT PY_VERSION
)
if
(
NOT PY_VERSION
)
...
...
cmake/generic.cmake
浏览文件 @
45125ba5
...
@@ -304,12 +304,6 @@ function(sep_library TARGET_NAME)
...
@@ -304,12 +304,6 @@ function(sep_library TARGET_NAME)
set
(
options STATIC static SHARED shared
)
set
(
options STATIC static SHARED shared
)
set
(
oneValueArgs
""
)
set
(
oneValueArgs
""
)
set
(
multiValueArgs SRCS DEPS
)
set
(
multiValueArgs SRCS DEPS
)
set
(
${
TARGET_NAME
}
_dummy_flag
""
)
if
(
${
sep_library_STATIC
}
)
set
(
${
TARGET_NAME
}
_dummy_flag
"STATIC"
)
elseif
(
${
sep_library_SHARED
}
)
set
(
${
TARGET_NAME
}
_dummy_flag
"SHARED"
)
endif
()
cmake_parse_arguments
(
sep_library
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
cmake_parse_arguments
(
sep_library
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
set
(
dummy_index 1
)
set
(
dummy_index 1
)
set
(
dummy_offset 1
)
set
(
dummy_offset 1
)
...
@@ -321,10 +315,7 @@ function(sep_library TARGET_NAME)
...
@@ -321,10 +315,7 @@ function(sep_library TARGET_NAME)
list
(
LENGTH dummy_list listlen
)
list
(
LENGTH dummy_list listlen
)
if
((
${
listlen
}
GREATER
${
dummy_limit
}
)
OR
(
${
dummy_offset
}
EQUAL
${
sep_all_len
}
))
if
((
${
listlen
}
GREATER
${
dummy_limit
}
)
OR
(
${
dummy_offset
}
EQUAL
${
sep_all_len
}
))
message
(
"create dummy library
${
TARGET_NAME
}
_dummy_lib_
${
dummy_index
}
for
${
TARGET_NAME
}
"
)
message
(
"create dummy library
${
TARGET_NAME
}
_dummy_lib_
${
dummy_index
}
for
${
TARGET_NAME
}
"
)
# set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_dummy_${dummy_index}.c)
cc_library
(
${
TARGET_NAME
}
_dummy_lib_
${
dummy_index
}
STATIC DEPS
${
dummy_list
}
)
# file(WRITE ${dummyfile} "const char *dummy_${TARGET_NAME}_${dummy_index} = \"${dummyfile}\";")
# cc_library(${TARGET_NAME}_dummy_lib_${dummy_index} ${${TARGET_NAME}_dummy_flag} SRCS ${dummyfile} DEPS ${dummy_list})
cc_library
(
${
TARGET_NAME
}
_dummy_lib_
${
dummy_index
}
${${
TARGET_NAME
}
_dummy_flag
}
DEPS
${
dummy_list
}
)
foreach
(
i
${
dummy_list
}
)
foreach
(
i
${
dummy_list
}
)
list
(
REMOVE_AT dummy_list 0
)
list
(
REMOVE_AT dummy_list 0
)
endforeach
()
endforeach
()
...
@@ -333,7 +324,11 @@ function(sep_library TARGET_NAME)
...
@@ -333,7 +324,11 @@ function(sep_library TARGET_NAME)
endif
()
endif
()
MATH
(
EXPR dummy_offset
"
${
dummy_offset
}
+1"
)
MATH
(
EXPR dummy_offset
"
${
dummy_offset
}
+1"
)
endforeach
()
endforeach
()
cc_library
(
${
TARGET_NAME
}
${${
TARGET_NAME
}
_dummy_flag
}
SRCS
${
sep_library_SRCS
}
DEPS
${${
TARGET_NAME
}
_dummy_list
}
)
if
(
${
sep_library_SHARED
}
)
cc_library
(
${
TARGET_NAME
}
SHARED SRCS
${
sep_library_SRCS
}
DEPS
${${
TARGET_NAME
}
_dummy_list
}
)
else
(
${
sep_library_SHARED
}
)
cc_library
(
${
TARGET_NAME
}
STATIC SRCS
${
sep_library_SRCS
}
DEPS
${${
TARGET_NAME
}
_dummy_list
}
)
endif
(
${
sep_library_SHARED
}
)
endfunction
(
sep_library
)
endfunction
(
sep_library
)
function
(
cc_binary TARGET_NAME
)
function
(
cc_binary TARGET_NAME
)
...
...
paddle/fluid/inference/CMakeLists.txt
浏览文件 @
45125ba5
...
@@ -60,6 +60,7 @@ endif()
...
@@ -60,6 +60,7 @@ endif()
if
(
WIN32
)
if
(
WIN32
)
sep_library
(
paddle_fluid_shared SHARED SRCS
${
SHARED_INFERENCE_SRCS
}
sep_library
(
paddle_fluid_shared SHARED SRCS
${
SHARED_INFERENCE_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array
)
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array
)
target_link_libraries
(
paddle_fluid_shared shlwapi
)
if
(
WITH_GPU AND NOT WITH_DSO
)
if
(
WITH_GPU AND NOT WITH_DSO
)
target_link_libraries
(
paddle_fluid_origin
${
cuda_modules
}
)
target_link_libraries
(
paddle_fluid_origin
${
cuda_modules
}
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
...
...
paddle/fluid/inference/api/api_impl.cc
浏览文件 @
45125ba5
...
@@ -75,10 +75,6 @@ bool NativePaddlePredictor::Init(
...
@@ -75,10 +75,6 @@ bool NativePaddlePredictor::Init(
}
}
#endif
#endif
// windows has no support for openblas multi-thread
#ifdef _WIN32
FLAGS_paddle_num_threads
=
1
;
#endif
// no matter with or without MKLDNN
// no matter with or without MKLDNN
paddle
::
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
paddle
::
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
...
...
paddle/fluid/platform/device_context.h
浏览文件 @
45125ba5
...
@@ -32,7 +32,7 @@ limitations under the License. */
...
@@ -32,7 +32,7 @@ limitations under the License. */
#include "glog/logging.h"
#include "glog/logging.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/place.h"
#ifdef PADDLE_WITH_CUDA
#ifdef PADDLE_WITH_CUDA
&& !defined(_WIN32)
#include "paddle/fluid/platform/stream_callback_manager.h"
#include "paddle/fluid/platform/stream_callback_manager.h"
#endif
#endif
#include "unsupported/Eigen/CXX11/Tensor"
#include "unsupported/Eigen/CXX11/Tensor"
...
...
paddle/fluid/platform/init.cc
浏览文件 @
45125ba5
...
@@ -112,6 +112,14 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
...
@@ -112,6 +112,14 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
}
}
places
.
emplace_back
(
platform
::
CPUPlace
());
places
.
emplace_back
(
platform
::
CPUPlace
());
platform
::
DeviceContextPool
::
Init
(
places
);
platform
::
DeviceContextPool
::
Init
(
places
);
// windows has no support for openblas multi-thread
#ifdef _WIN32
if
(
FLAGS_paddle_num_threads
>
1
)
{
FLAGS_paddle_num_threads
=
1
;
}
#endif
#ifndef PADDLE_WITH_MKLDNN
#ifndef PADDLE_WITH_MKLDNN
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
platform
::
SetNumThreads
(
FLAGS_paddle_num_threads
);
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录