Skip to content
Snippets Groups Projects
Commit 4c4a8ea4 authored by Tatsuya Nishiyama's avatar Tatsuya Nishiyama Committed by Tianqi Chen
Browse files

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

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