[PATCH] D89974: [driver][CUDA] Use CMake's FindCUDA as default --cuda-path.

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 10:50:41 PDT 2020


Hahnfeld added a comment.

In D89974#2347938 <https://reviews.llvm.org/D89974#2347938>, @tra wrote:

> One concern I have is that the path we configure during clang's build is not necessarily the right choice for the user of clang we build. It's likely that the clang in the end will be used on a completely different machine.
> E.g. official clang builds can not ever provide the same CUDA path for *all* users who end up using them. Requiring the rest to use a special option to make clang work again looks like an overall usability regression to me.

Not quite, as far as I understand the change it's only one of the searched paths.

> I think the default should still let clang search for CUDA or require the user to provide correct CUDA path.  "Use CUDA path discovered by CMake at build time" should be a non-default configuration option if/when it's needed and appropriate.

I agree here. It's definitely surprising to make it the *first* path because `module load`ing another CUDA version and putting it into `PATH` is not recognized anymore.



================
Comment at: clang/test/Driver/cuda-detect.cu:7
+// RUN: %clang -v --target=i386-unknown-linux --cuda-path-ignore-cmake  \
+// RUN:   --sysroot=%S/no-cuda-there--cuda-path-ignore-env 2>&1 | FileCheck %s -check-prefix NOCUDA
+// RUN: %clang -v --target=i386-apple-macosx --cuda-path-ignore-cmake \
----------------
There's now a space missing before `--cuda-path-ignore-env`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89974



More information about the cfe-commits mailing list