Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
6b3a6a9f
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看板
未验证
提交
6b3a6a9f
编写于
1月 29, 2022
作者:
J
Jack Zhou
提交者:
GitHub
1月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update register_kernels and kernel_library function in pten.cmake (#39259)
上级
9d6e8202
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
4 deletion
+13
-4
cmake/pten.cmake
cmake/pten.cmake
+13
-4
未找到文件。
cmake/pten.cmake
浏览文件 @
6b3a6a9f
...
...
@@ -93,7 +93,7 @@ function(kernel_library TARGET)
set
(
all_srcs
)
set
(
kernel_deps
)
set
(
oneValueArgs
""
)
set
(
oneValueArgs
SUB_DIR
)
set
(
multiValueArgs SRCS DEPS
)
cmake_parse_arguments
(
kernel_library
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
...
...
@@ -135,8 +135,17 @@ function(kernel_library TARGET)
foreach
(
src
${
all_srcs
}
)
file
(
READ
${
src
}
target_content
)
string
(
REGEX MATCHALL
"#include
\"
paddle\/pten\/kernels\/[a-z0-9_]+_kernel.h
\"
"
include_kernels
${
target_content
}
)
if
(
"
${
kernel_library_SUB_DIR
}
"
STREQUAL
""
)
string
(
REGEX MATCHALL
"#include
\"
paddle\/pten\/kernels\/[a-z0-9_]+_kernel.h
\"
"
include_kernels
${
target_content
}
)
else
()
string
(
REGEX MATCHALL
"#include
\"
paddle\/pten\/kernels\/
${
kernel_library_SUB_DIR
}
\/[a-z0-9_]+_kernel.h
\"
"
include_kernels
${
target_content
}
)
endif
()
foreach
(
include_kernel
${
include_kernels
}
)
if
(
"
${
kernel_library_SUB_DIR
}
"
STREQUAL
""
)
string
(
REGEX REPLACE
"#include
\"
paddle\/pten\/kernels\/"
""
kernel_name
${
include_kernel
}
)
else
()
string
(
REGEX REPLACE
"#include
\"
paddle\/pten\/kernels\/
${
kernel_library_SUB_DIR
}
\/"
""
kernel_name
${
include_kernel
}
)
endif
()
string
(
REGEX REPLACE
".h
\"
"
""
kernel_name
${
kernel_name
}
)
list
(
APPEND kernel_deps
${
kernel_name
}
)
endforeach
()
...
...
@@ -250,7 +259,7 @@ endfunction()
function
(
register_kernels
)
set
(
options
""
)
set
(
oneValueArgs
""
)
set
(
oneValueArgs
SUB_DIR
)
set
(
multiValueArgs EXCLUDES DEPS
)
cmake_parse_arguments
(
register_kernels
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
...
...
@@ -263,9 +272,9 @@ function(register_kernels)
list
(
FIND register_kernels_EXCLUDES
${
target
}
_index
)
if
(
${
_index
}
EQUAL -1
)
if
(
${
register_kernels_DEPS_len
}
GREATER 0
)
kernel_library
(
${
target
}
DEPS
${
register_kernels_DEPS
}
)
kernel_library
(
${
target
}
DEPS
${
register_kernels_DEPS
}
SUB_DIR
${
register_kernels_SUB_DIR
}
)
else
()
kernel_library
(
${
target
}
)
kernel_library
(
${
target
}
SUB_DIR
${
register_kernels_SUB_DIR
}
)
endif
()
endif
()
endforeach
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录