Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
26dbe35c
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
26dbe35c
编写于
8月 26, 2018
作者:
D
dzhwinter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add msvc flags and copy lib done
上级
d7f98f37
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
52 addition
and
18 deletion
+52
-18
cmake/flags.cmake
cmake/flags.cmake
+16
-7
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+24
-1
paddle/fluid/operators/CMakeLists.txt
paddle/fluid/operators/CMakeLists.txt
+1
-1
paddle/fluid/operators/math/CMakeLists.txt
paddle/fluid/operators/math/CMakeLists.txt
+2
-0
paddle/fluid/operators/math/matrix_bit_code.h
paddle/fluid/operators/math/matrix_bit_code.h
+9
-9
未找到文件。
cmake/flags.cmake
浏览文件 @
26dbe35c
...
...
@@ -97,9 +97,13 @@ SET(CMAKE_EXTRA_INCLUDE_FILES "")
# Common flags. the compiler flag used for C/C++ sources whenever release or debug
# Do not care if this flag is support for gcc.
# https://github.com/PaddlePaddle/Paddle/issues/12773
if
(
NOT WIN32
)
set
(
COMMON_FLAGS
-fPIC
-fno-omit-frame-pointer
-Werror
-Wall
-Wextra
-Wnon-virtual-dtor
...
...
@@ -114,11 +118,6 @@ set(COMMON_FLAGS
-Wno-error=terminate
# Warning in PADDLE_ENFORCE
)
# https://github.com/PaddlePaddle/Paddle/issues/12773
if
(
NOT WIN32
)
list
(
APPEND COMMON_FLAGS -Werror
)
endif
()
set
(
GPU_COMMON_FLAGS
-fPIC
-fno-omit-frame-pointer
...
...
@@ -133,18 +132,28 @@ set(GPU_COMMON_FLAGS
-Wno-error=array-bounds
# Warnings in Eigen::array
)
else
(
NOT WIN32
)
set
(
COMMON_FLAGS
"/w"
)
#disable all warnings
set
(
GPU_COMMON_FLAGS
"/w"
)
#disable all warnings
endif
(
NOT WIN32
)
if
(
APPLE
)
if
(
NOT CMAKE_CROSSCOMPILING
)
# On Mac OS X build fat binaries with x86_64 architectures by default.
set
(
CMAKE_OSX_ARCHITECTURES
"x86_64"
CACHE STRING
"Build architectures for OSX"
FORCE
)
endif
()
else
()
endif
(
APPLE
)
if
(
LINUX
)
set
(
GPU_COMMON_FLAGS
-Wall
-Wextra
-Werror
${
GPU_COMMON_FLAGS
}
)
endif
()
endif
(
LINUX
)
if
(
UNIX AND NOT APPLE
)
# except apple from nix*Os family
...
...
cmake/inference_lib.cmake
浏览文件 @
26dbe35c
...
...
@@ -31,10 +31,33 @@ function(copy TARGET)
foreach
(
index RANGE
${
len
}
)
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
()
#string(REPLACE ";" " " src_files ${src_files})
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
dst
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
"
${
src
}
"
"
${
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
()
else
()
# not windows
add_custom_command
(
TARGET
${
TARGET
}
PRE_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
dst
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
src_files
}
"
"
${
dst
}
"
COMMENT
"copying
${
src
}
->
${
dst
}
"
)
endif
(
WIN32
)
endforeach
()
endfunction
()
...
...
paddle/fluid/operators/CMakeLists.txt
浏览文件 @
26dbe35c
...
...
@@ -85,7 +85,7 @@ function(op_library TARGET)
#remove windows unsupported op
if
(
WIN32
)
foreach
(
windows_unsupport_op
"nccl_op"
"gen_nccl_id_op"
"warpctc_op"
)
foreach
(
windows_unsupport_op
"nccl_op"
"gen_nccl_id_op"
"warpctc_op"
"hierarchical_sigmoid_op"
)
if
(
"
${
TARGET
}
"
STREQUAL
"
${
windows_unsupport_op
}
"
)
return
()
endif
()
...
...
paddle/fluid/operators/math/CMakeLists.txt
浏览文件 @
26dbe35c
...
...
@@ -51,7 +51,9 @@ math_library(sequence_padding)
math_library
(
sequence_pooling DEPS math_function
)
math_library
(
sequence_scale
)
math_library
(
softmax DEPS math_function
)
if
(
NOT WIN32
)
math_library
(
matrix_bit_code
)
endif
(
NOT WIN32
)
math_library
(
unpooling
)
math_library
(
vol2col
)
...
...
paddle/fluid/operators/math/matrix_bit_code.h
浏览文件 @
26dbe35c
...
...
@@ -67,31 +67,31 @@ inline constexpr size_t FindLastSet(size_t x) {
:
(
std
::
is_same
<
size_t
,
unsigned
long
>::
value
// NOLINT
?
(
x
?
8
*
sizeof
(
x
)
-
__builtin_clzl
(
x
)
:
0
)
:
(
x
?
8
*
sizeof
(
x
)
-
__builtin_clzll
(
x
)
:
0
));
#else
// windows don't have built-in clz, ctz function
template
<
typename
T
>
unint32_t
__inline
ctz
(
const
T
&
value
)
{
inline
int
ctz
(
const
T
&
value
)
{
DWORD
trailing_zero
=
0
;
if
(
_BitScanForward
(
&
trailing_zero
,
value
))
{
return
static_cast
<
unint32_
t
>
(
trailing_zero
);
return
static_cast
<
in
t
>
(
trailing_zero
);
}
else
{
return
static_cast
<
unint32_
t
>
(
0
);
return
static_cast
<
in
t
>
(
0
);
}
}
template
<
typename
T
>
unint32_t
__inline
clz
(
const
T
&
value
)
{
inline
int
clz
(
const
T
&
value
)
{
DWORD
leadning_zero
=
0
;
if
(
_BitScanReverse
(
&
leadning_zero
,
value
))
{
return
s
izeof
(
T
)
*
8
-
leadning_zero
;
return
s
tatic_cast
<
int
>
(
sizeof
(
T
)
*
8
-
leadning_zero
)
;
}
else
{
return
static_cast
<
unint32_
t
>
(
0
);
return
static_cast
<
in
t
>
(
0
);
}
}
template
<
typename
T
>
inline
size_t
FindLastSet
(
const
T
&
x
)
{
return
sizeof
(
T
)
*
8
-
clz
(
x
);
inline
size_t
FindLastSet
(
size_t
x
)
{
return
sizeof
(
size_t
)
*
8
-
clz
(
x
);
}
#endif // !_WIN32
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录