[PATCH] D128752: [CUDA] Stop adding CUDA features twice
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 28 13:14:47 PDT 2022
tra added a comment.
In D128752#3616579 <https://reviews.llvm.org/D128752#3616579>, @jhuber6 wrote:
> 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.
We already heard complaints that searching for CUDA installation in multiple places does add a measurable delay when the search hits NFS-mounted directories.
Replacing uses of `CudaInstallation` with a getter function returning a reference to a singleton would be great.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits