提交 b28bed3d authored 作者: Frederic's avatar Frederic

Add logging and don't crash if we can't detect the -march=native equivalent flags.

上级 689362ec
...@@ -1524,9 +1524,12 @@ class GCC_compiler(object): ...@@ -1524,9 +1524,12 @@ class GCC_compiler(object):
return lines return lines
native_lines = get_lines("g++ -march=native -E -v - </dev/null") native_lines = get_lines("g++ -march=native -E -v - </dev/null")
assert len(native_lines) == 1, native_lines _logger.info("g++ -march=native selected lines:", native_lines)
if len(native_lines) != 1:
_logger.warn("OPTIMIZATION WARNING: Theano was not able to find the g++ parameter that tune the compilation to your specific CPU. This can slow down the execution of Theano function. Can you submit the following lines to Theano's mailing list such that we fix this problem:\n ", native_lines)
else:
default_lines = get_lines("g++ -E -v - </dev/null") default_lines = get_lines("g++ -E -v - </dev/null")
_logger.info("g++ default lines: ", default_lines)
assert len(default_lines) > 1 assert len(default_lines) > 1
part = native_lines[0].split() part = native_lines[0].split()
for line in default_lines: for line in default_lines:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论