Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5c0d8837
提交
5c0d8837
authored
6月 18, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the new pycuda feature to attach to an existing context.
上级
06cccd43
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
11 行删除
+20
-11
config.txt
doc/library/config.txt
+7
-5
pycuda_init.py
theano/misc/pycuda_init.py
+13
-6
没有找到文件。
doc/library/config.txt
浏览文件 @
5c0d8837
...
@@ -151,11 +151,13 @@ import theano and print the config variable, as in:
...
@@ -151,11 +151,13 @@ import theano and print the config variable, as in:
Default: ``False``
Default: ``False``
If True, always initialize PyCUDA when Theano want to initilize
If True, always initialize PyCUDA when Theano want to initialize
the GPU. Currently, we must always initialize PyCUDA before
the GPU. With PyCUDA version 2011.2.2 or earlier, PyCUDA must
Theano do it. Setting this flag to True, ensure that, but always
initialize the GPU before Theano does it. Setting
import PyCUDA. It can be done manually by importing
this flag to True, ensure that, but always import PyCUDA. It can
theano.misc.pycuda_init before theano initialize the GPU device.
be done manually by importing theano.misc.pycuda_init before
Theano initialize the GPU device. Newer version of PyCUDA
(currently only in the trunk) don't have this restriction.
.. attribute:: floatX
.. attribute:: floatX
...
...
theano/misc/pycuda_init.py
浏览文件 @
5c0d8837
...
@@ -44,9 +44,16 @@ if (not hasattr(theano.sandbox, 'cuda') or
...
@@ -44,9 +44,16 @@ if (not hasattr(theano.sandbox, 'cuda') or
pass
pass
pycuda_available
=
True
pycuda_available
=
True
else
:
else
:
# Now we always import this file when we call theano.sandbox.cuda.use
import
pycuda.driver
# So this should not happen normally.
if
hasattr
(
pycuda
.
driver
.
Context
,
"attach"
):
warnings
.
warn
(
"For some unknow reason, theano.misc.pycuda_init was not"
pycuda
.
driver
.
Context
.
attach
()
" imported before Theano initialized the GPU. To fix the"
else
:
" problem, import theano.misc.pycuda_init manually before"
# Now we always import this file when we call theano.sandbox.cuda.use
" using the GPU."
)
# So this should not happen normally.
# TODO: make this an error.
warnings
.
warn
(
"For some unknow reason, theano.misc.pycuda_init was not"
" imported before Theano initialized the GPU and"
" your PyCUDA version is 2011.2.2 or earlier."
" To fix the problem, import theano.misc.pycuda_init"
" manually before using/initializing the GPU or use a"
" more recent version of PyCUDA."
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论