Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6d87ce28
提交
6d87ce28
authored
7月 25, 2017
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reintroduce cuda.root along with cuda.include_path, for those ops that
directly link to cuda.
上级
18e8a813
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
33 行删除
+39
-33
configdefaults.py
theano/configdefaults.py
+35
-29
dnn.py
theano/gpuarray/dnn.py
+4
-4
没有找到文件。
theano/configdefaults.py
浏览文件 @
6d87ce28
...
@@ -232,6 +232,41 @@ AddConfigVar('gpuarray.single_stream',
...
@@ -232,6 +232,41 @@ AddConfigVar('gpuarray.single_stream',
in_c_key
=
False
)
in_c_key
=
False
)
def
get_cuda_root
():
# We look for the cuda path since we need headers from there
v
=
os
.
getenv
(
'CUDA_ROOT'
,
""
)
if
v
:
return
v
v
=
os
.
getenv
(
'CUDA_PATH'
,
""
)
if
v
:
return
v
s
=
os
.
getenv
(
"PATH"
)
if
not
s
:
return
''
for
dir
in
s
.
split
(
os
.
path
.
pathsep
):
if
os
.
path
.
exists
(
os
.
path
.
join
(
dir
,
"nvcc"
)):
return
os
.
path
.
dirname
(
os
.
path
.
abspath
(
dir
))
return
''
AddConfigVar
(
'cuda.root'
,
"Location of the cuda installation"
,
StrParam
(
get_cuda_root
),
in_c_key
=
False
)
def
default_cuda_include
():
if
theano
.
config
.
cuda
.
root
:
return
os
.
path
.
join
(
theano
.
config
.
cuda
.
root
,
'include'
)
return
''
AddConfigVar
(
'cuda.include_path'
,
"Location of the cuda includes"
,
StrParam
(
default_cuda_include
),
in_c_key
=
False
)
def
safe_no_dnn_workmem
(
workmem
):
def
safe_no_dnn_workmem
(
workmem
):
"""
"""
Make sure the user is not attempting to use dnn.conv.workmem`.
Make sure the user is not attempting to use dnn.conv.workmem`.
...
@@ -325,22 +360,6 @@ AddConfigVar('dnn.conv.precision',
...
@@ -325,22 +360,6 @@ AddConfigVar('dnn.conv.precision',
in_c_key
=
False
)
in_c_key
=
False
)
def
get_cuda_root
():
# We look for the cuda path since we need headers from there
v
=
os
.
getenv
(
'CUDA_ROOT'
,
""
)
if
v
:
return
v
s
=
os
.
getenv
(
"PATH"
)
if
not
s
:
if
os
.
path
.
exists
(
'/usr/local/cuda'
):
return
'/usr/local/cuda'
return
''
for
dir
in
s
.
split
(
os
.
path
.
pathsep
):
if
os
.
path
.
exists
(
os
.
path
.
join
(
dir
,
"nvcc"
)):
return
os
.
path
.
dirname
(
os
.
path
.
abspath
(
dir
))
return
''
AddConfigVar
(
'dnn.base_path'
,
AddConfigVar
(
'dnn.base_path'
,
"Install location of cuDNN."
,
"Install location of cuDNN."
,
StrParam
(
''
),
StrParam
(
''
),
...
@@ -359,19 +378,6 @@ AddConfigVar('dnn.include_path',
...
@@ -359,19 +378,6 @@ AddConfigVar('dnn.include_path',
in_c_key
=
False
)
in_c_key
=
False
)
def
default_dnn_cuda_inc_path
():
cuda_root
=
get_cuda_root
()
if
cuda_root
:
return
os
.
path
.
join
(
cuda_root
,
'include'
)
return
''
AddConfigVar
(
'dnn.cuda_include_path'
,
"Location of the cuda include for cudnn"
,
StrParam
(
default_dnn_cuda_inc_path
),
in_c_key
=
False
)
def
default_dnn_lib_path
():
def
default_dnn_lib_path
():
if
theano
.
config
.
dnn
.
base_path
!=
''
:
if
theano
.
config
.
dnn
.
base_path
!=
''
:
path
=
os
.
path
.
join
(
theano
.
config
.
dnn
.
base_path
,
'lib'
)
path
=
os
.
path
.
join
(
theano
.
config
.
dnn
.
base_path
,
'lib'
)
...
...
theano/gpuarray/dnn.py
浏览文件 @
6d87ce28
...
@@ -232,8 +232,8 @@ class DnnVersion(Op):
...
@@ -232,8 +232,8 @@ class DnnVersion(Op):
res
=
[]
res
=
[]
if
config
.
dnn
.
include_path
:
if
config
.
dnn
.
include_path
:
res
.
append
(
config
.
dnn
.
include_path
)
res
.
append
(
config
.
dnn
.
include_path
)
if
config
.
dnn
.
cuda_
include_path
:
if
config
.
cuda
.
include_path
:
res
.
append
(
config
.
dnn
.
cuda_
include_path
)
res
.
append
(
config
.
cuda
.
include_path
)
return
res
return
res
def
c_libraries
(
self
):
def
c_libraries
(
self
):
...
@@ -375,8 +375,8 @@ class DnnBase(COp):
...
@@ -375,8 +375,8 @@ class DnnBase(COp):
dirs
=
[
os
.
path
.
dirname
(
__file__
),
pygpu
.
get_include
()]
dirs
=
[
os
.
path
.
dirname
(
__file__
),
pygpu
.
get_include
()]
if
config
.
dnn
.
include_path
:
if
config
.
dnn
.
include_path
:
dirs
.
append
(
config
.
dnn
.
include_path
)
dirs
.
append
(
config
.
dnn
.
include_path
)
if
config
.
dnn
.
cuda_
include_path
:
if
config
.
cuda
.
include_path
:
dirs
.
append
(
config
.
dnn
.
cuda_
include_path
)
dirs
.
append
(
config
.
cuda
.
include_path
)
return
dirs
return
dirs
def
c_libraries
(
self
):
def
c_libraries
(
self
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论