Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NiuTrans.Tensor
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
8
Issues
8
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
NiuTrans
NiuTrans.Tensor
Commits
ee86e91d
Commit
ee86e91d
authored
Aug 05, 2019
by
张裕浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update PTX code according to cuda10 documentation.
parent
44683b39
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
21 行删除
+21
-21
source/tensor/core/reduce/ReduceMax.cu
+10
-10
source/tensor/core/reduce/ReduceSum.cu
+10
-10
source/tensor/function/Softmax.cu
+1
-1
没有找到文件。
source/tensor/core/reduce/ReduceMax.cu
查看文件 @
ee86e91d
...
...
@@ -41,19 +41,19 @@ float shflDownReduceMax(float input)
"{"
".reg .f32 r0;"
".reg .pred p;"
"shfl.
down.b32 r0, %1, 0x10, 0x1
f;"
"shfl.
sync.down.b32 r0, %1, 0x10, 0x1f,0xfffffff
f;"
"setp.lt.f32 p,%1,r0;"
"@p mov.f32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x8, 0x
f;"
"shfl.
sync.down.b32 r0, %1, 0x8, 0xf,0xfffffff
f;"
"setp.lt.f32 p,%1,r0;"
"@p mov.f32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x4, 0x7
;"
"shfl.
sync.down.b32 r0, %1, 0x4, 0x7,0xffffffff
;"
"setp.lt.f32 p,%1,r0;"
"@p mov.f32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x2, 0x3
;"
"shfl.
sync.down.b32 r0, %1, 0x2, 0x3,0xffffffff
;"
"setp.lt.f32 p,%1,r0;"
"@p mov.f32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x1, 0x1
;"
"shfl.
sync.down.b32 r0, %1, 0x1, 0x1,0xffffffff
;"
"setp.lt.f32 p, %1, r0; "
"@p mov.f32 %1,r0;"
"mov.f32 %0,%1;"
...
...
@@ -73,19 +73,19 @@ int shflDownReduceMax(int input)
"{"
".reg .s32 r0;"
".reg .pred p;"
"shfl.
down.b32 r0, %1, 0x10, 0x1
f;"
"shfl.
sync.down.b32 r0, %1, 0x10, 0x1f,0xfffffff
f;"
"setp.lt.s32 p,%1,r0;"
"@p mov.s32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x8, 0x
f;"
"shfl.
sync.down.b32 r0, %1, 0x8, 0xf,0xfffffff
f;"
"setp.lt.s32 p,%1,r0;"
"@p mov.s32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x4, 0x7
;"
"shfl.
sync.down.b32 r0, %1, 0x4, 0x7,0xffffffff
;"
"setp.lt.s32 p,%1,r0;"
"@p mov.s32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x2, 0x3
;"
"shfl.
sync.down.b32 r0, %1, 0x2, 0x3,0xffffffff
;"
"setp.lt.s32 p,%1,r0;"
"@p mov.s32 %1,r0;"
"shfl.
down.b32 r0, %1, 0x1, 0x1
;"
"shfl.
sync.down.b32 r0, %1, 0x1, 0x1,0xffffffff
;"
"setp.lt.s32 p, %1, r0; "
"@p mov.s32 %1,r0;"
"mov.s32 %0,%1;"
...
...
source/tensor/core/reduce/ReduceSum.cu
查看文件 @
ee86e91d
...
...
@@ -37,15 +37,15 @@ float shflDownReduceSum(float input)
asm volatile(
"{"
".reg .f32 r0;"
"shfl.
down.b32 r0, %1, 0x10, 0x1
f;"
"shfl.
sync.down.b32 r0, %1, 0x10, 0x1f,0xfffffff
f;"
"add.f32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x8, 0x
f;"
"shfl.
sync.down.b32 r0, %1, 0x8, 0xf,0xfffffff
f;"
"add.f32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x4, 0x7
;"
"shfl.
sync.down.b32 r0, %1, 0x4, 0x7,0xffffffff
;"
"add.f32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x2, 0x3
;"
"shfl.
sync.down.b32 r0, %1, 0x2, 0x3,0xffffffff
;"
"add.f32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x1, 0x1
;"
"shfl.
sync.down.b32 r0, %1, 0x1, 0x1,0xffffffff
;"
"add.f32 %0, r0, %1;"
"}"
: "=f"(output) : "f"(input));
...
...
@@ -62,15 +62,15 @@ int shflDownReduceSum(int input)
asm volatile(
"{"
".reg .s32 r0;"
"shfl.
down.b32 r0, %1, 0x10, 0x1
f;"
"shfl.
sync.down.b32 r0, %1, 0x10, 0x1f,0xfffffff
f;"
"add.s32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x8, 0x
f;"
"shfl.
sync.down.b32 r0, %1, 0x8, 0xf,0xfffffff
f;"
"add.s32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x4, 0x7
;"
"shfl.
sync.down.b32 r0, %1, 0x4, 0x7,0xffffffff
;"
"add.s32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x2, 0x3
;"
"shfl.
sync.down.b32 r0, %1, 0x2, 0x3,0xffffffff
;"
"add.s32 %1, r0, %1;"
"shfl.
down.b32 r0, %1, 0x1, 0x1
;"
"shfl.
sync.down.b32 r0, %1, 0x1, 0x1,0xffffffff
;"
"add.s32 %0, r0, %1;"
"}"
: "=r"(output) : "r"(input));
...
...
source/tensor/function/Softmax.cu
查看文件 @
ee86e91d
...
...
@@ -171,7 +171,7 @@ float broadcast(float input)
float output;
asm(
"{"
"shfl.
idx.b32 %0,%1,0x0,0x1
f;"
"shfl.
sync.idx.b32 %0,%1,0x0,0x1f,0xfffffff
f;"
"}"
:"=f"(output) : "f"(input)
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论