提交 42a7c2ea authored 作者: James Bergstra's avatar James Bergstra

nvcc - added post-processing of stderr from nvcc to remove warnings about things

we do on purpose. Also moved printing of the remainder of the message to INFO level logging, which might be a bad idea. But nvcc spews things that are not errors to stderr which are not easy to filter out. I'm thinking of the warnings that _POSIX_SOURCE is redefined, followed by a multiline header traceback. We do not want to print that to stderr by default every time someone compiles anything with nvcc. If compilation fails, then the whole nvcc stderr goes to our stderr anyway.
上级 bb892b77
...@@ -127,8 +127,23 @@ def nvcc_module_compile_str(module_name, src_code, location=None, include_dirs=[ ...@@ -127,8 +127,23 @@ def nvcc_module_compile_str(module_name, src_code, location=None, include_dirs=[
# the number of registers required to inform the maximum number of threads per block. # the number of registers required to inform the maximum number of threads per block.
debug('Running cmd', ' '.join(cmd)) debug('Running cmd', ' '.join(cmd))
p = subprocess.Popen(cmd, stderr=subprocess.PIPE) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stderr = p.communicate()[1] nvcc_stdout, nvcc_stderr = p.communicate()[:2]
if nvcc_stdout:
# this doesn't happen to my knowledge
print >> sys.stderr, "DEBUG: nvcc STDOUT", nvcc_stdout
for eline in nvcc_stderr.split('\n'):
if not eline:
continue
if 'skipping incompatible' in eline: #ld is skipping an incompatible library
continue
if 'declared but never referenced' in eline:
continue
if 'statement is unreachable' in eline:
continue
_logger.info("NVCC: "+eline)
if p.returncode: if p.returncode:
# filter the output from the compiler # filter the output from the compiler
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论