Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
23dec787
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看板
提交
23dec787
编写于
12月 14, 2018
作者:
P
peizhilin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix script issue
test=develop
上级
e2130502
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
157 addition
and
146 deletion
+157
-146
cmake/external/snappy.cmake
cmake/external/snappy.cmake
+10
-6
cmake/external/xxhash.cmake
cmake/external/xxhash.cmake
+6
-1
cmake/external/zlib.cmake
cmake/external/zlib.cmake
+10
-6
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+53
-39
paddle/fluid/framework/CMakeLists.txt
paddle/fluid/framework/CMakeLists.txt
+14
-22
paddle/fluid/inference/CMakeLists.txt
paddle/fluid/inference/CMakeLists.txt
+0
-9
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
+51
-55
paddle/fluid/operators/detection/density_prior_box_op.cu
paddle/fluid/operators/detection/density_prior_box_op.cu
+2
-1
paddle/fluid/operators/detection/roi_perspective_transform_op.cu
...fluid/operators/detection/roi_perspective_transform_op.cu
+2
-2
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+7
-0
paddle/fluid/pybind/CMakeLists.txt
paddle/fluid/pybind/CMakeLists.txt
+0
-4
python/setup.py.in
python/setup.py.in
+2
-1
未找到文件。
cmake/external/snappy.cmake
浏览文件 @
23dec787
...
...
@@ -24,12 +24,6 @@ set(SNAPPY_SOURCES_DIR ${THIRD_PARTY_PATH}/snappy)
set
(
SNAPPY_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/snappy
)
set
(
SNAPPY_INCLUDE_DIR
"
${
SNAPPY_INSTALL_DIR
}
/include"
CACHE PATH
"snappy include directory."
FORCE
)
if
(
WIN32
)
set
(
SNAPPY_LIBRARIES
"
${
SNAPPY_INSTALL_DIR
}
/lib/snappy.lib"
)
else
(
WIN32
)
set
(
SNAPPY_LIBRARIES
"
${
SNAPPY_INSTALL_DIR
}
/lib/libsnappy.a"
)
endif
(
WIN32
)
ExternalProject_Add
(
extern_snappy
GIT_REPOSITORY
"https://github.com/google/snappy"
...
...
@@ -56,6 +50,16 @@ ExternalProject_Add(
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=
${
THIRD_PARTY_BUILD_TYPE
}
)
IF
(
WIN32
)
IF
(
NOT EXISTS
"
${
SNAPPY_INSTALL_DIR
}
/lib/libsnappy.lib"
)
add_custom_command
(
TARGET extern_snappy POST_BUILD
COMMAND cmake -E copy
${
SNAPPY_INSTALL_DIR
}
/lib/snappy.lib
${
SNAPPY_INSTALL_DIR
}
/lib/libsnappy.lib
)
ENDIF
()
set
(
SNAPPY_LIBRARIES
"
${
SNAPPY_INSTALL_DIR
}
/lib/libsnappy.lib"
)
else
(
WIN32
)
set
(
SNAPPY_LIBRARIES
"
${
SNAPPY_INSTALL_DIR
}
/lib/libsnappy.a"
)
endif
(
WIN32
)
add_library
(
snappy STATIC IMPORTED GLOBAL
)
set_property
(
TARGET snappy PROPERTY IMPORTED_LOCATION
${
SNAPPY_LIBRARIES
}
)
...
...
cmake/external/xxhash.cmake
浏览文件 @
23dec787
...
...
@@ -56,7 +56,12 @@ else()
endif
()
if
(
WIN32
)
set
(
XXHASH_LIBRARIES
"
${
XXHASH_INSTALL_DIR
}
/lib/xxhash.lib"
)
IF
(
NOT EXISTS
"
${
XXHASH_INSTALL_DIR
}
/lib/libxxhash.lib"
)
add_custom_command
(
TARGET extern_xxhash POST_BUILD
COMMAND cmake -E copy
${
XXHASH_INSTALL_DIR
}
/lib/xxhash.lib
${
XXHASH_INSTALL_DIR
}
/lib/libxxhash.lib
)
ENDIF
()
set
(
XXHASH_LIBRARIES
"
${
XXHASH_INSTALL_DIR
}
/lib/libxxhash.lib"
)
else
()
set
(
XXHASH_LIBRARIES
"
${
XXHASH_INSTALL_DIR
}
/lib/libxxhash.a"
)
endif
()
...
...
cmake/external/zlib.cmake
浏览文件 @
23dec787
...
...
@@ -19,12 +19,6 @@ SET(ZLIB_INSTALL_DIR ${THIRD_PARTY_PATH}/install/zlib)
SET
(
ZLIB_ROOT
${
ZLIB_INSTALL_DIR
}
CACHE FILEPATH
"zlib root directory."
FORCE
)
SET
(
ZLIB_INCLUDE_DIR
"
${
ZLIB_INSTALL_DIR
}
/include"
CACHE PATH
"zlib include directory."
FORCE
)
IF
(
WIN32
)
SET
(
ZLIB_LIBRARIES
"
${
ZLIB_INSTALL_DIR
}
/lib/zlibstatic.lib"
CACHE FILEPATH
"zlib library."
FORCE
)
ELSE
(
WIN32
)
SET
(
ZLIB_LIBRARIES
"
${
ZLIB_INSTALL_DIR
}
/lib/libz.a"
CACHE FILEPATH
"zlib library."
FORCE
)
ENDIF
(
WIN32
)
INCLUDE_DIRECTORIES
(
${
ZLIB_INCLUDE_DIR
}
)
# For zlib code to include its own headers.
INCLUDE_DIRECTORIES
(
${
THIRD_PARTY_PATH
}
/install
)
# For Paddle code to include zlib.h.
...
...
@@ -49,6 +43,16 @@ ExternalProject_Add(
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=
${
THIRD_PARTY_BUILD_TYPE
}
)
IF
(
WIN32
)
IF
(
NOT EXISTS
"
${
ZLIB_INSTALL_DIR
}
/lib/libz.lib"
)
add_custom_command
(
TARGET extern_zlib POST_BUILD
COMMAND cmake -E copy
${
ZLIB_INSTALL_DIR
}
/lib/zlibstatic.lib
${
ZLIB_INSTALL_DIR
}
/lib/libz.lib
)
ENDIF
()
SET
(
ZLIB_LIBRARIES
"
${
ZLIB_INSTALL_DIR
}
/lib/libz.lib"
CACHE FILEPATH
"zlib library."
FORCE
)
ELSE
(
WIN32
)
SET
(
ZLIB_LIBRARIES
"
${
ZLIB_INSTALL_DIR
}
/lib/libz.a"
CACHE FILEPATH
"zlib library."
FORCE
)
ENDIF
(
WIN32
)
ADD_LIBRARY
(
zlib STATIC IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET zlib PROPERTY IMPORTED_LOCATION
${
ZLIB_LIBRARIES
}
)
...
...
cmake/inference_lib.cmake
浏览文件 @
23dec787
...
...
@@ -32,24 +32,35 @@ function(copy TARGET)
list
(
GET copy_lib_SRCS
${
index
}
src
)
list
(
GET copy_lib_DSTS
${
index
}
dst
)
if
(
WIN32
)
# windows cmd shell will not expand wildcard automatically.
# below expand the files,libs and copy them by rules.
file
(
GLOB header_files
${
src
}
"*.h"
)
file
(
GLOB static_lib_files
${
src
}
"*.lib"
)
file
(
GLOB dll_lib_files
${
src
}
"*.dll"
)
set
(
src_files
${
header_files
}
${
static_lib_files
}
${
dll_lib_files
}
)
if
(
NOT
"
${
src_files
}
"
STREQUAL
""
)
list
(
REMOVE_DUPLICATES src_files
)
endif
()
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
dst
}
"
)
foreach
(
src_file
${
src_files
}
)
if
(
IS_DIRECTORY
${
src
}
)
get_filename_component
(
last_path
${
src
}
NAME
)
string
(
APPEND dst
"/"
${
last_path
}
)
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
dst
}
"
)
if
(
EXISTS
${
src
}
)
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND cmake -E copy_directory
"
${
src
}
"
"
${
dst
}
"
COMMENT
"copying
${
src
}
->
${
dst
}
"
)
else
()
message
(
WARNING
"
${
src
}
not exist!"
)
endif
()
else
()
# windows cmd shell will not expand wildcard automatically.
# below expand the files, and copy them by rules.
file
(
GLOB src_files
${
src
}
)
if
(
NOT
"
${
src_files
}
"
STREQUAL
""
)
list
(
REMOVE_DUPLICATES src_files
)
endif
()
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
src_file
}
"
"
${
dst
}
"
COMMENT
"copying
${
src_file
}
->
${
dst
}
"
)
endforeach
()
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
dst
}
"
)
foreach
(
src_file
${
src_files
}
)
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
src_file
}
"
"
${
dst
}
"
COMMENT
"copying
${
src_file
}
->
${
dst
}
"
)
endforeach
()
endif
()
else
(
WIN32
)
# not windows
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND mkdir -p
"
${
dst
}
"
...
...
@@ -95,7 +106,7 @@ copy(xxhash_lib
DEPS xxhash
)
if
(
NOT PROTOBUF_FOUND
)
if
(
NOT PROTOBUF_FOUND
OR WIN32
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/protobuf"
)
copy
(
protobuf_lib
SRCS
${
PROTOBUF_INCLUDE_DIR
}
${
PROTOBUF_LIBRARY
}
...
...
@@ -138,27 +149,25 @@ if (WITH_NGRAPH)
)
endif
()
if
(
NOT WIN32
)
if
(
NOT MOBILE_INFERENCE AND NOT RPI
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/snappy"
)
copy
(
snappy_lib
SRCS
${
SNAPPY_INCLUDE_DIR
}
${
SNAPPY_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
DEPS snappy
)
if
(
NOT MOBILE_INFERENCE AND NOT RPI
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/snappy"
)
copy
(
snappy_lib
SRCS
${
SNAPPY_INCLUDE_DIR
}
${
SNAPPY_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
DEPS snappy
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/snappystream"
)
copy
(
snappystream_lib
SRCS
${
SNAPPYSTREAM_INCLUDE_DIR
}
${
SNAPPYSTREAM_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
DEPS snappystream
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/snappystream"
)
copy
(
snappystream_lib
SRCS
${
SNAPPYSTREAM_INCLUDE_DIR
}
${
SNAPPYSTREAM_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
DEPS snappystream
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/zlib"
)
copy
(
zlib_lib
SRCS
${
ZLIB_INCLUDE_DIR
}
${
ZLIB_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
DEPS zlib
)
endif
()
endif
(
NOT WIN32
)
set
(
dst_dir
"
${
FLUID_INSTALL_DIR
}
/third_party/install/zlib"
)
copy
(
zlib_lib
SRCS
${
ZLIB_INCLUDE_DIR
}
${
ZLIB_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
DEPS zlib
)
endif
()
# paddle fluid module
set
(
src_dir
"
${
PADDLE_SOURCE_DIR
}
/paddle/fluid"
)
...
...
@@ -192,8 +201,13 @@ if (WITH_ANAKIN AND WITH_MKL)
endif
()
set
(
module
"inference"
)
if
(
WIN32
)
set
(
paddle_fluid_lib
${
PADDLE_BINARY_DIR
}
/paddle/fluid/inference/
${
CMAKE_BUILD_TYPE
}
/libpaddle_fluid.*
)
else
(
WIN32
)
set
(
paddle_fluid_lib
${
PADDLE_BINARY_DIR
}
/paddle/fluid/inference/libpaddle_fluid.*
)
endif
(
WIN32
)
copy
(
inference_lib DEPS
${
inference_deps
}
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
PADDLE_BINARY_DIR
}
/paddle/fluid/inference/libpaddle_fluid.*
SRCS
${
src_dir
}
/
${
module
}
/*.h
${
paddle_fluid_lib
}
${
src_dir
}
/
${
module
}
/api/paddle_*.h
DSTS
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
${
dst_dir
}
/
${
module
}
)
...
...
@@ -233,7 +247,7 @@ copy(third_party DEPS fluid_lib_dist
# only need libpaddle_fluid.so/a and paddle_*.h for inference-only library
copy
(
inference_api_lib DEPS fluid_lib_dist
SRCS
${
FLUID_INSTALL_DIR
}
/paddle/fluid/inference/libpaddle_fluid.*
SRCS
${
paddle_fluid_lib
}
${
FLUID_INSTALL_DIR
}
/paddle/fluid/inference/paddle_*.h
DSTS
${
FLUID_INFERENCE_INSTALL_DIR
}
/paddle/lib
${
FLUID_INFERENCE_INSTALL_DIR
}
/paddle/include
)
...
...
paddle/fluid/framework/CMakeLists.txt
浏览文件 @
23dec787
...
...
@@ -3,30 +3,22 @@
# We create a hidden file and compile it instead of origin source file.
function
(
windows_symbolic TARGET
)
set
(
oneValueArgs
""
)
set
(
multiValueArgs SRCS
DEPS
)
set
(
multiValueArgs SRCS
PATH
)
cmake_parse_arguments
(
windows_symbolic
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
set
(
final_path
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
windows_symbolic_PATH
}
)
foreach
(
src
${
windows_symbolic_SRCS
}
)
get_filename_component
(
src
${
src
}
NAME_WE
)
if
(
NOT EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
src
}
.cc OR NOT EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
src
}
.cu
)
message
(
FATAL
"
${
src
}
.cc and
${
src
}
.cu must exsits, and
${
src
}
.cu must be symbolic file."
)
endif
()
# only copy the xx.cu to .xx.cu when the content are modified
set
(
copy_flag 1
)
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/.
${
src
}
.cu
)
file
(
READ
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
src
}
.cc SOURCE_STR
)
file
(
READ
${
CMAKE_CURRENT_SOURCE_DIR
}
/.
${
src
}
.cu TARGET_STR
)
if
(
SOURCE_STR STREQUAL TARGET_STR
)
set
(
copy_flag 0
)
endif
()
endif
()
if
(
copy_flag
)
add_custom_command
(
OUTPUT .
${
src
}
.cu
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
CMAKE_CURRENT_SOURCE_DIR
}
/.
${
src
}
.cu
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
src
}
.cc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/.
${
src
}
.cu"
COMMENT
"create hidden file of
${
src
}
.cu"
)
endif
(
copy_flag
)
add_custom_target
(
${
TARGET
}
ALL DEPENDS .
${
src
}
.cu
)
get_filename_component
(
src
${
src
}
NAME_WE
)
if
(
NOT EXISTS
${
final_path
}
/
${
src
}
.cc OR NOT EXISTS
${
final_path
}
/
${
src
}
.cu
)
message
(
FATAL
"
${
src
}
.cc and
${
src
}
.cu must exsits, and
${
src
}
.cu must be symbolic file."
)
endif
()
file
(
GENERATE OUTPUT
${
final_path
}
/.
${
src
}
.cu INPUT
${
final_path
}
/
${
src
}
.cc
)
add_custom_command
(
OUTPUT
${
final_path
}
/.
${
src
}
.cu
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
final_path
}
/.
${
src
}
.cu
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
final_path
}
/
${
src
}
.cc"
"
${
final_path
}
/.
${
src
}
.cu"
COMMENT
"create hidden file of
${
src
}
.cu"
)
add_custom_target
(
${
TARGET
}
ALL DEPENDS .
${
src
}
.cu
)
endforeach
()
endfunction
()
...
...
paddle/fluid/inference/CMakeLists.txt
浏览文件 @
23dec787
...
...
@@ -26,9 +26,6 @@ endif(WIN32)
# paddle_fluid_origin exclude inference api interface
if
(
WIN32
)
sep_library
(
paddle_fluid_origin DEPS
${
fluid_modules
}
paddle_fluid_api
)
if
(
WITH_GPU AND NOT WITH_DSO
)
target_link_libraries
(
paddle_fluid_origin
${
cuda_modules
}
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
else
(
WIN32
)
cc_library
(
paddle_fluid_origin DEPS
${
fluid_modules
}
paddle_fluid_api
)
endif
(
WIN32
)
...
...
@@ -44,9 +41,6 @@ set(SHARED_INFERENCE_SRCS
if
(
WIN32
)
sep_library
(
paddle_fluid DEPS
${
fluid_modules
}
${
STATIC_INFERENCE_APIS
}
zero_copy_tensor reset_tensor_array
analysis_config paddle_pass_builder
)
if
(
WITH_GPU AND NOT WITH_DSO
)
target_link_libraries
(
paddle_fluid
${
cuda_modules
}
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
else
(
WIN32
)
cc_library
(
paddle_fluid DEPS
${
fluid_modules
}
${
STATIC_INFERENCE_APIS
}
zero_copy_tensor reset_tensor_array
analysis_config paddle_pass_builder
)
...
...
@@ -63,9 +57,6 @@ if(WIN32)
sep_library
(
paddle_fluid_shared SHARED SRCS
${
SHARED_INFERENCE_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array analysis_config paddle_pass_builder
)
target_link_libraries
(
paddle_fluid_shared shlwapi
)
if
(
WITH_GPU AND NOT WITH_DSO
)
target_link_libraries
(
paddle_fluid_origin
${
cuda_modules
}
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
else
(
WIN32
)
cc_library
(
paddle_fluid_shared SHARED SRCS
${
SHARED_INFERENCE_SRCS
}
DEPS
${
fluid_modules
}
paddle_fluid_api reset_tensor_array analysis_config paddle_pass_builder
)
...
...
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
浏览文件 @
23dec787
...
...
@@ -15,12 +15,43 @@ macro(safe_set_static_flag)
endforeach
(
flag_var
)
endmacro
()
if
(
NOT DEFINED PADDLE_LIB
)
message
(
FATAL_ERROR
"please set PADDLE_LIB with -DPADDLE_LIB=/path/paddle/lib"
)
endif
()
if
(
NOT DEFINED DEMO_NAME
)
message
(
FATAL_ERROR
"please set DEMO_NAME with -DDEMO_NAME=demo_name"
)
endif
()
include_directories
(
"
${
PADDLE_LIB
}
/"
)
include_directories
(
"
${
PADDLE_LIB
}
/fluid_inference_install_dir/"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/protobuf/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/glog/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/gflags/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/xxhash/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappy/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappystream/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/zlib/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/boost"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/eigen3"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappy/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappystream/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/zlib/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/protobuf/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/glog/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/gflags/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/xxhash/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/paddle/lib"
)
if
(
WIN32
)
add_definitions
(
"/DGOOGLE_GLOG_DLL_DECL="
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
/bigobj /MT"
)
if
(
WITH_STATIC_LIB
)
safe_set_static_flag
()
add_definitions
(
-DSTATIC_LIB
)
set
(
CMAKE_CXX_FLAGS
${
CMAKE_CXX_FLAGS
}
"/w"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
${
CMAKE_CXX_FLAGS_RELEASE
}
"/w"
)
endif
()
set
(
CMAKE_STATIC_LIBRARY_PREFIX
"lib"
)
else
()
...
...
@@ -29,36 +60,15 @@ else()
endif
()
message
(
"flags"
${
CMAKE_CXX_FLAGS
}
)
if
(
NOT DEFINED PADDLE_LIB
)
message
(
FATAL_ERROR
"please set PADDLE_LIB with -DPADDLE_LIB=/path/paddle/lib"
)
endif
()
if
(
NOT DEFINED DEMO_NAME
)
message
(
FATAL_ERROR
"please set DEMO_NAME with -DDEMO_NAME=demo_name"
)
endif
()
if
(
WITH_GPU
)
if
(
NOT WIN32
)
set
(
CUDA_LIB
"/usr/local/cuda/lib64/"
CACHE STRING
"CUDA Library"
)
else
()
if
(
CUDA_LIB STREQUAL
""
)
set
(
CUDA_LIB
"C:
\\
Program
\
Files
\\
NVIDIA GPU Computing Toolkit
\\
CUDA
\\
v8.0
\\
lib
\\
x64"
)
set
(
CUDA_LIB
"C:
\\
Program
\
Files
\\
NVIDIA GPU Computing Toolkit
\\
CUDA
\\
v8.0
\\
lib
\\
x64"
)
endif
()
endif
(
NOT WIN32
)
endif
()
include_directories
(
"
${
PADDLE_LIB
}
"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/protobuf/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/glog/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/gflags/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/xxhash/include"
)
if
(
NOT WIN32
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappy/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappystream/include"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/zlib/include"
)
endif
(
NOT WIN32
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/boost"
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/eigen3"
)
if
(
NOT WIN32
)
if
(
USE_TENSORRT AND WITH_GPU
)
...
...
@@ -67,18 +77,6 @@ if (NOT WIN32)
endif
()
endif
(
NOT WIN32
)
if
(
NOT WIN32
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappy/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/snappystream/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/zlib/lib"
)
endif
(
NOT WIN32
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/protobuf/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/glog/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/gflags/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/third_party/install/xxhash/lib"
)
link_directories
(
"
${
PADDLE_LIB
}
/paddle/lib"
)
if
(
NOT WIN32
)
set
(
NGRAPH_PATH
"
${
PADDLE_LIB
}
/third_party/install/ngraph"
)
if
(
EXISTS
${
NGRAPH_PATH
}
)
...
...
@@ -89,8 +87,6 @@ if (NOT WIN32)
endif
()
endif
()
add_executable
(
${
DEMO_NAME
}
${
DEMO_NAME
}
.cc
)
if
(
WITH_MKL
)
include_directories
(
"
${
PADDLE_LIB
}
/third_party/install/mklml/include"
)
set
(
MATH_LIB
${
PADDLE_LIB
}
/third_party/install/mklml/lib/libmklml_intel
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
...
...
@@ -106,26 +102,25 @@ endif()
# Note: libpaddle_inference_api.so/a must put before libpaddle_fluid.so/a
if
(
WITH_STATIC_LIB
)
set
(
DEPS
${
PADDLE_LIB
}
/paddle/lib/libpaddle_fluid
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
set
(
DEPS
${
PADDLE_LIB
}
/paddle/lib/libpaddle_fluid
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
else
()
set
(
DEPS
${
PADDLE_LIB
}
/paddle/lib/libpaddle_fluid
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
set
(
DEPS
${
PADDLE_LIB
}
/paddle/lib/libpaddle_fluid
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
endif
()
if
(
NOT WIN32
)
set
(
EXTERNAL_LIB
"-lrt -ldl -lpthread"
)
set
(
DEPS
${
DEPS
}
${
MATH_LIB
}
${
MKLDNN_LIB
}
${
NGRAPH_LIB
}
glog gflags protobuf snappystream snappy z xxhash
${
EXTERNAL_LIB
}
)
set
(
EXTERNAL_LIB
"-lrt -ldl -lpthread"
)
set
(
DEPS
${
DEPS
}
${
MATH_LIB
}
${
MKLDNN_LIB
}
${
NGRAPH_LIB
}
glog gflags protobuf snappystream snappy z xxhash
${
EXTERNAL_LIB
}
)
else
()
set
(
DEPS
${
DEPS
}
${
MATH_LIB
}
${
MKLDNN_LIB
}
${
CMAKE_STATIC_LIBRARY_PREFIX
}
glog
${
CMAKE_STATIC_LIBRARY_PREFIX
}
gflags
${
CMAKE_STATIC_LIBRARY_PREFIX
}
protobuf
${
EXTERNAL_LIB
}
)
# NOTE(dzhwinter) shlwapi is deprecated.
set
(
DEPS
${
DEPS
}
libcmt shlwapi
)
set
(
DEPS
${
DEPS
}
${
MATH_LIB
}
${
MKLDNN_LIB
}
${
CMAKE_STATIC_LIBRARY_PREFIX
}
glog
${
CMAKE_STATIC_LIBRARY_PREFIX
}
gflags
${
CMAKE_STATIC_LIBRARY_PREFIX
}
protobuf
${
CMAKE_STATIC_LIBRARY_PREFIX
}
snappy
${
CMAKE_STATIC_LIBRARY_PREFIX
}
z
${
CMAKE_STATIC_LIBRARY_PREFIX
}
xxhash
snappystream
${
EXTERNAL_LIB
}
)
# NOTE(dzhwinter) shlwapi is deprecated.
set
(
DEPS
${
DEPS
}
libcmt shlwapi
)
endif
(
NOT WIN32
)
if
(
WITH_GPU
)
...
...
@@ -137,9 +132,10 @@ if(WITH_GPU)
set
(
DEPS
${
DEPS
}
${
CUDA_LIB
}
/libcudart
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
else
()
set
(
DEPS
${
DEPS
}
${
CUDA_LIB
}
/cudart
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
set
(
DEPS
${
DEPS
}
${
CUDA_LIB
}
/cublas
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
set
(
DEPS
${
DEPS
}
${
CUDA_LIB
}
/cudnn
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
set
(
DEPS
${
DEPS
}
${
CUDA_LIB
}
/cublas
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
set
(
DEPS
${
DEPS
}
${
CUDA_LIB
}
/cudnn
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
)
endif
()
endif
()
add_executable
(
${
DEMO_NAME
}
${
DEMO_NAME
}
.cc
)
target_link_libraries
(
${
DEMO_NAME
}
${
DEPS
}
)
paddle/fluid/operators/detection/density_prior_box_op.cu
浏览文件 @
23dec787
...
...
@@ -146,7 +146,8 @@ class DensityPriorBoxOpCUDAKernel : public framework::OpKernel<T> {
// At least use 32 threads, at most 512 threads.
// blockx is multiple of 32.
int
blockx
=
std
::
min
(((
feature_width
*
num_priors
+
31
)
>>
5
)
<<
5
,
512L
);
int
blockx
=
std
::
min
(
static_cast
<
long
>
(((
feature_width
*
num_priors
+
31
)
>>
5
)
<<
5
),
512L
);
int
gridx
=
(
feature_width
*
num_priors
+
blockx
-
1
)
/
blockx
;
dim3
threads
(
blockx
,
1
);
dim3
grids
(
gridx
,
feature_height
);
...
...
paddle/fluid/operators/detection/roi_perspective_transform_op.cu
浏览文件 @
23dec787
...
...
@@ -35,12 +35,12 @@ namespace operators {
template
<
typename
T
>
__device__
bool
GT_E
(
T
a
,
T
b
)
{
return
(
a
>
b
)
||
f
abs
(
a
-
b
)
<
1e-4
;
return
(
a
>
b
)
||
Eigen
::
numext
::
abs
(
a
-
b
)
<
1e-4
;
}
template
<
typename
T
>
__device__
bool
LT_E
(
T
a
,
T
b
)
{
return
(
a
<
b
)
||
f
abs
(
a
-
b
)
<
1e-4
;
return
(
a
<
b
)
||
Eigen
::
numext
::
abs
(
a
-
b
)
<
1e-4
;
}
template
<
typename
T
>
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
23dec787
...
...
@@ -67,6 +67,13 @@ ENDIF()
# avoiding cycle dependencies
cc_library
(
device_context SRCS device_context.cc init.cc DEPS simple_threadpool malloc
${
STREAM_CALLBACK_DEPS
}
place eigen3 stringpiece cpu_helper cpu_info framework_proto
${
GPU_CTX_DEPS
}
${
MKLDNN_CTX_DEPS
}
)
if
(
WIN32
)
if
(
WITH_GPU AND NOT WITH_DSO
)
get_property
(
cuda_modules GLOBAL PROPERTY CUDA_MODULES
)
target_link_libraries
(
device_context
${
cuda_modules
}
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
endif
(
WIN32
)
nv_test
(
device_context_test SRCS device_context_test.cu DEPS device_context gpu_info
)
cc_test
(
init_test SRCS init_test.cc DEPS device_context
)
...
...
paddle/fluid/pybind/CMakeLists.txt
浏览文件 @
23dec787
...
...
@@ -19,10 +19,6 @@ if(WITH_PYTHON)
endif
(
WITH_AMD_GPU
)
if
(
WIN32
)
if
(
WITH_GPU AND NOT WITH_DSO
)
get_property
(
cuda_modules GLOBAL PROPERTY CUDA_MODULES
)
target_link_libraries
(
paddle_pybind
${
cuda_modules
}
)
endif
(
WITH_GPU AND NOT WITH_DSO
)
target_link_libraries
(
paddle_pybind shlwapi
)
endif
(
WIN32
)
...
...
python/setup.py.in
浏览文件 @
23dec787
...
...
@@ -241,5 +241,6 @@ setup(name='${PACKAGE_NAME}',
ext_modules=ext_modules,
package_data=package_data,
package_dir=package_dir,
scripts=paddle_bins
scripts=paddle_bins,
distclass=BinaryDistribution
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录