Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
81deaae0
提交
81deaae0
authored
3月 09, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added device=gpu. Needed on angel as the gpu are in exclusive mode and we want…
added device=gpu. Needed on angel as the gpu are in exclusive mode and we want the driver to select the gpu.
上级
37924e4a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
4 行删除
+12
-4
configdefaults.py
theano/configdefaults.py
+3
-1
__init__.py
theano/sandbox/cuda/__init__.py
+9
-3
没有找到文件。
theano/configdefaults.py
浏览文件 @
81deaae0
...
@@ -8,9 +8,11 @@ AddConfigVar('floatX',
...
@@ -8,9 +8,11 @@ AddConfigVar('floatX',
EnumStr
(
'float64'
,
'float32'
),
EnumStr
(
'float64'
,
'float32'
),
)
)
#gpu mean let the driver select the gpu. Needed in case of gpu in exclusive mode.
#gpuX mean use the gpu number X.
AddConfigVar
(
'device'
,
AddConfigVar
(
'device'
,
"Default device for computations"
,
"Default device for computations"
,
EnumStr
(
'cpu'
,
*
[
'gpu
%
i'
%
i
for
i
in
range
(
4
)])
EnumStr
(
'cpu'
,
'gpu'
,
*
[
'gpu
%
i'
%
i
for
i
in
range
(
4
)])
)
)
# keep the default mode.optimizer==config.optimizer and mode.linker==config.linker!
# keep the default mode.optimizer==config.optimizer and mode.linker==config.linker!
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
81deaae0
...
@@ -112,7 +112,9 @@ if cuda_available:
...
@@ -112,7 +112,9 @@ if cuda_available:
def
use
(
device
):
def
use
(
device
):
global
cuda_enabled
,
enabled_cuda
global
cuda_enabled
,
enabled_cuda
if
device
.
startswith
(
'gpu'
):
if
device
==
'gpu'
:
pass
elif
device
.
startswith
(
'gpu'
):
device
=
int
(
device
[
3
:])
device
=
int
(
device
[
3
:])
elif
device
==
'cpu'
:
elif
device
==
'cpu'
:
device
=
-
1
device
=
-
1
...
@@ -120,13 +122,17 @@ def use(device):
...
@@ -120,13 +122,17 @@ def use(device):
raise
ValueError
(
"Invalid device identifier"
,
device
)
raise
ValueError
(
"Invalid device identifier"
,
device
)
if
use
.
device_number
is
None
:
if
use
.
device_number
is
None
:
# No successful call to use() has been made yet
# No successful call to use() has been made yet
if
device
<
0
:
if
device
!=
'gpu'
and
device
<
0
:
return
return
if
device
in
[
None
,
""
]:
if
device
in
[
None
,
""
]:
device
=
0
device
=
0
device
=
int
(
device
)
try
:
try
:
if
device
!=
'gpu'
:
gpu_init
(
device
)
gpu_init
(
device
)
else
:
#warning To let people see that the gpu will be used.
_logger
.
warn
(
"We let the driver select the gpu device to use"
)
handle_shared_float32
(
True
)
handle_shared_float32
(
True
)
use
.
device_number
=
device
use
.
device_number
=
device
cuda_enabled
=
True
cuda_enabled
=
True
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论