Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
bd7a1d18
提交
bd7a1d18
authored
1月 26, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
using new config variable in sandbox/cuda
上级
e41e8502
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
5 行删除
+11
-5
__init__.py
theano/sandbox/cuda/__init__.py
+9
-3
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+2
-2
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
bd7a1d18
import
os
,
sys
from
theano.gof.compiledir
import
get_compiledir
from
theano.compile
import
optdb
import
theano.config
as
config
from
theano
import
config
import
logging
,
copy
_logger_name
=
'theano_cuda_ndarray'
...
...
@@ -109,7 +109,13 @@ if enable_cuda:
import
cuda_ndarray
def
use
(
device
=
config
.
THEANO_GPU
):
def
use
(
device
=
config
.
device
):
if
device
.
startswith
(
'gpu'
):
device
=
int
(
device
[
3
:])
elif
device
==
'cpu'
:
device
=
-
1
else
:
raise
ValueError
(
"Invalid device identifier"
,
device
)
if
use
.
device_number
is
None
:
# No successful call to use() has been made yet
if
device
==
"-1"
or
device
==
"CPU"
:
...
...
@@ -144,5 +150,5 @@ def handle_shared_float32(tf):
raise
NotImplementedError
(
'removing our handler'
)
if
enable_cuda
and
config
.
THEANO_GPU
not
in
[
None
,
""
]
:
if
enable_cuda
and
config
.
device
.
startswith
(
'gpu'
)
:
use
()
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
bd7a1d18
import
sys
,
os
,
subprocess
,
logging
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
std_include_dirs
,
dlimport
,
get_lib_extension
)
import
theano.config
as
config
from
theano
import
config
_logger
=
logging
.
getLogger
(
"theano_cuda_ndarray.nvcc_compiler"
)
_logger
.
setLevel
(
logging
.
WARN
)
...
...
@@ -46,7 +46,7 @@ def nvcc_module_compile_str(module_name, src_code, location=None, include_dirs=[
else
:
preargs
=
list
(
preargs
)
preargs
.
append
(
'-fPIC'
)
no_opt
=
False
cuda_root
=
config
.
CUDA_ROOT
cuda_root
=
config
.
cuda
.
root
include_dirs
=
std_include_dirs
()
+
include_dirs
libs
=
std_libs
()
+
[
'cudart'
]
+
libs
lib_dirs
=
std_lib_dirs
()
+
lib_dirs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论