提交 1a3948cc authored 作者: Chiheb Trabelsi's avatar Chiheb Trabelsi

nvcc_compiler.py has been modified in order to respect the flake8 style.

nvcc_compiler.py do not contain long lines.
上级 755d7cdf
...@@ -4,7 +4,6 @@ import logging ...@@ -4,7 +4,6 @@ import logging
import os import os
import subprocess import subprocess
import sys import sys
import warnings
from locale import getpreferredencoding from locale import getpreferredencoding
import numpy import numpy
...@@ -249,8 +248,9 @@ class NVCC_compiler(Compiler): ...@@ -249,8 +248,9 @@ class NVCC_compiler(Compiler):
_logger.debug('Writing module C++ code to %s', cppfilename) _logger.debug('Writing module C++ code to %s', cppfilename)
cppfile.write(src_code) cppfile.write(src_code)
lib_filename = os.path.join(location, '%s.%s' % lib_filename = os.path.join(
(module_name, get_lib_extension())) location, '%s.%s' %
(module_name, get_lib_extension()))
_logger.debug('Generating shared lib %s', lib_filename) _logger.debug('Generating shared lib %s', lib_filename)
# TODO: Why do these args cause failure on gtx285 that has 1.3 # TODO: Why do these args cause failure on gtx285 that has 1.3
...@@ -268,7 +268,7 @@ class NVCC_compiler(Compiler): ...@@ -268,7 +268,7 @@ class NVCC_compiler(Compiler):
continue continue
for pattern in ['-O', '-arch=', '-ccbin=', '-G', '-g', '-I', for pattern in ['-O', '-arch=', '-ccbin=', '-G', '-g', '-I',
'-L', '--fmad', '--ftz', '--maxrregcount', '-L', '--fmad', '--ftz', '--maxrregcount',
'--prec-div', '--prec-sqrt', '--use_fast_math', '--prec-div', '--prec-sqrt', '--use_fast_math',
'-fmad', '-ftz', '-maxrregcount', '-fmad', '-ftz', '-maxrregcount',
'-prec-div', '-prec-sqrt', '-use_fast_math', '-prec-div', '-prec-sqrt', '-use_fast_math',
'--use-local-env', '--cl-version=']: '--use-local-env', '--cl-version=']:
...@@ -311,7 +311,7 @@ class NVCC_compiler(Compiler): ...@@ -311,7 +311,7 @@ class NVCC_compiler(Compiler):
# https://wiki.debian.org/RpathIssue for details. # https://wiki.debian.org/RpathIssue for details.
if (not type(config.cuda).root.is_default and if (not type(config.cuda).root.is_default and
os.path.exists(os.path.join(config.cuda.root, 'lib'))): os.path.exists(os.path.join(config.cuda.root, 'lib'))):
rpaths.append(os.path.join(config.cuda.root, 'lib')) rpaths.append(os.path.join(config.cuda.root, 'lib'))
if sys.platform != 'darwin': if sys.platform != 'darwin':
...@@ -341,7 +341,7 @@ class NVCC_compiler(Compiler): ...@@ -341,7 +341,7 @@ class NVCC_compiler(Compiler):
indexof = cmd.index('-u') indexof = cmd.index('-u')
cmd.pop(indexof) # Remove -u cmd.pop(indexof) # Remove -u
cmd.pop(indexof) # Remove argument to -u cmd.pop(indexof) # Remove argument to -u
except ValueError as e: except ValueError:
done = True done = True
# CUDA Toolkit v4.1 Known Issues: # CUDA Toolkit v4.1 Known Issues:
...@@ -359,11 +359,13 @@ class NVCC_compiler(Compiler): ...@@ -359,11 +359,13 @@ class NVCC_compiler(Compiler):
try: try:
os.chdir(location) os.chdir(location)
p = subprocess.Popen( p = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
nvcc_stdout_raw, nvcc_stderr_raw = p.communicate()[:2] nvcc_stdout_raw, nvcc_stderr_raw = p.communicate()[:2]
console_encoding = getpreferredencoding() console_encoding = getpreferredencoding()
nvcc_stdout = decode_with(nvcc_stdout_raw, console_encoding) nvcc_stdout = decode_with(nvcc_stdout_raw, console_encoding)
nvcc_stderr = decode_with(nvcc_stderr_raw, console_encoding) nvcc_stderr = decode_with(nvcc_stderr_raw, console_encoding)
p = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
finally: finally:
os.chdir(orig_dir) os.chdir(orig_dir)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论