Commit Graph

44 Commits

Author SHA1 Message Date
Anton Chernov
0f9533e61b CUDA: Add CUDA 10 (Turing) detection 2018-12-07 08:51:57 -05:00
Soumith Chintala
bfd93b73a0 FindCUDA: Filter unrelated content in compute capabilities output
Working around CUDA-level nvrm_gpu log statements to stdout on some
embedded platforms (ex. Drive PX2).

See-also: https://github.com/pytorch/pytorch/issues/11518#issue-359113249
2018-09-19 10:55:02 -04:00
Brad King
37ba34c0b0 FindCUDA/select_compute_arch: Restore two-component CUDA_VERSION
Since commit v3.12.0-rc1~332^2 (FindCUDA/select_compute_arch: Add
support for CUDA as a language, 2018-03-15) this module sets
`CUDA_VERSION` based on `CMAKE_CUDA_COMPILER_VERSION` when the language
is enabled.  Limit it to two components for consistency with the
normal `FindCUDA` documentation and behavior.

Fixes: #18231
2018-08-01 13:42:13 -04:00
Henry Schreiner
61b222f3ae CUDA/select_compute_arch: Fix detection on old CUDA with new card/driver
Fix version comparisons to handle patch components.  List and check
known archs for each version of CUDA so mismatching versions are not
suggested.

Fixes: #17921
2018-04-20 09:43:50 -04:00
Henry Fredrick Schreiner
e743fc8e91 FindCUDA/select_compute_arch: Add support for CUDA as a language
Even though this is an internal module, we can still prepare it to
be used in another public-facing module outside of `FindCUDA`.

Issue: #16586
2018-03-20 14:19:25 -04:00
Brad King
bc88329e5b Merge topic 'msvc2017-findcuda'
fab1b432 FindCUDA: Update to properly find MSVC 2017 compiler tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1631
2018-01-09 09:26:20 -05:00
Aaron Bray
fab1b432eb FindCUDA: Update to properly find MSVC 2017 compiler tools
An implementation that handles the different installation locations of
visual studio compiler tools
2018-01-08 11:35:36 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Umar Arshad
8b09c20c3a FindCUDA: Fix CMP0007 warning in run_nvcc.cmake
Set `CMP0007` to `NEW` for the entire script.  The script comes with
CMake and is aware of the policy's behavior, so set the policy to ensure
that its warnings do not show up during the build phase.

Fixes: #16579
2017-10-04 08:07:37 -04:00
Robert Maynard
c1f4f13dbf FindCUDA: Use long brackets to handle spaces in CUDA_NVCC_COMPILE_DEFINITIONS
Fixes #16510. Quoting of compile definitions breaks string value definitions
2017-08-15 12:58:52 -04:00
Boris Fomitchev
cbf1393aa4 FindCUDA: Add CUDA9/Volta recognition 2017-08-10 11:10:07 -04:00
Bjoern Thiel
934eb497f2 FindCUDA: Fix PTX selection with multiple architectures 2017-02-22 10:35:44 -05:00
Pierre Moreau
645dd3ca53 FindCUDA: Fix typo in CUDA_DETECT_INSTALLED_GPUS doc string 2017-02-02 08:52:11 -05:00
Bjoern Thiel
c1f3086de7 FindCUDA: Enable CUDA_SELECT_NVCC_ARCH_FLAGS Auto for MSVC
Fixes: #16525
2017-01-25 10:31:27 -05:00
Boris Fomitchev
2dc9a754b5 FindCUDA: Support 2.1(2.0) architecture notation
Also tweak some messages and comments.
2016-08-23 10:47:27 -04:00
Peter Boettcher
7ded655f7b FindCUDA: Take NVCC include directories from target properties
Fixes issue where include directories specified on the target are
not passed on to NVCC.  This includes both target_include_directories()
as well as include directories added by dependency chaining.

Closes: #14201
2016-08-16 14:16:35 -04:00
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
Automate with:

find Modules -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:41:13 +02:00
Boris Fomitchev
7229ae728f FindCUDA: Refactor Android(Tegra) support
Reviewed-by: James Bigler <jamesbigler@gmail.com>
2016-06-09 09:25:55 -04:00
James Bigler
e739ef7b66 FindCUDA: Only warn about non-existent dependency files in verbose mode 2016-02-08 13:38:28 -07:00
James Bigler
81ecc72637 FindCUDA: Added some additional comments about non-existent dependency files. 2016-02-05 14:50:29 -07:00
James Bigler
4b561b4cb5 FindCUDA: Fix for when a non-existent dependency file is found.
Previously if a non-existent dependency file is found we set the file to "" and
then do if(NOT IS_DIRECTORY "${file}").  Later we call get_filename_component
on the empty file which returns basically the current build directory.

