Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
80130a95
提交
80130a95
authored
9月 17, 2012
作者:
Ian Goodfellow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added op_guard calls to some methods I overlooked
上级
4d4bc1f5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
+5
-0
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+5
-0
没有找到文件。
theano/sandbox/cuda/basic_ops.py
浏览文件 @
80130a95
...
@@ -923,6 +923,7 @@ class GpuCAReduce(GpuOp):
...
@@ -923,6 +923,7 @@ class GpuCAReduce(GpuOp):
#Threads must be organized as: threadNum%nb_reduce correspond to the same sum
#Threads must be organized as: threadNum%nb_reduce correspond to the same sum
#nb_reduce<=warpSize
#nb_reduce<=warpSize
def
_k_reduce_buf_multiple
(
self
,
z_pos
,
nb_reduce
):
def
_k_reduce_buf_multiple
(
self
,
z_pos
,
nb_reduce
):
self
.
_op_guard
()
return
"""
return
"""
__syncthreads(); // some kernel do multiple reduction.
__syncthreads(); // some kernel do multiple reduction.
buf[threadNum] = mysum;
buf[threadNum] = mysum;
...
@@ -947,6 +948,7 @@ class GpuCAReduce(GpuOp):
...
@@ -947,6 +948,7 @@ class GpuCAReduce(GpuOp):
is for the case where we are reducing on all axes and x is
is for the case where we are reducing on all axes and x is
C contiguous.
C contiguous.
"""
"""
self
.
_op_guard
()
print
>>
sio
,
"""
print
>>
sio
,
"""
{
{
if(CudaNdarray_SIZE(
%(x)
s)==0){
if(CudaNdarray_SIZE(
%(x)
s)==0){
...
@@ -986,6 +988,7 @@ class GpuCAReduce(GpuOp):
...
@@ -986,6 +988,7 @@ class GpuCAReduce(GpuOp):
"""
%
locals
()
"""
%
locals
()
def
c_code_reduce_1
(
self
,
sio
,
node
,
name
,
x
,
z
,
fail
):
def
c_code_reduce_1
(
self
,
sio
,
node
,
name
,
x
,
z
,
fail
):
self
.
_op_guard
()
makecall
=
self
.
_makecall
(
node
,
name
,
x
,
z
,
fail
)
makecall
=
self
.
_makecall
(
node
,
name
,
x
,
z
,
fail
)
print
>>
sio
,
"""
print
>>
sio
,
"""
{
{
...
@@ -999,6 +1002,7 @@ class GpuCAReduce(GpuOp):
...
@@ -999,6 +1002,7 @@ class GpuCAReduce(GpuOp):
"""
%
locals
()
"""
%
locals
()
def
c_code_reduce_11
(
self
,
sio
,
node
,
name
,
x
,
z
,
fail
):
def
c_code_reduce_11
(
self
,
sio
,
node
,
name
,
x
,
z
,
fail
):
self
.
_op_guard
()
makecall
=
self
.
_makecall
(
node
,
name
,
x
,
z
,
fail
)
makecall
=
self
.
_makecall
(
node
,
name
,
x
,
z
,
fail
)
print
>>
sio
,
"""
print
>>
sio
,
"""
{
{
...
@@ -1021,6 +1025,7 @@ class GpuCAReduce(GpuOp):
...
@@ -1021,6 +1025,7 @@ class GpuCAReduce(GpuOp):
:param N: the number of 1 in the pattern N=1 -> 01, N=2 -> 011 N=3 ->0111
:param N: the number of 1 in the pattern N=1 -> 01, N=2 -> 011 N=3 ->0111
Work for N=1,2,3
Work for N=1,2,3
"""
"""
self
.
_op_guard
()
assert
N
in
[
1
,
2
,
3
]
assert
N
in
[
1
,
2
,
3
]
makecall
=
self
.
_makecall
(
node
,
name
,
x
,
z
,
fail
)
makecall
=
self
.
_makecall
(
node
,
name
,
x
,
z
,
fail
)
N_pattern
=
''
.
join
([
'1'
]
*
N
)
N_pattern
=
''
.
join
([
'1'
]
*
N
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论