Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
3a77d027
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3a77d027
编写于
3月 08, 2022
作者:
C
Chen Weihang
提交者:
GitHub
3月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Phi] Remove gpudnn suffix & polish cmake (#40239)
* remove gpudnn suffix & polish cmake * fix typo
上级
9aa6bfc7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
63 deletion
+59
-63
cmake/phi.cmake
cmake/phi.cmake
+59
-63
paddle/phi/kernels/gpudnn/conv_grad_grad_kernel.cu
paddle/phi/kernels/gpudnn/conv_grad_grad_kernel.cu
+0
-0
paddle/phi/kernels/gpudnn/conv_grad_kernel.cu
paddle/phi/kernels/gpudnn/conv_grad_kernel.cu
+0
-0
paddle/phi/kernels/gpudnn/conv_kernel.cu
paddle/phi/kernels/gpudnn/conv_kernel.cu
+0
-0
paddle/phi/kernels/gpudnn/softmax_grad_kernel.cu
paddle/phi/kernels/gpudnn/softmax_grad_kernel.cu
+0
-0
paddle/phi/kernels/gpudnn/softmax_kernel.cu
paddle/phi/kernels/gpudnn/softmax_kernel.cu
+0
-0
未找到文件。
cmake/phi.cmake
浏览文件 @
3a77d027
...
...
@@ -134,8 +134,8 @@ function(kernel_library TARGET)
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/kps/
${
TARGET
}
.cu
)
list
(
APPEND gpu_srcs
${
CMAKE_CURRENT_SOURCE_DIR
}
/kps/
${
TARGET
}
.cu
)
endif
()
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/gpudnn/
${
TARGET
}
_gpudnn
.cu
)
list
(
APPEND gpudnn_srcs
${
CMAKE_CURRENT_SOURCE_DIR
}
/gpudnn/
${
TARGET
}
_gpudnn
.cu
)
if
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/gpudnn/
${
TARGET
}
.cu
)
list
(
APPEND gpudnn_srcs
${
CMAKE_CURRENT_SOURCE_DIR
}
/gpudnn/
${
TARGET
}
.cu
)
endif
()
endif
()
if
(
WITH_XPU
)
...
...
@@ -197,92 +197,88 @@ function(kernel_library TARGET)
# kernel source file level
# level 1: base device kernel
# - cpu_srcs / gpu_srcs / xpu_srcs / kps_srcs
# - cpu_srcs / gpu_srcs / xpu_srcs /
gpudnn_srcs /
kps_srcs
# level 2: device-independent kernel
# - common_srcs
# level 3: Kernel implemented by reusing device-independent kernel
# - selected_rows_srcs
set
(
base_device_kernels
)
set
(
device_independent_kernel
)
set
(
high_level_kernels
)
# Build Target according different src organization
if
((
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
xpu_srcs_len
}
GREATER 0 OR
${
gpudnn_srcs_len
}
GREATER 0 OR
${
kps_srcs_len
}
GREATER 0
)
AND
(
${
common_srcs_len
}
GREATER 0 OR
${
selected_rows_srcs_len
}
GREATER 0
))
# If the common_srcs/selected_rows_srcs depends on specific device srcs, build target using this rule.
# 1. Base device kernel compile
if
(
${
cpu_srcs_len
}
GREATER 0
)
cc_library
(
${
TARGET
}
_cpu SRCS
${
cpu_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
list
(
APPEND base_device_kernels
${
TARGET
}
_cpu
)
endif
()
if
(
${
gpu_srcs_len
}
GREATER 0
)
if
(
WITH_GPU
)
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
gpudnn_srcs_len
}
GREATER 0
)
nv_library
(
${
TARGET
}
_part SRCS
${
cpu_srcs
}
${
gpu_srcs
}
${
gpudnn_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
nv_library
(
${
TARGET
}
SRCS
${
common_srcs
}
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
endif
()
nv_library
(
${
TARGET
}
_gpu SRCS
${
gpu_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
elseif
(
WITH_ROCM
)
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
gpudnn_srcs_len
}
GREATER 0
)
hip_library
(
${
TARGET
}
_part SRCS
${
cpu_srcs
}
${
gpu_srcs
}
${
gpudnn_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
hip_library
(
${
TARGET
}
SRCS
${
common_srcs
}
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
endif
()
elseif
(
WITH_XPU_KP
)
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
xpu_srcs_len
}
GREATER 0 OR
${
kps_srcs_len
}
GREATER 0
)
xpu_library
(
${
TARGET
}
_part SRCS
${
cpu_srcs
}
${
xpu_srcs
}
${
kps_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
xpu_library
(
${
TARGET
}
SRCS
${
common_srcs
}
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
endif
()
else
()
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
xpu_srcs_len
}
GREATER 0
)
cc_library
(
${
TARGET
}
_part SRCS
${
cpu_srcs
}
${
xpu_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
cc_library
(
${
TARGET
}
SRCS
${
common_srcs
}
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
endif
()
hip_library
(
${
TARGET
}
_gpu SRCS
${
gpu_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
endif
()
# If there are only specific device srcs, build target using this rule.
elseif
(
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
xpu_srcs_len
}
GREATER 0 OR
${
gpudnn_srcs_len
}
GREATER 0 OR
${
kps_srcs_len
}
GREATER 0
)
list
(
APPEND base_device_kernels
${
TARGET
}
_gpu
)
endif
()
if
(
${
xpu_srcs_len
}
GREATER 0
)
cc_library
(
${
TARGET
}
_xpu SRCS
${
xpu_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
list
(
APPEND base_device_kernels
${
TARGET
}
_xpu
)
endif
()
if
(
${
gpudnn_srcs_len
}
GREATER 0
)
if
(
WITH_GPU
)
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
gpudnn_srcs_len
}
GREATER 0
)
nv_library
(
${
TARGET
}
SRCS
${
cpu_srcs
}
${
gpu_srcs
}
${
gpudnn_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
endif
()
nv_library
(
${
TARGET
}
_gpudnn SRCS
${
gpudnn_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
elseif
(
WITH_ROCM
)
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
gpudnn_srcs_len
}
GREATER 0
)
hip_library
(
${
TARGET
}
SRCS
${
cpu_srcs
}
${
gpu_srcs
}
${
gpudnn_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
endif
()
elseif
(
WITH_XPU_KP
)
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
xpu_srcs_len
}
GREATER 0 OR
${
kps_srcs_len
}
GREATER 0
)
xpu_library
(
${
TARGET
}
SRCS
${
cpu_srcs
}
${
xpu_srcs
}
${
kps_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
endif
()
else
()
if
(
${
cpu_srcs_len
}
GREATER 0 OR
${
xpu_srcs_len
}
GREATER 0
)
cc_library
(
${
TARGET
}
SRCS
${
cpu_srcs
}
${
xpu_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
endif
()
hip_library
(
${
TARGET
}
_gpudnn SRCS
${
gpudnn_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
endif
()
# If the selected_rows_srcs depends on common_srcs, build target using this rule.
elseif
(
${
common_srcs_len
}
GREATER 0 AND
${
selected_rows_srcs_len
}
GREATER 0
)
list
(
APPEND base_device_kernels
${
TARGET
}
_gpudnn
)
endif
()
if
(
${
kps_srcs_len
}
GREATER 0
)
# only when WITH_XPU_KP, the kps_srcs_len can be > 0
xpu_library
(
${
TARGET
}
_kps SRCS
${
kps_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
list
(
APPEND base_device_kernels
${
TARGET
}
_kps
)
endif
()
# 2. Device-independent kernel compile
if
(
${
common_srcs_len
}
GREATER 0
)
if
(
WITH_GPU
)
nv_library
(
${
TARGET
}
_part SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
nv_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
nv_library
(
${
TARGET
}
_common SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
)
elseif
(
WITH_ROCM
)
hip_library
(
${
TARGET
}
_part SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
hip_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
hip_library
(
${
TARGET
}
_common SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
)
elseif
(
WITH_XPU_KP
)
xpu_library
(
${
TARGET
}
_part SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
xpu_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
xpu_library
(
${
TARGET
}
_common SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
)
else
()
cc_library
(
${
TARGET
}
_part SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
cc_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
TARGET
}
_part
)
cc_library
(
${
TARGET
}
_common SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
)
endif
()
# If there are only common_srcs or selected_rows_srcs, build target using below rules.
elseif
(
${
common_srcs_len
}
GREATER 0
)
list
(
APPEND device_independent_kernel
${
TARGET
}
_common
)
endif
()
# 3. Reusing kernel compile
if
(
${
selected_rows_srcs_len
}
GREATER 0
)
if
(
WITH_GPU
)
nv_library
(
${
TARGET
}
SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
nv_library
(
${
TARGET
}
_sr SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
)
elseif
(
WITH_ROCM
)
hip_library
(
${
TARGET
}
SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
hip_library
(
${
TARGET
}
_sr SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
)
elseif
(
WITH_XPU_KP
)
xpu_library
(
${
TARGET
}
SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
xpu_library
(
${
TARGET
}
_sr SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
)
else
()
cc_library
(
${
TARGET
}
SRCS
${
common_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
)
cc_library
(
${
TARGET
}
_sr SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
)
endif
()
elseif
(
${
selected_rows_srcs_len
}
GREATER 0
)
list
(
APPEND high_level_kernels
${
TARGET
}
_sr
)
endif
()
# 4. Unify target compile
list
(
LENGTH base_device_kernels base_device_kernels_len
)
list
(
LENGTH device_independent_kernel device_independent_kernel_len
)
list
(
LENGTH high_level_kernels high_level_kernels_len
)
if
(
${
base_device_kernels_len
}
GREATER 0 OR
${
device_independent_kernel_len
}
GREATER 0 OR
${
high_level_kernels_len
}
GREATER 0
)
if
(
WITH_GPU
)
nv_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_dep
s
}
)
nv_library
(
${
TARGET
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
${
high_level_kernel
s
}
)
elseif
(
WITH_ROCM
)
hip_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_dep
s
}
)
hip_library
(
${
TARGET
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
${
high_level_kernel
s
}
)
elseif
(
WITH_XPU_KP
)
xpu_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_dep
s
}
)
xpu_library
(
${
TARGET
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
${
high_level_kernel
s
}
)
else
()
cc_library
(
${
TARGET
}
SRCS
${
selected_rows_srcs
}
DEPS
${
kernel_library_DEPS
}
${
kernel_dep
s
}
)
cc_library
(
${
TARGET
}
DEPS
${
kernel_library_DEPS
}
${
kernel_deps
}
${
base_device_kernels
}
${
device_independent_kernel
}
${
high_level_kernel
s
}
)
endif
()
else
()
set
(
target_build_flag 0
)
...
...
paddle/phi/kernels/gpudnn/conv_grad_grad_kernel
_gpudnn
.cu
→
paddle/phi/kernels/gpudnn/conv_grad_grad_kernel.cu
浏览文件 @
3a77d027
文件已移动
paddle/phi/kernels/gpudnn/conv_grad_kernel
_gpudnn
.cu
→
paddle/phi/kernels/gpudnn/conv_grad_kernel.cu
浏览文件 @
3a77d027
文件已移动
paddle/phi/kernels/gpudnn/conv_kernel
_gpudnn
.cu
→
paddle/phi/kernels/gpudnn/conv_kernel.cu
浏览文件 @
3a77d027
文件已移动
paddle/phi/kernels/gpudnn/softmax_grad_kernel
_gpudnn
.cu
→
paddle/phi/kernels/gpudnn/softmax_grad_kernel.cu
浏览文件 @
3a77d027
文件已移动
paddle/phi/kernels/gpudnn/softmax_kernel
_gpudnn
.cu
→
paddle/phi/kernels/gpudnn/softmax_kernel.cu
浏览文件 @
3a77d027
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录