[PATCH] D128752: [CUDA] Stop adding CUDA features twice

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 28 12:46:04 PDT 2022


jhuber6 added a comment.

In D128752#3616553 <https://reviews.llvm.org/D128752#3616553>, @tra wrote:

>> we no longer will have a cached CUDA installation so we will usually create it twice.
>
> Does that result in extra output in case we find an unexpected CUDA version, or when compiler is run with `-v` ?
>
> We may want to wrap installation detector creation into some sort of singleton creation function.

We already create another one for the call coming from Clang, this patch just gets rid of the other call. I think the printouts you're talking about come from the variable in the CUDA toolchain specifically. Here we simply create one to get the version and throw it away. It's not ideal to do the same work twice, so we could wrap this into some singleton interface. Maybe a static optional value inside of the `Toolchains/Cuda.cpp` file wither a getter that returns a reference to it. Though I don't think this is likely to be a bottleneck.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128752/new/

https://reviews.llvm.org/D128752



More information about the cfe-commits mailing list