Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b35d38d7
提交
b35d38d7
authored
10月 10, 2013
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Correctly parse output of g++ for latest version of llvm by Apple
上级
09f6d3e7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
41 行增加
和
3 行删除
+41
-3
cmodule.py
theano/gof/cmodule.py
+41
-3
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
b35d38d7
...
@@ -1583,6 +1583,8 @@ class GCC_compiler(object):
...
@@ -1583,6 +1583,8 @@ class GCC_compiler(object):
selected_lines
.
append
(
line
.
strip
())
selected_lines
.
append
(
line
.
strip
())
elif
"-mtune="
in
line
:
elif
"-mtune="
in
line
:
selected_lines
.
append
(
line
.
strip
())
selected_lines
.
append
(
line
.
strip
())
elif
"-target-cpu"
in
line
:
selected_lines
.
append
(
line
.
strip
())
lines
=
list
(
set
(
selected_lines
))
# to remove duplicate
lines
=
list
(
set
(
selected_lines
))
# to remove duplicate
return
lines
return
lines
...
@@ -1629,12 +1631,48 @@ class GCC_compiler(object):
...
@@ -1629,12 +1631,48 @@ class GCC_compiler(object):
" problem:
\n
%
s"
,
" problem:
\n
%
s"
,
get_lines
(
"g++ -E -v -"
,
parse
=
False
))
get_lines
(
"g++ -E -v -"
,
parse
=
False
))
else
:
else
:
part
=
native_lines
[
0
]
.
split
()
# Some options are actually given as "-option value",
# we want to treat them as only one token.
# Heuristic: tokens not starting with a dash should be
# joined with the previous one.
def
join_options
(
init_part
):
new_part
=
[]
for
i
,
p
in
enumerate
(
init_part
):
if
p
.
startswith
(
'-'
):
if
((
i
+
1
<
len
(
init_part
))
and
not
init_part
[
i
+
1
]
.
startswith
(
'-'
)):
# add "-option value" as one arg
pp1
=
init_part
[
i
+
1
]
new_part
.
append
(
' '
.
join
((
p
,
pp1
)))
else
:
# add "-option" as one arg
new_part
.
append
(
p
)
elif
i
==
0
:
# The first argument does not usually start
# with "-", still add it
new_part
.
append
(
p
)
# Else, skip it, as it was already included
# with the previous part.
return
new_part
part
=
join_options
(
native_lines
[
0
]
.
split
())
for
line
in
default_lines
:
for
line
in
default_lines
:
if
line
.
startswith
(
part
[
0
]):
if
line
.
startswith
(
part
[
0
]):
part2
=
[
p
for
p
in
line
.
split
()
part2
=
[
p
for
p
in
join_options
(
line
.
split
())
if
not
'march'
in
p
and
not
'mtune'
in
p
]
if
(
not
'march'
in
p
and
not
'mtune'
in
p
and
not
'target-cpu'
in
p
)]
new_flags
=
[
p
for
p
in
part
if
p
not
in
part2
]
new_flags
=
[
p
for
p
in
part
if
p
not
in
part2
]
# Replace '-target-cpu value', which is an option
# of clang, with '-march=value', for g++
for
i
,
p
in
enumerate
(
new_flags
):
if
'target-cpu'
in
p
:
opt
=
p
.
split
()
if
len
(
opt
)
==
2
:
opt_name
,
opt_val
=
opt
new_flags
[
i
]
=
'-march=
%
s'
%
opt_val
GCC_compiler
.
march_flags
=
new_flags
GCC_compiler
.
march_flags
=
new_flags
break
break
_logger
.
info
(
"g++ -march=native equivalent flags:
%
s"
,
_logger
.
info
(
"g++ -march=native equivalent flags:
%
s"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论