Commit Graph

8 Commits

Author SHA1 Message Date
Artem Belevich eb2ba2ea95 [CUDA] Warn about unsupported CUDA SDK version only if it's used.
This fixes an issue with clang issuing a warning about unknown CUDA SDK if it's
detected during non-CUDA compilation.

Differential Revision: https://reviews.llvm.org/D76030
2020-03-12 10:04:10 -07:00
Artem Belevich 12fefeef20 [CUDA] Assume the latest known CUDA version if we've found an unknown one.
This makes clang somewhat forward-compatible with new CUDA releases
without having to patch it for every minor release without adding
any new function.

If an unknown version is found, clang issues a warning (can be disabled
with -Wno-cuda-unknown-version) and assumes that it has detected
the latest known version. CUDA releases are usually supersets
of older ones feature-wise, so it should be sufficient to keep
released clang versions working with minor CUDA updates without
having to upgrade clang, too.

Differential Revision: https://reviews.llvm.org/D73231
2020-01-28 10:11:42 -08:00
Jonas Hahnfeld 7f9c518423 [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

llvm-svn: 323848
2018-01-31 08:26:51 +00:00
Reid Kleckner 887602ae73 [CUDA] Add a host target triple to cuda-version-check.cu
It passes --sysroot for the Linux CUDA installation. To make this test
pass when targetting Windows, you would need to pass
--sysroot=Inputs/CUDA-windows.

llvm-svn: 291255
2017-01-06 18:16:03 +00:00
Samuel Antao 6ad11704b4 Refactor how include paths are appended to the command arguments.
Summary:
This patch aims at removing redundancy in the way include paths for the regular and offloading toolchains are appended to the arguments list in the clang tool.

This was suggested by @rsmith in response to r275931.

Reviewers: rsmith, tra

Subscribers: rsmith, cfe-commits

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

llvm-svn: 276929
2016-07-27 22:46:31 +00:00
Justin Lebar 3e2576f968 Fix flag name in comment in cuda-version-check.cu.
llvm-svn: 274897
2016-07-08 17:59:24 +00:00
Michael Kuperstein 123ae0f26b [CUDA] Pass correct option in test.
llvm-svn: 274805
2016-07-07 23:22:39 +00:00
Justin Lebar c43ad9ee5a [CUDA] Check that our CUDA install supports the requested architectures.
Summary:
Raise an error if you're using a CUDA installation that's too old for
the requested architectures.  In practice, this means that you need a
CUDA 8 install to compile for sm_6*.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21869

llvm-svn: 274781
2016-07-07 18:17:52 +00:00