Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
770598ef
提交
770598ef
authored
7月 26, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Raise an error when the theano flag nvcc.flags is not correctly handled by Theano.
上级
602da814
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
2 行删除
+22
-2
cmodule.py
theano/gof/cmodule.py
+6
-0
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+16
-2
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
770598ef
...
@@ -650,6 +650,12 @@ class ModuleCache(object):
...
@@ -650,6 +650,12 @@ class ModuleCache(object):
msg
=
'broken cache directory [EOF]'
,
msg
=
'broken cache directory [EOF]'
,
level
=
logging
.
WARNING
)
level
=
logging
.
WARNING
)
continue
continue
except
ValueError
:
# This can happen when we have bad config value
# in the cuda.nvcc_compiler.py file.
# We should not hide it here, as this will cause
# an unrelated error to appear.
raise
except
Exception
:
except
Exception
:
unpickle_failure
()
unpickle_failure
()
if
delete_if_problem
:
if
delete_if_problem
:
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
770598ef
...
@@ -11,11 +11,13 @@ from theano.gof.cc import hash_from_file
...
@@ -11,11 +11,13 @@ from theano.gof.cc import hash_from_file
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
std_include_dirs
,
dlimport
,
std_include_dirs
,
dlimport
,
get_lib_extension
,
local_bitwidth
)
get_lib_extension
,
local_bitwidth
)
from
theano.gof.python25
import
any
_logger
=
logging
.
getLogger
(
"theano.sandbox.cuda.nvcc_compiler"
)
_logger
=
logging
.
getLogger
(
"theano.sandbox.cuda.nvcc_compiler"
)
_logger
.
setLevel
(
logging
.
WARN
)
_logger
.
setLevel
(
logging
.
WARN
)
from
theano.configparser
import
config
,
AddConfigVar
,
StrParam
,
BoolParam
from
theano.configparser
import
(
config
,
AddConfigVar
,
StrParam
,
BoolParam
,
ConfigParam
)
AddConfigVar
(
'nvcc.compiler_bindir'
,
AddConfigVar
(
'nvcc.compiler_bindir'
,
"If defined, nvcc compiler driver will seek g++ and gcc"
"If defined, nvcc compiler driver will seek g++ and gcc"
...
@@ -32,9 +34,21 @@ if config.cuda.nvccflags != '':
...
@@ -32,9 +34,21 @@ if config.cuda.nvccflags != '':
'Please use nvcc.flags instead. You provided value:
%
s'
'Please use nvcc.flags instead. You provided value:
%
s'
%
config
.
cuda
.
nvccflags
)
%
config
.
cuda
.
nvccflags
)
def
filter_nvcc_flags
(
s
):
assert
isinstance
(
s
,
str
)
flags
=
[
flag
for
flag
in
s
.
split
(
' '
)
if
flag
]
if
any
([
f
for
f
in
flags
if
not
f
.
startswith
(
"-"
)]):
raise
ValueError
(
"Theano nvcc.flags support only parameter/value pair without"
" space between them. e.g.: '--machine 64' is not supported,"
" but '--machine=64' is supported. Please add the '=' symbol."
" nvcc.flags value is '
%
s'"
%
s
)
return
' '
.
join
(
flags
)
AddConfigVar
(
'nvcc.flags'
,
AddConfigVar
(
'nvcc.flags'
,
"Extra compiler flags for nvcc"
,
"Extra compiler flags for nvcc"
,
StrParam
(
config
.
cuda
.
nvccflags
))
ConfigParam
(
config
.
cuda
.
nvccflags
,
filter_nvcc_flags
))
AddConfigVar
(
'nvcc.fastmath'
,
AddConfigVar
(
'nvcc.fastmath'
,
""
,
""
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论