Having a dependency on the current build directory is really annoying, because
anything that compiles into that directory will change the file stamp and
cause your files to rebuild every time you call make. :(
2016-02-05 14:32:01 -07:00
James Bigler
1b0c77a33d FindCUDA: Add specific cuda_language_flag instead of using nvcc.
I was previously appending to nvcc_flags inside the file loop.  This
caused the flag to be appended multiple times which freaks out nvcc.
Now the flag is specifically handled per file.
2015-04-09 11:41:36 -04:00
Adam Strzelecki
84e3fde94d FindCUDA: Avoid if() auto-dereference in string comparisons
This silences possible CMP0054 warnings.
2014-09-24 10:10:42 -04:00
Adam Strzelecki
32bcec5fab FindCUDA: Fix OSX Clang & no C language enabled
When setting default CUDA_HOST_COMPILER we must dereference CMAKE_C_COMPILER,
i.e. /usr/bin/clang should be used instead /usr/bin/cc which is symlink.
Otherwise CUDA thinks it is GCC and issues -dumpspecs which is unknown option
to Clang.

Also in case neither CMAKE_C_COMPILER is defined (project does not use C
language) nor CUDA_HOST_COMPILER is specified manually we should skip -ccbin
and let nvcc use its own default C compiler.
2014-06-30 11:23:36 -04:00
Rolf Eike Beer
7eacbaed4d Replace MATCHES ".+" tests with NOT STREQUAL "" 2014-04-14 18:17:23 +02:00
Rolf Eike Beer
5bd48ac534 Replace string(REGEX REPLACE) with string(REPLACE) where possible
The simple replacement is much faster.
2014-04-14 18:17:05 +02:00
Rolf Eike Beer
2622bc3f65 Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.
2014-04-14 18:16:58 +02:00
Andreas Mohr
ddac8d3d2d Fix spelling and typos (affecting binary data / module messages) 2013-05-07 08:39:19 -04:00
David Cole
3dea63d04d Merge topic 'topics/FindCUDA/Add-CUDA_HOST_COMPILER'
db207e4 FindCUDA: Added CUDA_HOST_COMPILER variable.
2012-09-18 16:41:20 -04:00
James Bigler
db207e4065 FindCUDA: Added CUDA_HOST_COMPILER variable.
Added a new CUDA variable for specifying the CUDA_HOST_COMPILER.  This will allow users to
be able to specify which host compiler to use for invoking NVCC with.  By default it will
use the compiler used for host compilation.  This is convenient for when you want to
specify a different compiler than the default compiler.  You end up using the same
compiler for both the NVCC compilation and the host compilation instead of using the
default compiler in the path for NVCC.
2012-08-20 15:14:37 -06:00
Kitware Robot
9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
David Cole
9f18f64c7c Merge topic 'topics/FindCUDA/Quote-fixes'
c3c7a0c Fixes for handling quotes in args and other places (Fix Bug 11726 and 12099).
2011-12-06 15:08:12 -05:00
James Bigler
c3c7a0cfb8 Fixes for handling quotes in args and other places (Fix Bug 11726 and 12099). 2011-12-05 17:16:05 -07:00
James Bigler
83d4eeadac Add work around for CUDA in UNC paths.
Nvcc can emit '/path' instead of '//path' which can cause a lot of grief later.  We test
to see if the file exists, if it doesn't then we see if the file exists with '/'
prepended.  Files that don't exist won't be added to the list.
2011-12-05 16:54:06 -07:00
James Bigler
d2d3672f1c Define __CUDACC__ during dependency scanning, since NVCC doesn't. 2010-01-28 12:58:22 -05:00
James Bigler
2316e04d13 Reordered the arguments, so that user generated arguments go last and thus get precedence. 2010-01-08 12:14:21 -05:00
James Bigler
c9235c0159 Don't allow -G -M on CUDA versions less than 3.0. 2009-11-30 17:05:18 -05:00
James Bigler
94fff7af35 Fix Xcode build.
Move the make_directory command to the main target, so that CMAKE_CFG_INTDIR
will get expanded by the build tool.
2009-10-06 22:52:52 -04:00
James Bigler
7112227c18 Updated copyright notice to conform to NVIDIA guidelines. 2009-10-05 17:14:33 -04:00
James Bigler
b0744ad969 Updated the license on top of each file. 2009-09-29 00:07:46 -04:00
Brad King
393b09cb85 Convert FindCUDA helper newlines from CRLF to LF
These files were committed to the repository with Windows newlines.
This converts them to Unix newlines so they will show up natively.
2009-09-28 11:04:33 -04:00
James Bigler
fb9d7d3c59 Added a command to make the output directory. This is to fix the XCode build that uses a different output directory than other systems, and rather than try to match that we'll just make it. 2009-09-23 00:50:16 -04:00
James Bigler
eaaf71d7b3 Initial version of FindCUDA script. Still needs documentation formatting. 2009-09-15 02:38:20 -04:00