Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
17d8a5e0
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看板
未验证
提交
17d8a5e0
编写于
3月 11, 2022
作者:
F
Feng Xing
提交者:
GitHub
3月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Separate include and macro in kp top level file (#40202)
* format softmax forward * seperate include and macro to two if-else
上级
88c03071
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
22 addition
and
9 deletion
+22
-9
paddle/phi/kernels/primitive/kernel_primitives.h
paddle/phi/kernels/primitive/kernel_primitives.h
+22
-9
未找到文件。
paddle/phi/kernels/primitive/kernel_primitives.h
浏览文件 @
17d8a5e0
...
@@ -13,7 +13,10 @@
...
@@ -13,7 +13,10 @@
// limitations under the License.
// limitations under the License.
#pragma once
#pragma once
#include "paddle/phi/kernels/primitive/helper_primitives.h"
#include "paddle/phi/kernels/primitive/helper_primitives.h"
// macro
#ifdef PADDLE_WITH_XPU_KP
#ifdef PADDLE_WITH_XPU_KP
#define KPStream XPUStream
#define KPStream XPUStream
...
@@ -22,11 +25,6 @@
...
@@ -22,11 +25,6 @@
#define __forceinline__ __inline__
#define __forceinline__ __inline__
#define __restrict__
#define __restrict__
#include "paddle/phi/backends/xpu/xpu_context.h"
#include "paddle/phi/kernels/primitive/compute_primitives_xpu2.h"
#include "paddle/phi/kernels/primitive/datamover_primitives_xpu2.h"
#include "paddle/phi/kernels/primitive/functor_primitives_xpu2.h"
#define THREAD_ID_X core_id()
#define THREAD_ID_X core_id()
#define THREAD_ID_Y 0
#define THREAD_ID_Y 0
#define THREAD_ID_Z 0
#define THREAD_ID_Z 0
...
@@ -42,11 +40,8 @@
...
@@ -42,11 +40,8 @@
#define GRID_NUM_X cluster_num()
#define GRID_NUM_X cluster_num()
#define GRID_NUM_Y 0
#define GRID_NUM_Y 0
#define GRID_NUM_Z 0
#define GRID_NUM_Z 0
#else
#else
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/kernels/primitive/compute_primitives.h"
#include "paddle/phi/kernels/primitive/datamover_primitives.h"
#include "paddle/phi/kernels/primitive/functor_primitives.h"
#define KPStream gpuStream_t
#define KPStream gpuStream_t
#define KPDevice phi::GPUContext
#define KPDevice phi::GPUContext
...
@@ -67,4 +62,22 @@
...
@@ -67,4 +62,22 @@
#define GRID_NUM_X gridDim.x
#define GRID_NUM_X gridDim.x
#define GRID_NUM_Y gridDim.y
#define GRID_NUM_Y gridDim.y
#define GRID_NUM_Z gridDim.z
#define GRID_NUM_Z gridDim.z
#endif
// include file
#ifdef PADDLE_WITH_XPU_KP
#include "paddle/phi/backends/xpu/xpu_context.h"
#include "paddle/phi/kernels/primitive/compute_primitives_xpu2.h"
#include "paddle/phi/kernels/primitive/datamover_primitives_xpu2.h"
#include "paddle/phi/kernels/primitive/functor_primitives_xpu2.h"
#else
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/kernels/primitive/compute_primitives.h"
#include "paddle/phi/kernels/primitive/datamover_primitives.h"
#include "paddle/phi/kernels/primitive/functor_primitives.h"
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录