Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
87cd5536
提交
87cd5536
authored
5月 17, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add second batch of changes and bump the cache versions.
上级
e2fb6451
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
14 行增加
和
18 行删除
+14
-18
__init__.py
theano/gpuarray/__init__.py
+1
-1
basic_ops.py
theano/gpuarray/basic_ops.py
+4
-4
elemwise.py
theano/gpuarray/elemwise.py
+2
-2
extra_ops.py
theano/gpuarray/extra_ops.py
+2
-5
nerv.py
theano/gpuarray/nerv.py
+1
-1
subtensor.py
theano/gpuarray/subtensor.py
+4
-5
没有找到文件。
theano/gpuarray/__init__.py
浏览文件 @
87cd5536
...
@@ -42,7 +42,7 @@ register_transfer(transfer)
...
@@ -42,7 +42,7 @@ register_transfer(transfer)
def
init_dev
(
dev
,
name
=
None
):
def
init_dev
(
dev
,
name
=
None
):
v
=
pygpu
.
gpuarray
.
api_version
()
v
=
pygpu
.
gpuarray
.
api_version
()
expected
=
-
999
8
expected
=
-
999
7
if
v
[
0
]
!=
expected
:
if
v
[
0
]
!=
expected
:
raise
RuntimeError
(
"Wrong major API version for gpuarray:"
,
v
[
0
],
raise
RuntimeError
(
"Wrong major API version for gpuarray:"
,
v
[
0
],
"Make sure Theano and libgpuarray/pygpu "
"Make sure Theano and libgpuarray/pygpu "
...
...
theano/gpuarray/basic_ops.py
浏览文件 @
87cd5536
...
@@ -259,14 +259,14 @@ class GpuKernelBase(object):
...
@@ -259,14 +259,14 @@ class GpuKernelBase(object):
int types[
%(numargs)
u] = {
%(types)
s};
int types[
%(numargs)
u] = {
%(types)
s};
const char *bcode =
%(bvar)
s;
const char *bcode =
%(bvar)
s;
size_t sz = sizeof(
%(bvar)
s);
size_t sz = sizeof(
%(bvar)
s);
if (GpuKernel_init(&
%(ovar)
s,
%(ctx)
s->
ops,
%(ctx)
s->
ctx, 1, &bcode, &sz,
if (GpuKernel_init(&
%(ovar)
s,
%(ctx)
s->ctx, 1, &bcode, &sz,
"
%(kname)
s",
%(numargs)
u, types, GA_USE_BINARY, NULL)
"
%(kname)
s",
%(numargs)
u, types, GA_USE_BINARY, NULL)
!= GA_NO_ERROR) {
!= GA_NO_ERROR) {
if ((err = GpuKernel_init(&
%(ovar)
s,
%(ctx)
s->
ops,
%(ctx)
s->
ctx, 1,
if ((err = GpuKernel_init(&
%(ovar)
s,
%(ctx)
s->ctx, 1,
&
%(cname)
s, NULL, "
%(kname)
s",
%(numargs)
u,
&
%(cname)
s, NULL, "
%(kname)
s",
%(numargs)
u,
types,
%(flags)
s, NULL)) != GA_NO_ERROR) {
types,
%(flags)
s, NULL)) != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, "GpuKernel_init error
%%
d:
%%
s",
PyErr_Format(PyExc_RuntimeError, "GpuKernel_init error
%%
d:
%%
s",
err,
Gpu_error(
%(ctx)
s->ops,
%(ctx)
s->ctx, err));
err,
gpucontext_error(
%(ctx)
s->ctx, err));
%(fail)
s
%(fail)
s
}
}
}
}
...
@@ -310,7 +310,7 @@ class GpuKernelBase(object):
...
@@ -310,7 +310,7 @@ class GpuKernelBase(object):
The node that we need the cache version for.
The node that we need the cache version for.
"""
"""
return
(
3
,
self
.
get_params
(
node
)
.
bin_id
)
return
(
4
,
self
.
get_params
(
node
)
.
bin_id
)
class
HostFromGpu
(
Op
):
class
HostFromGpu
(
Op
):
...
...
theano/gpuarray/elemwise.py
浏览文件 @
87cd5536
...
@@ -199,7 +199,7 @@ class GpuElemwise(HideC, Elemwise):
...
@@ -199,7 +199,7 @@ class GpuElemwise(HideC, Elemwise):
typecode
=
o
.
type
.
typecode
)
typecode
=
o
.
type
.
typecode
)
res
+=
"""
res
+=
"""
ge = GpuElemwise_new(
%(ctx)
s->
ops,
%(ctx)
s->
ctx,
%(support)
s,
%(kop)
s,
%(nargs)
s, args,
%(nd)
s, 0);
ge = GpuElemwise_new(
%(ctx)
s->ctx,
%(support)
s,
%(kop)
s,
%(nargs)
s, args,
%(nd)
s, 0);
if (ge == NULL) {
if (ge == NULL) {
PyErr_SetString(PyExc_RuntimeError, "Could not initialize elemwise support");
PyErr_SetString(PyExc_RuntimeError, "Could not initialize elemwise support");
%(fail)
s
%(fail)
s
...
@@ -360,7 +360,7 @@ class GpuElemwise(HideC, Elemwise):
...
@@ -360,7 +360,7 @@ class GpuElemwise(HideC, Elemwise):
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
ver
=
self
.
scalar_op
.
c_code_cache_version
()
ver
=
self
.
scalar_op
.
c_code_cache_version
()
if
ver
:
if
ver
:
return
(
6
,
ver
)
return
(
7
,
ver
)
else
:
else
:
return
ver
return
ver
...
...
theano/gpuarray/extra_ops.py
浏览文件 @
87cd5536
...
@@ -26,11 +26,8 @@ class GpuCumsum(GpuKernelBase, Op):
...
@@ -26,11 +26,8 @@ class GpuCumsum(GpuKernelBase, Op):
def
__init__
(
self
,
axis
):
def
__init__
(
self
,
axis
):
self
.
axis
=
axis
self
.
axis
=
axis
def
__str__
(
self
):
def
c_code_cache_version
(
self
):
return
"
%
s{
%
s}"
%
(
self
.
__class__
.
__name__
,
self
.
axis
)
return
(
2
,)
def
c_code_cache_version_apply
(
self
,
node
):
return
(
1
,)
def
c_headers
(
self
):
def
c_headers
(
self
):
return
[
'<numpy_compat.h>'
,
'<gpuarray/types.h>'
,
'<gpuarray_helper.h>'
]
return
[
'<numpy_compat.h>'
,
'<gpuarray/types.h>'
,
'<gpuarray_helper.h>'
]
...
...
theano/gpuarray/nerv.py
浏览文件 @
87cd5536
...
@@ -105,7 +105,7 @@ class Gemm16(COp):
...
@@ -105,7 +105,7 @@ class Gemm16(COp):
return
"""
return
"""
bcode = bin_
%(name)
s;
bcode = bin_
%(name)
s;
sz = sizeof(bin_
%(name)
s);
sz = sizeof(bin_
%(name)
s);
if (GpuKernel_init(&k_
%(name)
s, c->
ops, c->
ctx, 1, &bcode, &sz,
if (GpuKernel_init(&k_
%(name)
s, c->ctx, 1, &bcode, &sz,
"hgemm_
%(name)
s", 13, types, GA_USE_BINARY, NULL)
"hgemm_
%(name)
s", 13, types, GA_USE_BINARY, NULL)
!= GA_NO_ERROR) {
!= GA_NO_ERROR) {
PyErr_SetString(PyExc_RuntimeError, "Could not initialize kernel
%(name)
s");
PyErr_SetString(PyExc_RuntimeError, "Could not initialize kernel
%(name)
s");
...
...
theano/gpuarray/subtensor.py
浏览文件 @
87cd5536
...
@@ -340,7 +340,7 @@ class GpuIncSubtensor(IncSubtensor):
...
@@ -340,7 +340,7 @@ class GpuIncSubtensor(IncSubtensor):
args[1].name = "b";
args[1].name = "b";
args[1].typecode =
%(type2)
s;
args[1].typecode =
%(type2)
s;
args[1].flags = GE_READ;
args[1].flags = GE_READ;
iadd = GpuElemwise_new(
%(ctx)
s->
ops,
%(ctx)
s->
ctx, "", "a += b",
iadd = GpuElemwise_new(
%(ctx)
s->ctx, "", "a += b",
2, args,
%(nd)
s, 0);
2, args,
%(nd)
s, 0);
if (iadd == NULL) {
if (iadd == NULL) {
PyErr_SetString(PyExc_RuntimeError, "Could not intialize inplace add support");
PyErr_SetString(PyExc_RuntimeError, "Could not intialize inplace add support");
...
@@ -369,7 +369,7 @@ class GpuIncSubtensor(IncSubtensor):
...
@@ -369,7 +369,7 @@ class GpuIncSubtensor(IncSubtensor):
parent_version
=
super
(
GpuIncSubtensor
,
self
)
.
c_code_cache_version
()
parent_version
=
super
(
GpuIncSubtensor
,
self
)
.
c_code_cache_version
()
if
not
parent_version
:
if
not
parent_version
:
return
return
return
parent_version
+
(
5
,)
return
parent_version
+
(
6
,)
class
GpuAdvancedSubtensor1
(
HideC
,
tensor
.
AdvancedSubtensor1
):
class
GpuAdvancedSubtensor1
(
HideC
,
tensor
.
AdvancedSubtensor1
):
...
@@ -437,8 +437,7 @@ if (err != GA_NO_ERROR) {
...
@@ -437,8 +437,7 @@ if (err != GA_NO_ERROR) {
if (err == GA_VALUE_ERROR) {
if (err == GA_VALUE_ERROR) {
PyErr_SetString(PyExc_IndexError, "Index out of bounds.");
PyErr_SetString(PyExc_IndexError, "Index out of bounds.");
} else {
} else {
PyErr_SetString(PyExc_RuntimeError, Gpu_error(
%(v)
s->context->ops,
PyErr_SetString(PyExc_RuntimeError, GpuArray_error(&
%(v)
s->ga, err));
%(v)
s->context->ctx, err));
}
}
%(fail)
s
%(fail)
s
}
}
...
@@ -589,7 +588,7 @@ class GpuAdvancedIncSubtensor1_dev20(GpuKernelBase, GpuAdvancedIncSubtensor1):
...
@@ -589,7 +588,7 @@ class GpuAdvancedIncSubtensor1_dev20(GpuKernelBase, GpuAdvancedIncSubtensor1):
return
super
(
GpuAdvancedIncSubtensor1_dev20
,
self
)
.
perform
(
node
,
inp
,
out
)
return
super
(
GpuAdvancedIncSubtensor1_dev20
,
self
)
.
perform
(
node
,
inp
,
out
)
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
6
,)
return
(
7
,)
def
c_headers
(
self
):
def
c_headers
(
self
):
return
[
'<numpy_compat.h>'
,
'<gpuarray_helper.h>'
,
return
[
'<numpy_compat.h>'
,
'<gpuarray_helper.h>'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论