Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
03bd0383
提交
03bd0383
authored
10月 08, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix gh-1540 and close gh-1541. Don't use rpath if the user didn't provided cuda.root.
上级
95e36534
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
18 行删除
+31
-18
__init__.py
theano/sandbox/cuda/__init__.py
+0
-15
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+31
-3
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
03bd0383
...
@@ -18,18 +18,6 @@ _logger_name = 'theano.sandbox.cuda'
...
@@ -18,18 +18,6 @@ _logger_name = 'theano.sandbox.cuda'
_logger
=
logging
.
getLogger
(
_logger_name
)
_logger
=
logging
.
getLogger
(
_logger_name
)
_logger
.
setLevel
(
logging
.
WARNING
)
_logger
.
setLevel
(
logging
.
WARNING
)
AddConfigVar
(
'cuda.root'
,
"""directory with bin/, lib/, include/ for cuda utilities.
This directory is included via -L and -rpath when linking
dynamically compiled modules. If AUTO and nvcc is in the
path, it will use one of nvcc parent directory. Otherwise
/usr/local/cuda will be used. Leave empty to prevent extra
linker directives. Default: environment variable "CUDA_ROOT"
or else "AUTO".
"""
,
StrParam
(
os
.
getenv
(
'CUDA_ROOT'
,
"AUTO"
)),
in_c_key
=
False
)
AddConfigVar
(
'pycuda.init'
,
AddConfigVar
(
'pycuda.init'
,
"""If True, always initialize PyCUDA when Theano want to
"""If True, always initialize PyCUDA when Theano want to
initilize the GPU. Currently, we must always initialize
initilize the GPU. Currently, we must always initialize
...
@@ -41,9 +29,6 @@ AddConfigVar('pycuda.init',
...
@@ -41,9 +29,6 @@ AddConfigVar('pycuda.init',
BoolParam
(
False
),
BoolParam
(
False
),
in_c_key
=
False
)
in_c_key
=
False
)
if
config
.
cuda
.
root
==
"AUTO"
:
# set nvcc_path correctly and get the version
nvcc_compiler
.
set_cuda_root
()
#is_nvcc_available called here to initialize global vars in
#is_nvcc_available called here to initialize global vars in
#nvcc_compiler module
#nvcc_compiler module
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
03bd0383
...
@@ -30,6 +30,29 @@ AddConfigVar('nvcc.compiler_bindir',
...
@@ -30,6 +30,29 @@ AddConfigVar('nvcc.compiler_bindir',
StrParam
(
""
),
StrParam
(
""
),
in_c_key
=
False
)
in_c_key
=
False
)
user_provided_cuda_root
=
True
def
default_cuda_root
():
global
user_provided_cuda_root
v
=
os
.
getenv
(
'CUDA_ROOT'
,
""
)
user_provided_cuda_root
=
False
if
v
:
return
v
return
find_cuda_root
()
AddConfigVar
(
'cuda.root'
,
"""directory with bin/, lib/, include/ for cuda utilities.
This directory is included via -L and -rpath when linking
dynamically compiled modules. If AUTO and nvcc is in the
path, it will use one of nvcc parent directory. Otherwise
/usr/local/cuda will be used. Leave empty to prevent extra
linker directives. Default: environment variable "CUDA_ROOT"
or else "AUTO".
"""
,
StrParam
(
default_cuda_root
),
in_c_key
=
False
)
AddConfigVar
(
'cuda.nvccflags'
,
AddConfigVar
(
'cuda.nvccflags'
,
"DEPRECATED, use nvcc.flags instead"
,
"DEPRECATED, use nvcc.flags instead"
,
StrParam
(
""
,
allow_override
=
False
),
StrParam
(
""
,
allow_override
=
False
),
...
@@ -104,7 +127,7 @@ def is_nvcc_available():
...
@@ -104,7 +127,7 @@ def is_nvcc_available():
return
False
return
False
def
set
_cuda_root
():
def
find
_cuda_root
():
s
=
os
.
getenv
(
"PATH"
)
s
=
os
.
getenv
(
"PATH"
)
if
not
s
:
if
not
s
:
return
return
...
@@ -303,8 +326,13 @@ class NVCC_compiler(object):
...
@@ -303,8 +326,13 @@ class NVCC_compiler(object):
if
len
(
preargs2
)
>
0
:
if
len
(
preargs2
)
>
0
:
cmd
.
extend
([
'-Xcompiler'
,
','
.
join
(
preargs2
)])
cmd
.
extend
([
'-Xcompiler'
,
','
.
join
(
preargs2
)])
if
config
.
cuda
.
root
and
os
.
path
.
exists
(
os
.
path
.
join
(
config
.
cuda
.
root
,
# We should not use rpath if possible. If the user provided
'lib'
)):
# provided an cuda.root flag, we need to add one, but
# otherwise, we don't add it. See gh-1540 and
# https://wiki.debian.org/RpathIssue for details.
if
(
user_provided_cuda_root
and
os
.
path
.
exists
(
os
.
path
.
join
(
config
.
cuda
.
root
,
'lib'
))):
rpaths
.
append
(
os
.
path
.
join
(
config
.
cuda
.
root
,
'lib'
))
rpaths
.
append
(
os
.
path
.
join
(
config
.
cuda
.
root
,
'lib'
))
if
sys
.
platform
!=
'darwin'
:
if
sys
.
platform
!=
'darwin'
:
# the 64bit CUDA libs are in the same files as are
# the 64bit CUDA libs are in the same files as are
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论