[CUDA] Detect installation in PATH
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Wed, 31 Jan 2018 08:26:51 +0000 (08:26 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Wed, 31 Jan 2018 08:26:51 +0000 (08:26 +0000)
commitc0ae038926e433daf7aba233010acd66bbbb4555
tree1f1ed6ffff111f3276e761ffb083deac368cb331
parentac466c944b5b132504200d504e1c2c08f289ac14
[CUDA] Detect installation in PATH

If the CUDA toolkit is not installed to its default locations
in /usr/local/cuda, the user is forced to specify --cuda-path.
This is tedious and the driver can be smarter if well-known tools
(like ptxas) can already be found in the PATH environment variable.

Add option --cuda-path-ignore-env if the user wants to ignore
set environment variables. Also use it in the tests to make sure
the driver always finds the same CUDA installation, regardless
of the user's environment.

Differential Revision: https://reviews.llvm.org/D42642

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323848 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/Driver/Options.td
lib/Driver/ToolChains/Cuda.cpp
test/Driver/Inputs/CUDA-nolibdevice/usr/local/cuda/bin/ptxas [new file with mode: 0755]
test/Driver/Inputs/CUDA-symlinks/opt/cuda/bin/ptxas [new file with mode: 0755]
test/Driver/Inputs/CUDA-symlinks/opt/cuda/include/.keep [new file with mode: 0644]
test/Driver/Inputs/CUDA-symlinks/opt/cuda/lib/.keep [new file with mode: 0644]
test/Driver/Inputs/CUDA-symlinks/opt/cuda/nvvm/libdevice/libdevice.compute_30.10.bc [new file with mode: 0644]
test/Driver/Inputs/CUDA-symlinks/opt/cuda/nvvm/libdevice/libdevice.compute_35.10.bc [new file with mode: 0644]
test/Driver/Inputs/CUDA-symlinks/usr/bin/ptxas [new symlink]
test/Driver/Inputs/CUDA/usr/local/cuda/bin/ptxas [new file with mode: 0755]
test/Driver/cuda-detect-path.cu [new file with mode: 0644]
test/Driver/cuda-detect.cu
test/Driver/cuda-not-found.cu
test/Driver/cuda-version-check.cu