Commit 4c4a8ea4 by Tatsuya Nishiyama Committed by Tianqi Chen

[CUDA][TVM] fix constructing invalid command line string for nvcc (#1674)

parent fae3f60c
...@@ -28,7 +28,7 @@ def compile_cuda(code, ...@@ -28,7 +28,7 @@ def compile_cuda(code,
arch : str arch : str
The architecture The architecture
options : str options : str or list of str
The additional options The additional options
path_target : str, optional path_target : str, optional
...@@ -59,10 +59,16 @@ def compile_cuda(code, ...@@ -59,10 +59,16 @@ def compile_cuda(code,
cmd = ["nvcc"] cmd = ["nvcc"]
cmd += ["--%s" % target, "-O3"] cmd += ["--%s" % target, "-O3"]
cmd += ["-arch", arch] cmd += ["-arch", arch]
cmd += ["-o", file_target]
if options: if options:
if isinstance(options, str):
cmd += [options]
elif isinstance(options, list):
cmd += options cmd += options
else:
raise ValueError("options must be str or list of str")
cmd += ["-o", file_target]
cmd += [temp_code] cmd += [temp_code]
proc = subprocess.Popen( proc = subprocess.Popen(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment