Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
2beaf3aa
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2beaf3aa
编写于
9月 05, 2017
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
auto find .cc or .cu in operator/CMakeLists.txt
上级
020e45f7
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
30 deletion
+24
-30
paddle/operators/CMakeLists.txt
paddle/operators/CMakeLists.txt
+24
-30
未找到文件。
paddle/operators/CMakeLists.txt
浏览文件 @
2beaf3aa
...
...
@@ -14,6 +14,15 @@ function(op_library TARGET)
cmake_parse_arguments
(
op_library
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
list
(
LENGTH op_library_SRCS op_library_SRCS_len
)
if
(
${
op_library_SRCS_len
}
EQUAL 0
)
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
TARGET
}
.cc
)
list
(
APPEND cc_srcs
${
TARGET
}
.cc
)
endif
()
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
TARGET
}
.cu
)
list
(
APPEND cu_srcs
${
TARGET
}
.cc
)
endif
()
else
()
foreach
(
src
${
op_library_SRCS
}
)
if
(
${
src
}
MATCHES
".*
\\
.cu$"
)
list
(
APPEND cu_srcs
${
src
}
)
...
...
@@ -23,18 +32,13 @@ function(op_library TARGET)
message
(
FATAL_ERROR
"
${
TARGET
}
Source file
${
src
}
should only be .cc or .cu"
)
endif
()
endforeach
()
endif
()
list
(
LENGTH cc_srcs cc_srcs_len
)
if
(
${
cc_srcs_len
}
EQUAL 0
)
message
(
FATAL_ERROR
"The op library
${
TARGET
}
should contains at least one .cc file"
)
endif
()
list
(
LENGTH cu_srcs cu_srcs_len
)
list
(
LENGTH op_library_DEPS dep_len
)
if
(
${
cu_srcs_len
}
EQUAL 0 AND
${
dep_len
}
EQUAL 0
)
message
(
WARNING
"The op library
${
TARGET
}
not support GPU!"
)
endif
()
if
(
WITH_GPU
)
nv_library
(
${
TARGET
}
SRCS
${
cc_srcs
}
${
cu_srcs
}
DEPS
${
op_library_DEPS
}
${
op_common_deps
}
)
...
...
@@ -46,32 +50,22 @@ endfunction()
add_subdirectory
(
math
)
set
(
ONLYCPU_OPS
net_op
gather_op
scatter_op
)
foreach
(
src
${
ONLYCPU_OPS
}
)
op_library
(
${
src
}
SRCS
${
src
}
.cc
)
endforeach
()
set
(
DEPS_OPS
identity_op
minus_op
mul_op
recurrent_op
scale_op
)
op_library
(
identity_op
SRCS identity_op.cc
DEPS scale_op
)
op_library
(
minus_op
SRCS minus_op.cc minus_op.cu
DEPS scale_op
)
op_library
(
mul_op
SRCS mul_op.cc mul_op.cu
DEPS math_function
)
op_library
(
identity_op DEPS scale_op
)
op_library
(
minus_op DEPS scale_op
)
op_library
(
mul_op DEPS math_function
)
op_library
(
recurrent_op SRCS recurrent_op.cc rnn/recurrent_op_utils.cc
DEPS framework_proto tensor operator net_op
)
op_library
(
scale_op
SRCS scale_op.cc scale_op.cu
DEPS net_op
)
op_library
(
scale_op DEPS net_op
)
list
(
REMOVE_ITEM GENERAL_OPS
${
ONLYCPU_OPS
}
${
DEPS_OPS
}
)
list
(
REMOVE_ITEM GENERAL_OPS
${
DEPS_OPS
}
)
foreach
(
src
${
GENERAL_OPS
}
)
op_library
(
${
src
}
SRCS
${
src
}
.cc
${
src
}
.cu
)
op_library
(
${
src
}
)
endforeach
()
set
(
GLOB_OP_LIB
${
OP_LIBRARY
}
CACHE INTERNAL
"Global OP library"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录