Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f7596c63
提交
f7596c63
authored
12月 01, 2016
作者:
Arnaud Bergeron
提交者:
Frederic Bastien
12月 22, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix compile problems.
上级
02a7bc1a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
8 行增加
和
10 行删除
+8
-10
__init__.py
theano/gpuarray/__init__.py
+3
-5
dnn_fwd.c
theano/gpuarray/dnn_fwd.c
+2
-2
dnn_gi.c
theano/gpuarray/dnn_gi.c
+1
-1
dnn_gw.c
theano/gpuarray/dnn_gw.c
+2
-2
没有找到文件。
theano/gpuarray/__init__.py
浏览文件 @
f7596c63
...
@@ -69,9 +69,6 @@ def init_dev(dev, name=None):
...
@@ -69,9 +69,6 @@ def init_dev(dev, name=None):
pcibusid
=
context
.
pcibusid
pcibusid
=
context
.
pcibusid
except
pygpu
.
gpuarray
.
UnsupportedException
:
except
pygpu
.
gpuarray
.
UnsupportedException
:
pcibusid
=
'(unsupported for device
%
s)'
%
dev
pcibusid
=
'(unsupported for device
%
s)'
%
dev
except
Exception
:
warnings
.
warn
(
'Unable to get PCI Bus ID. Please consider updating libgpuarray and pygpu.'
)
pcibusid
=
'unknown'
print
(
"Mapped name
%
s to device
%
s:
%
s"
%
print
(
"Mapped name
%
s to device
%
s:
%
s"
%
(
name
,
dev
,
context
.
devname
),
(
name
,
dev
,
context
.
devname
),
...
@@ -99,10 +96,11 @@ def init_dev(dev, name=None):
...
@@ -99,10 +96,11 @@ def init_dev(dev, name=None):
if
need_preallocate
:
if
need_preallocate
:
MB
=
(
1024
*
1024
)
MB
=
(
1024
*
1024
)
if
config
.
gpuarray
.
preallocate
<=
1
:
if
config
.
gpuarray
.
preallocate
<=
1
:
gmem
=
min
(
config
.
gpuarray
.
preallocate
,
0.95
)
*
c
tx
.
total_gmem
gmem
=
min
(
config
.
gpuarray
.
preallocate
,
0.95
)
*
c
ontext
.
total_gmem
else
:
else
:
gmem
=
config
.
gpuarray
.
preallocate
*
MB
gmem
=
config
.
gpuarray
.
preallocate
*
MB
gmem
=
min
(
ctx
.
free_gmem
-
50
*
MB
,
gmem
)
if
gmem
>
context
.
free_gmem
-
50
*
MB
:
print
(
"WARNING: Preallocating too much memory can prevent cudnn and cublas from working properly"
)
# This will allocate and immediatly free an object of size gmem
# This will allocate and immediatly free an object of size gmem
# which will reserve that amount of memory on the GPU.
# which will reserve that amount of memory on the GPU.
...
...
theano/gpuarray/dnn_fwd.c
浏览文件 @
f7596c63
...
@@ -100,7 +100,7 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
...
@@ -100,7 +100,7 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
if
(
!
reuse_algo
)
{
if
(
!
reuse_algo
)
{
size_t
free
;
size_t
free
;
int
err2
=
gpucontext_property
(
ctx
,
GA_CTX_PROP_LARGEST_MEMBLOCK
,
&
free
);
int
err2
=
gpucontext_property
(
c
->
c
tx
,
GA_CTX_PROP_LARGEST_MEMBLOCK
,
&
free
);
if
(
err2
!=
GA_NO_ERROR
)
{
if
(
err2
!=
GA_NO_ERROR
)
{
PyErr_Format
(
PyExc_RuntimeError
,
"Error when trying to find the "
PyErr_Format
(
PyExc_RuntimeError
,
"Error when trying to find the "
"memory information on the GPU"
);
"memory information on the GPU"
);
...
@@ -116,7 +116,7 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
...
@@ -116,7 +116,7 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
cudnnConvolutionFwdAlgoPerf_t
choice
;
cudnnConvolutionFwdAlgoPerf_t
choice
;
gpudata
*
tmpmem
;
gpudata
*
tmpmem
;
tmpmem
=
gpudata_alloc
(
ctx
,
free
,
NULL
,
0
,
NULL
);
tmpmem
=
gpudata_alloc
(
c
->
c
tx
,
free
,
NULL
,
0
,
NULL
);
if
(
tmpmem
==
NULL
)
{
if
(
tmpmem
==
NULL
)
{
PyErr_SetString
(
PyExc_MemoryError
,
"Could not allocate working GPU memory"
);
PyErr_SetString
(
PyExc_MemoryError
,
"Could not allocate working GPU memory"
);
return
-
1
;
return
-
1
;
...
...
theano/gpuarray/dnn_gi.c
浏览文件 @
f7596c63
...
@@ -155,7 +155,7 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
...
@@ -155,7 +155,7 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
cudnnConvolutionBwdDataAlgoPerf_t
choice
;
cudnnConvolutionBwdDataAlgoPerf_t
choice
;
gpudata
*
tmpmem
;
gpudata
*
tmpmem
;
tmpmem
=
gpudata_alloc
(
ctx
,
mem_sz
,
NULL
,
0
,
NULL
);
tmpmem
=
gpudata_alloc
(
c
->
c
tx
,
mem_sz
,
NULL
,
0
,
NULL
);
if
(
tmpmem
==
NULL
)
{
if
(
tmpmem
==
NULL
)
{
PyErr_SetString
(
PyExc_MemoryError
,
"Could not allocate working GPU memory"
);
PyErr_SetString
(
PyExc_MemoryError
,
"Could not allocate working GPU memory"
);
return
-
1
;
return
-
1
;
...
...
theano/gpuarray/dnn_gw.c
浏览文件 @
f7596c63
...
@@ -142,7 +142,7 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
...
@@ -142,7 +142,7 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
if
(
!
reuse_algo
)
{
if
(
!
reuse_algo
)
{
size_t
free
;
size_t
free
;
int
err2
=
gpucontext_property
(
ctx
,
GA_CTX_PROP_LARGEST_MEMBLOCK
,
&
free
);
int
err2
=
gpucontext_property
(
c
->
c
tx
,
GA_CTX_PROP_LARGEST_MEMBLOCK
,
&
free
);
if
(
err2
!=
GA_NO_ERROR
)
{
if
(
err2
!=
GA_NO_ERROR
)
{
PyErr_Format
(
PyExc_RuntimeError
,
"Error when trying to find the "
PyErr_Format
(
PyExc_RuntimeError
,
"Error when trying to find the "
"memory information on the GPU"
);
"memory information on the GPU"
);
...
@@ -158,7 +158,7 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
...
@@ -158,7 +158,7 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
cudnnConvolutionBwdFilterAlgoPerf_t
choice
;
cudnnConvolutionBwdFilterAlgoPerf_t
choice
;
gpudata
*
tmpmem
;
gpudata
*
tmpmem
;
tmpmem
=
gpudata_alloc
(
ctx
,
free
,
NULL
,
0
,
NULL
);
tmpmem
=
gpudata_alloc
(
c
->
c
tx
,
free
,
NULL
,
0
,
NULL
);
if
(
tmpmem
==
NULL
)
{
if
(
tmpmem
==
NULL
)
{
PyErr_SetString
(
PyExc_MemoryError
,
"Could not allocate working GPU memory"
);
PyErr_SetString
(
PyExc_MemoryError
,
"Could not allocate working GPU memory"
);
return
-
1
;
return
-
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论