Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5c820ac3
提交
5c820ac3
authored
8月 17, 2017
作者:
Arnaud Bergeron
提交者:
Frederic Bastien
9月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some fixes for incsub1_dev20
上级
356c7718
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
14 行删除
+16
-14
subtensor.py
theano/gpuarray/subtensor.py
+16
-14
没有找到文件。
theano/gpuarray/subtensor.py
浏览文件 @
5c820ac3
...
@@ -353,7 +353,7 @@ int sub_setarray(GpuArray *dst, GpuArray *src) {
...
@@ -353,7 +353,7 @@ int sub_setarray(GpuArray *dst, GpuArray *src) {
int err;
int err;
err = GpuArray_setarray(dst, src);
err = GpuArray_setarray(dst, src);
if (err != GA_NO_ERROR)
if (err != GA_NO_ERROR)
PyErr_SetString(PyExc_RuntimeError,
"setarray failed"
);
PyErr_SetString(PyExc_RuntimeError,
GpuArray_error(src, err)
);
return err;
return err;
}
}
"""
"""
...
@@ -1126,27 +1126,28 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of
...
@@ -1126,27 +1126,28 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of
const ga_size numColsX,
const ga_size numColsX,
const ga_ssize stridesX0,
const ga_ssize stridesX0,
const ga_ssize stridesX1,
const ga_ssize stridesX1,
%(type_x)
s *X,
GLOBAL_MEM
%(type_x)
s *X,
const ga_size offset_X,
const ga_size offset_X,
const ga_size numRowsY,
const ga_size numRowsY,
const ga_size numColsY,
const ga_size numColsY,
const ga_ssize stridesY0,
const ga_ssize stridesY0,
const ga_ssize stridesY1,
const ga_ssize stridesY1,
%(type_y)
s *Y,
GLOBAL_MEM
%(type_y)
s *Y,
const ga_size offset_Y,
const ga_size offset_Y,
const ga_size numIndices,
const ga_size numIndices,
const ga_ssize stridesIndices,
const ga_ssize stridesIndices,
%(type_ind)
s *indices_arr,
GLOBAL_MEM
%(type_ind)
s *indices_arr,
const ga_size offset_indices_arr,
const ga_size offset_indices_arr,
const int set_instead_of_inc,
const
ga_
int set_instead_of_inc,
ga_int *err)
GLOBAL_MEM
ga_int *err)
{
{
X = (
%(type_x)
s *)(((char *)X)+offset_X);
X = (GLOBAL_MEM
%(type_x)
s *)(((GLOBAL_MEM char *)X)+offset_X);
Y = (
%(type_y)
s *)(((char *)Y)+offset_Y);
Y = (GLOBAL_MEM
%(type_y)
s *)(((GLOBAL_MEM char *)Y)+offset_Y);
indices_arr = (
%(type_ind)
s *)(((char *)indices_arr)+offset_indices_arr);
indices_arr = (GLOBAL_MEM
%(type_ind)
s *)(((GLOBAL_MEM char *)indices_arr)+offset_indices_arr);
for (int i = (blockIdx.x); i < numIndices; i += gridDim.x)
for (ga_int i = GID_0; i < numIndices; i += GDIM_0)
{
{
for
(int j = (threadIdx.x); j < numColsX;j += blockDim.x
)
for
(ga_int j = LID_0; j < numColsX; j += LDIM_0
)
{
{
ga_ssize x_row = indices_arr[i * stridesIndices];
ga_ssize x_row = indices_arr[i * stridesIndices];
if (x_row < 0)
if (x_row < 0)
...
@@ -1169,10 +1170,11 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of
...
@@ -1169,10 +1170,11 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of
}
}
"""
%
dict
(
type_x
=
type_x
,
type_y
=
type_y
,
type_ind
=
type_ind
,
"""
%
dict
(
type_x
=
type_x
,
type_y
=
type_y
,
type_ind
=
type_ind
,
tc
=
np
.
dtype
(
dtype_x
)
.
char
)
tc
=
np
.
dtype
(
dtype_x
)
.
char
)
from
pygpu.gpuarray
import
SIZE
,
SSIZE
params
=
[
params
=
[
'uintp'
,
'uintp'
,
'intp'
,
'intp'
,
gpuarray
.
GpuArray
,
'uintp'
,
SIZE
,
SIZE
,
SSIZE
,
SSIZE
,
gpuarray
.
GpuArray
,
SIZE
,
'uintp'
,
'uintp'
,
'intp'
,
'intp'
,
gpuarray
.
GpuArray
,
'uintp'
,
SIZE
,
SIZE
,
SSIZE
,
SSIZE
,
gpuarray
.
GpuArray
,
SIZE
,
'uintp'
,
'intp'
,
gpuarray
.
GpuArray
,
'uintp'
,
'int
'
,
SIZE
,
SSIZE
,
gpuarray
.
GpuArray
,
SIZE
,
'int32
'
,
gpuarray
.
GpuArray
]
gpuarray
.
GpuArray
]
return
[
Kernel
(
code
=
code
,
name
=
kname
,
params
=
params
,
return
[
Kernel
(
code
=
code
,
name
=
kname
,
params
=
params
,
flags
=
flags
,
objvar
=
k_var
)]
flags
=
flags
,
objvar
=
k_var
)]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论