[PATCH] D43461: [CUDA] Include single GPU binary, NFCI.

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 10:53:05 PST 2018


Hahnfeld added inline comments.


================
Comment at: lib/Frontend/CompilerInvocation.cpp:1044-1045
 
-  Opts.CudaGpuBinaryFileNames =
-      Args.getAllArgValues(OPT_fcuda_include_gpubinary);
+  Opts.CudaGpuBinaryFileName =
+      Args.getLastArgValue(OPT_fcuda_include_gpubinary);
 
----------------
tra wrote:
> Hahnfeld wrote:
> > tra wrote:
> > > If more than one gpu binary is passed, all but last will be ignored.
> > > IMO in this case we would want to either warn that some inputs were ignored or report an error that there is more than one GPU binary.
> > Well, `-fcuda-include-gpubinary` is only recognized on `cc1`. I think we can assume that we are correctly assembling our command line, can't we? (Nobody else checks the options here...)
> Fair enough. Assert, then?
I added an `assert` in `lib/Driver/ToolChains/Clang.cpp` where we are constructing the command line. I think that guarantees that we are getting only a single argument.


Repository:
  rC Clang

https://reviews.llvm.org/D43461





More information about the cfe-commits mailing list