Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c5194587
提交
c5194587
authored
11月 23, 2017
作者:
Frederic Bastien
提交者:
notoraptor
11月 28, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Only use the variable when they exist and are needed.
上级
2fb56225
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
9 行删除
+13
-9
topk_dense.cu
theano/gpuarray/c_code/topk_dense.cu
+1
-5
topk_dense_large.cu
theano/gpuarray/c_code/topk_dense_large.cu
+1
-4
sort.py
theano/gpuarray/sort.py
+11
-0
没有找到文件。
theano/gpuarray/c_code/topk_dense.cu
浏览文件 @
c5194587
...
@@ -21,7 +21,7 @@ extern "C" __global__ void k_topk_dense(
...
@@ -21,7 +21,7 @@ extern "C" __global__ void k_topk_dense(
// ssize_t dsti_strides_0, ssize_t dsti_strides_1, ... , dsti_strides_$${NDIM}
// ssize_t dsti_strides_0, ssize_t dsti_strides_1, ... , dsti_strides_$${NDIM}
ssize_t k,
ssize_t k,
INPUT_TYPE* src,
INPUT_TYPE* src,
size_t src_offset
size_t src_offset
,
$src_strides
$src_strides
// ssize_t src_strides_0, ssize_t src_strides_1, ... , src_strides_$${NDIM}
// ssize_t src_strides_0, ssize_t src_strides_1, ... , src_strides_$${NDIM}
size_t size) {
size_t size) {
...
@@ -33,10 +33,6 @@ extern "C" __global__ void k_topk_dense(
...
@@ -33,10 +33,6 @@ extern "C" __global__ void k_topk_dense(
size_t out_idx;
size_t out_idx;
const unsigned char warp_id = idx / GA_WARP_SIZE;
const unsigned char warp_id = idx / GA_WARP_SIZE;
dstv = ptr_add(dstv, dstv_offset);
dsti = ptr_add(dsti, dsti_offset);
src = ptr_add(src, src_offset);
// 0. get the slice for thread block to work on
// 0. get the slice for thread block to work on
size_t gid = blockIdx.x, gidx;
size_t gid = blockIdx.x, gidx;
...
...
theano/gpuarray/c_code/topk_dense_large.cu
浏览文件 @
c5194587
...
@@ -211,7 +211,7 @@ extern "C" __global__ void KERNEL_NAME(
...
@@ -211,7 +211,7 @@ extern "C" __global__ void KERNEL_NAME(
// ssize_t dsti_strides_0, ssize_t dsti_strides_1, ... , dsti_strides_$${NDIM}
// ssize_t dsti_strides_0, ssize_t dsti_strides_1, ... , dsti_strides_$${NDIM}
ssize_t k,
ssize_t k,
INPUT_TYPE* src,
INPUT_TYPE* src,
size_t src_offset
size_t src_offset
,
$src_strides
$src_strides
// ssize_t src_strides_0, ssize_t src_strides_1, ... , src_strides_$${NDIM}
// ssize_t src_strides_0, ssize_t src_strides_1, ... , src_strides_$${NDIM}
size_t size) {
size_t size) {
...
@@ -222,9 +222,6 @@ extern "C" __global__ void KERNEL_NAME(
...
@@ -222,9 +222,6 @@ extern "C" __global__ void KERNEL_NAME(
k = (order ? k : -k);
k = (order ? k : -k);
const int idx = threadIdx.x;
const int idx = threadIdx.x;
const int warp_id = idx / GA_WARP_SIZE;
const int warp_id = idx / GA_WARP_SIZE;
dstv = ptr_add(dstv, dstv_offset);
dsti = ptr_add(dsti, dsti_offset);
src = ptr_add(src, src_offset);
// get the slice for thread block to work on
// get the slice for thread block to work on
// size <- the axis to work on
// size <- the axis to work on
...
...
theano/gpuarray/sort.py
浏览文件 @
c5194587
...
@@ -77,6 +77,17 @@ class GpuTopKOp(GpuKernelBase, TopKOp):
...
@@ -77,6 +77,17 @@ class GpuTopKOp(GpuKernelBase, TopKOp):
dsti
=
'dsti = ptr_add(dsti, gidx*dsti_strides_
%(i)
d)'
if
self
.
return_indices
else
''
)
dsti
=
'dsti = ptr_add(dsti, gidx*dsti_strides_
%(i)
d)'
if
self
.
return_indices
else
''
)
set_slice_code
=
''
.
join
(
set_slice_code
=
''
.
join
(
set_slice_code
%
dict
(
i
=
j
)
for
j
in
range
(
1
,
ndim
))
set_slice_code
%
dict
(
i
=
j
)
for
j
in
range
(
1
,
ndim
))
if
self
.
return_values
:
set_slice_code
+=
"""
dstv = ptr_add(dstv, dstv_offset);
"""
if
self
.
return_indices
:
set_slice_code
+=
"""
dsti = ptr_add(dsti, dsti_offset);
"""
set_slice_code
+=
"""
src = ptr_add(src, src_offset);
"""
flags
=
Kernel
.
get_flags
(
node
.
inputs
[
0
]
.
dtype
)
flags
=
Kernel
.
get_flags
(
node
.
inputs
[
0
]
.
dtype
)
subs
=
dict
(
subs
=
dict
(
inp_t
=
ga
.
dtype_to_ctype
(
node
.
inputs
[
0
]
.
dtype
),
inp_t
=
ga
.
dtype_to_ctype
(
node
.
inputs
[
0
]
.
dtype
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论