"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Modules/FindCUDA.cmake" between
cmake-3.13.4.tar.gz and cmake-3.14.0-rc1.tar.gz

About: CMake is a cross-platform build system designed to build, test and package software. Release candidate.

FindCUDA.cmake  (cmake-3.13.4):FindCUDA.cmake  (cmake-3.14.0-rc1)
#.rst: #[=======================================================================[.rst:
# FindCUDA FindCUDA
# -------- --------
#
# .. note:: .. deprecated:: 3.10
#
# The FindCUDA module has been superseded by first-class support Superseded by first-class support for the CUDA language in CMake.
# for the CUDA language in CMake. It is no longer necessary to
# use this module or call ``find_package(CUDA)``. This module Replacement
# now exists only for compatibility with projects that have not ^^^^^^^^^^^
# been ported.
# It is no longer necessary to use this module or call ``find_package(CUDA)``.
# Instead, list ``CUDA`` among the languages named in the top-level Instead, list ``CUDA`` among the languages named in the top-level
# call to the :command:`project` command, or call the call to the :command:`project` command, or call the
# :command:`enable_language` command with ``CUDA``. :command:`enable_language` command with ``CUDA``.
# Then one can add CUDA (``.cu``) sources to programs directly Then one can add CUDA (``.cu``) sources to programs directly
# in calls to :command:`add_library` and :command:`add_executable`. in calls to :command:`add_library` and :command:`add_executable`.
#
# Tools for building CUDA C files: libraries and build dependencies. Documentation of Deprecated Usage
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# This script locates the NVIDIA CUDA C tools. It should work on Linux,
# Windows, and macOS and should be reasonably up to date with CUDA C Tools for building CUDA C files: libraries and build dependencies.
# releases.
# This script locates the NVIDIA CUDA C tools. It should work on Linux,
# This script makes use of the standard :command:`find_package` arguments of Windows, and macOS and should be reasonably up to date with CUDA C
# ``<VERSION>``, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an releases.
# acceptable version of CUDA was found.
# This script makes use of the standard :command:`find_package` arguments of
# The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if ``<VERSION>``, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an
# the prefix cannot be determined by the location of nvcc in the system acceptable version of CUDA was found.
# path and ``REQUIRED`` is specified to :command:`find_package`. To use
# a different installed version of the toolkit set the environment variable The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if
# ``CUDA_BIN_PATH`` before running cmake (e.g. the prefix cannot be determined by the location of nvcc in the system
# ``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default path and ``REQUIRED`` is specified to :command:`find_package`. To use
# ``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If a different installed version of the toolkit set the environment variable
# you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that ``CUDA_BIN_PATH`` before running cmake (e.g.
# depend on the path will be relocated. ``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default
# ``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If
# It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that
# platforms, or to use a CUDA runtime not installed in the default depend on the path will be relocated.
# location. In newer versions of the toolkit the CUDA library is
# included with the graphics driver -- be sure that the driver version It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain
# matches what is needed by the CUDA runtime version. platforms, or to use a CUDA runtime not installed in the default
# location. In newer versions of the toolkit the CUDA library is
# The following variables affect the behavior of the macros in the included with the graphics driver -- be sure that the driver version
# script (in alphabetical order). Note that any of these flags can be matches what is needed by the CUDA runtime version.
# changed multiple times in the same directory before calling
# ``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, The following variables affect the behavior of the macros in the
# ``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` script (in alphabetical order). Note that any of these flags can be
# or ``CUDA_WRAP_SRCS``:: changed multiple times in the same directory before calling
# ``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``,
# CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) ``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN``
# -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. or ``CUDA_WRAP_SRCS``::
# Note that making this different from the host code when generating object
# or C files from CUDA code just won't work, because size_t gets defined by CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
# nvcc in the generated source. If you compile to PTX and then load the -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
# file yourself, you can mix bit sizes between device and host. Note that making this different from the host code when generating object
# or C files from CUDA code just won't work, because size_t gets defined by
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) nvcc in the generated source. If you compile to PTX and then load the
# -- Set to ON if you want the custom build rule to be attached to the source file yourself, you can mix bit sizes between device and host.
# file in Visual Studio. Turn OFF if you add the same cuda file to multipl
e CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
# targets. -- Set to ON if you want the custom build rule to be attached to the source
# file in Visual Studio. Turn OFF if you add the same cuda file to multiple
# This allows the user to build the target from the CUDA file; however, bad targets.
# things can happen if the CUDA source file is added to multiple targets.
# When performing parallel builds it is possible for the custom build This allows the user to build the target from the CUDA file; however, bad
# command to be run more than once and in parallel causing cryptic build things can happen if the CUDA source file is added to multiple targets.
# errors. VS runs the rules for every source file in the target, and a When performing parallel builds it is possible for the custom build
# source can have only one rule no matter how many projects it is added to. command to be run more than once and in parallel causing cryptic build
# When the rule is run from multiple targets race conditions can occur on errors. VS runs the rules for every source file in the target, and a
# the generated file. Eventually everything will get built, but if the use source can have only one rule no matter how many projects it is added to.
r When the rule is run from multiple targets race conditions can occur on
# is unaware of this behavior, there may be confusion. It would be nice if the generated file. Eventually everything will get built, but if the user
# this script could detect the reuse of source files across multiple target is unaware of this behavior, there may be confusion. It would be nice if
s this script could detect the reuse of source files across multiple targets
# and turn the option off for the user, but no good solution could be found and turn the option off for the user, but no good solution could be found.
.
# CUDA_BUILD_CUBIN (Default OFF)
# CUDA_BUILD_CUBIN (Default OFF) -- Set to ON to enable and extra compilation pass with the -cubin option in
# -- Set to ON to enable and extra compilation pass with the -cubin option in Device mode. The output is parsed and register, shared memory usage is
# Device mode. The output is parsed and register, shared memory usage is printed during build.
# printed during build.
# CUDA_BUILD_EMULATION (Default OFF for device mode)
# CUDA_BUILD_EMULATION (Default OFF for device mode) -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
# -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files when CUDA_BUILD_EMULATION is TRUE.
# when CUDA_BUILD_EMULATION is TRUE.
# CUDA_LINK_LIBRARIES_KEYWORD (Default "")
# CUDA_LINK_LIBRARIES_KEYWORD (Default "") -- The <PRIVATE|PUBLIC|INTERFACE> keyword to use for internal
# -- The <PRIVATE|PUBLIC|INTERFACE> keyword to use for internal target_link_libraries calls. The default is to use no keyword which
# target_link_libraries calls. The default is to use no keyword which uses the old "plain" form of target_link_libraries. Note that is matters
# uses the old "plain" form of target_link_libraries. Note that is matters because whatever is used inside the FindCUDA module must also be used
# because whatever is used inside the FindCUDA module must also be used outside - the two forms of target_link_libraries cannot be mixed.
# outside - the two forms of target_link_libraries cannot be mixed.
# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) -- Set to the path you wish to have the generated files placed. If it is
# -- Set to the path you wish to have the generated files placed. If it is blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
# blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. Intermediate files will always be placed in
# Intermediate files will always be placed in CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
# CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
# CUDA_HOST_COMPILATION_CPP (Default ON)
# CUDA_HOST_COMPILATION_CPP (Default ON) -- Set to OFF for C compilation of host code.
# -- Set to OFF for C compilation of host code.
# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER)
# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
# --compiler-bindir is already present in the CUDA_NVCC_FLAGS or CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets,
# CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets, the host compiler is constructed with one or more visual studio macros
# the host compiler is constructed with one or more visual studio macros such as $(VCInstallDir), that expands out to the path when
# such as $(VCInstallDir), that expands out to the path when the command is run from within VS.
# the command is run from within VS. If the CUDAHOSTCXX environment variable is set it will
# If the CUDAHOSTCXX environment variable is set it will be used as the default.
# be used as the default.
# CUDA_NVCC_FLAGS
# CUDA_NVCC_FLAGS CUDA_NVCC_FLAGS_<CONFIG>
# CUDA_NVCC_FLAGS_<CONFIG> -- Additional NVCC command line arguments. NOTE: multiple arguments must be
# -- Additional NVCC command line arguments. NOTE: multiple arguments must be semi-colon delimited (e.g. --compiler-options;-Wall)
# semi-colon delimited (e.g. --compiler-options;-Wall)
# CUDA_PROPAGATE_HOST_FLAGS (Default ON)
# CUDA_PROPAGATE_HOST_FLAGS (Default ON) -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
# -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
# dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the host compiler through nvcc's -Xcompiler flag. This helps make the
# host compiler through nvcc's -Xcompiler flag. This helps make the generated host code match the rest of the system better. Sometimes
# generated host code match the rest of the system better. Sometimes certain flags give nvcc problems, and this will help you turn the flag
# certain flags give nvcc problems, and this will help you turn the flag propagation off. This does not affect the flags supplied directly to nvcc
# propagation off. This does not affect the flags supplied directly to nvc via CUDA_NVCC_FLAGS or through the OPTION flags specified through
c CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
# via CUDA_NVCC_FLAGS or through the OPTION flags specified through shared library compilation are not affected by this flag.
# CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
# shared library compilation are not affected by this flag. CUDA_SEPARABLE_COMPILATION (Default OFF)
# -- If set this will enable separable compilation for all CUDA runtime object
# CUDA_SEPARABLE_COMPILATION (Default OFF) files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
# -- If set this will enable separable compilation for all CUDA runtime object (e.g. calling CUDA_WRAP_SRCS directly),
# files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
# (e.g. calling CUDA_WRAP_SRCS directly), CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. CUDA_SOURCE_PROPERTY_FORMAT
# -- If this source file property is set, it can override the format specified
# CUDA_SOURCE_PROPERTY_FORMAT to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file
# -- If this source file property is set, it can override the format specified is not a .cu file, setting this file will cause it to be treated as a .cu
# to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file file. See documentation for set_source_files_properties on how to set
# is not a .cu file, setting this file will cause it to be treated as a .cu this property.
# file. See documentation for set_source_files_properties on how to set
# this property. CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
# -- When enabled the static version of the CUDA runtime library will be used
# CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) in CUDA_LIBRARIES. If the version of CUDA configured doesn't support
# -- When enabled the static version of the CUDA runtime library will be used this option, then it will be silently disabled.
# in CUDA_LIBRARIES. If the version of CUDA configured doesn't support
# this option, then it will be silently disabled. CUDA_VERBOSE_BUILD (Default OFF)
# -- Set to ON to see all the commands used when building the CUDA file. When
# CUDA_VERBOSE_BUILD (Default OFF) using a Makefile generator the value defaults to VERBOSE (run make
# -- Set to ON to see all the commands used when building the CUDA file. When VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
# using a Makefile generator the value defaults to VERBOSE (run make always print the output.
# VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
# always print the output. The script creates the following macros (in alphabetical order)::
#
# The script creates the following macros (in alphabetical order):: CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
# -- Adds the cufft library to the target (can be any target). Handles whether
# CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) you are in emulation mode or not.
# -- Adds the cufft library to the target (can be any target). Handles whethe
r CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
# you are in emulation mode or not. -- Adds the cublas library to the target (can be any target). Handles
# whether you are in emulation mode or not.
# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
# -- Adds the cublas library to the target (can be any target). Handles CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
# whether you are in emulation mode or not. [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...]
# )
# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... -- Creates an executable "cuda_target" which is made up of the files
# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ... specified. All of the non CUDA C files are compiled using the standard
] ) build rules specified by CMAKE and the cuda files are compiled to object
# -- Creates an executable "cuda_target" which is made up of the files files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
# specified. All of the non CUDA C files are compiled using the standard added automatically to include_directories(). Some standard CMake target
# build rules specified by CMAKE and the cuda files are compiled to object calls can be used on the target after calling this macro
# files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is (e.g. set_target_properties and target_link_libraries), but setting
# added automatically to include_directories(). Some standard CMake target properties that adjust compilation flags will not affect code compiled by
# calls can be used on the target after calling this macro nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
# (e.g. set_target_properties and target_link_libraries), but setting CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
# properties that adjust compilation flags will not affect code compiled by
# nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...]
# )
# CUDA_ADD_LIBRARY( cuda_target file0 file1 ... -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...
] ) CUDA_BUILD_CLEAN_TARGET()
# -- Same as CUDA_ADD_EXECUTABLE except that a library is created. -- Creates a convenience target that deletes all the dependency files
# generated. You should make clean after running this target to ensure the
# CUDA_BUILD_CLEAN_TARGET() dependency files get regenerated.
# -- Creates a convenience target that deletes all the dependency files
# generated. You should make clean after running this target to ensure the CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
# dependency files get regenerated. [OPTIONS ...] )
# -- Returns a list of generated files from the input source files to be used
# CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] with ADD_LIBRARY or ADD_EXECUTABLE.
# [OPTIONS ...] )
# -- Returns a list of generated files from the input source files to be used CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
# with ADD_LIBRARY or ADD_EXECUTABLE. -- Returns a list of PTX files generated from the input source files.
#
# CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
# -- Returns a list of PTX files generated from the input source files. -- Returns a list of FATBIN files generated from the input source files.
#
# CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
# -- Returns a list of FATBIN files generated from the input source files. -- Returns a list of CUBIN files generated from the input source files.
#
# CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
# -- Returns a list of CUBIN files generated from the input source files. cuda_target
# object_files )
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var -- Compute the name of the intermediate link file used for separable
# cuda_target compilation. This file name is typically passed into
# object_files ) CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced
# -- Compute the name of the intermediate link file used for separable based on cuda_target the list of objects files that need separable
# compilation. This file name is typically passed into compilation as specified by object_files. If the object_files list is
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced empty, then output_file_var will be empty. This function is called
# based on cuda_target the list of objects files that need separable automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
# compilation as specified by object_files. If the object_files list is this is a function and not a macro.
# empty, then output_file_var will be empty. This function is called
# automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
# this is a function and not a macro. -- Sets the directories that should be passed to nvcc
# (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
# CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) files.
# -- Sets the directories that should be passed to nvcc
# (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
# files. nvcc_flags object_files)
# -- Generates the link object required by separable compilation from the given
# object files. This is called automatically for CUDA_ADD_EXECUTABLE and
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
# nvcc_flags object_files) directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
# -- Generates the link object required by separable compilation from the give nvcc_flags passed in are the same as the flags passed in via the OPTIONS
n argument. The only nvcc flag added automatically is the bitness flag as
# object files. This is called automatically for CUDA_ADD_EXECUTABLE and specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
# CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS instead of a macro.
# directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
# nvcc_flags passed in are the same as the flags passed in via the OPTIONS CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures])
# argument. The only nvcc flag added automatically is the bitness flag as -- Selects GPU arch flags for nvcc based on target_CUDA_architectures
# specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...)
# instead of a macro. - "Auto" detects local machine GPU compute arch at runtime.
# - "Common" and "All" cover common and entire subsets of architectures
# CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
# -- Selects GPU arch flags for nvcc based on target_CUDA_architectures NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal
# target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) NUM: Any number. Only those pairs are currently accepted by NVCC though:
# - "Auto" detects local machine GPU compute arch at runtime. 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2
# - "Common" and "All" cover common and entire subsets of architectures Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
# ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX Additionally, sets ${out_variable}_readable to the resulting numeric list
# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Example:
# NUM: Any number. Only those pairs are currently accepted by NVCC though: CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
# Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
# Additionally, sets ${out_variable}_readable to the resulting numeric list More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
# Example: Note that this is a function instead of a macro.
# CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
# LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
# [STATIC | SHARED | MODULE] [OPTIONS ...] )
# More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
# Note that this is a function instead of a macro. CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
# function under the hood.
# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
# [STATIC | SHARED | MODULE] [OPTIONS ...] ) Given the list of files (file0 file1 ... fileN) this macro generates
# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, custom commands that generate either PTX or linkable objects (use "PTX" or
# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this "OBJ" for the format argument to switch). Files that don't end with .cu
# function under the hood. or have the HEADER_FILE_ONLY property are ignored.
#
# Given the list of files (file0 file1 ... fileN) this macro generates The arguments passed in after OPTIONS are extra command line options to
# custom commands that generate either PTX or linkable objects (use "PTX" o give to nvcc. You can also specify per configuration options by
r specifying the name of the configuration followed by the options. General
# "OBJ" for the format argument to switch). Files that don't end with .cu options must precede configuration specific options. Not all
# or have the HEADER_FILE_ONLY property are ignored. configurations need to be specified, only the ones provided will be used.
#
# The arguments passed in after OPTIONS are extra command line options to OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
# give to nvcc. You can also specify per configuration options by DEBUG -g
# specifying the name of the configuration followed by the options. Genera RELEASE --use_fast_math
l RELWITHDEBINFO --use_fast_math;-g
# options must precede configuration specific options. Not all MINSIZEREL --use_fast_math
# configurations need to be specified, only the ones provided will be used.
# For certain configurations (namely VS generating object files with
# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
# DEBUG -g be produced for the given cuda file. This is because when you add the
# RELEASE --use_fast_math cuda file to Visual Studio it knows that this file produces an object file
# RELWITHDEBINFO --use_fast_math;-g and will link in the resulting object file automatically.
# MINSIZEREL --use_fast_math
# This script will also generate a separate cmake script that is used at
# For certain configurations (namely VS generating object files with build time to invoke nvcc. This is for several reasons.
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
# be produced for the given cuda file. This is because when you add the 1. nvcc can return negative numbers as return values which confuses
# cuda file to Visual Studio it knows that this file produces an object fil Visual Studio into thinking that the command succeeded. The script now
e checks the error codes and produces errors when there was a problem.
# and will link in the resulting object file automatically.
# 2. nvcc has been known to not delete incomplete results when it
# This script will also generate a separate cmake script that is used at encounters problems. This confuses build systems into thinking the
# build time to invoke nvcc. This is for several reasons. target was generated when in fact an unusable file exists. The script
# now deletes the output files if there was an error.
# 1. nvcc can return negative numbers as return values which confuses
# Visual Studio into thinking that the command succeeded. The script now 3. By putting all the options that affect the build into a file and then
# checks the error codes and produces errors when there was a problem. make the build rule dependent on the file, the output files will be
# regenerated when the options change.
# 2. nvcc has been known to not delete incomplete results when it
# encounters problems. This confuses build systems into thinking the This script also looks at optional arguments STATIC, SHARED, or MODULE to
# target was generated when in fact an unusable file exists. The script determine when to target the object compilation for a shared library.
# now deletes the output files if there was an error. BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
# CUDA_ADD_LIBRARY. On some systems special flags are added for building
# 3. By putting all the options that affect the build into a file and the objects intended for shared libraries. A preprocessor macro,
n <target_name>_EXPORTS is defined when a shared library compilation is
# make the build rule dependent on the file, the output files will be detected.
# regenerated when the options change.
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
# determine when to target the object compilation for a shared library. The script defines the following variables::
# BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
# CUDA_ADD_LIBRARY. On some systems special flags are added for building CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
# objects intended for shared libraries. A preprocessor macro, CUDA_VERSION_MINOR -- The minor version.
# <target_name>_EXPORTS is defined when a shared library compilation is CUDA_VERSION
# detected. CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
# CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported.
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
# SDK. This script will not directly support finding
# The script defines the following variables:: specific libraries or headers, as that isn't
# supported by NVIDIA. If you want to change
# CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. libraries when the path changes see the
# CUDA_VERSION_MINOR -- The minor version. FindCUDA.cmake script for an example of how to clear
# CUDA_VERSION these variables. There are also examples of how to
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR use the CUDA_SDK_ROOT_DIR to locate headers or
# CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. libraries, if you so choose (at your own risk).
# CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatica
# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). lly
# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in th for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
e CUDA_LIBRARIES -- Cuda RT library.
# SDK. This script will not directly support finding CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
# specific libraries or headers, as that isn't implementation (alternative to:
# supported by NVIDIA. If you want to change CUDA_ADD_CUFFT_TO_TARGET macro)
# libraries when the path changes see the CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
# FindCUDA.cmake script for an example of how to clea implementation (alternative to:
r CUDA_ADD_CUBLAS_TO_TARGET macro).
# these variables. There are also examples of how to CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library.
# use the CUDA_SDK_ROOT_DIR to locate headers or Only available for CUDA version 5.5+
# libraries, if you so choose (at your own risk). CUDA_cudadevrt_LIBRARY -- Device runtime library.
# CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automati Required for separable compilation.
cally CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
# for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. Only available for CUDA version 4.0+.
# CUDA_LIBRARIES -- Cuda RT library. CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
# CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT Only available for CUDA version 3.2+.
# implementation (alternative to: CUDA_cusolver_LIBRARY -- CUDA Direct Solver library.
# CUDA_ADD_CUFFT_TO_TARGET macro) Only available for CUDA version 7.0+.
# CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
# implementation (alternative to: Only available for CUDA version 3.2+.
# CUDA_ADD_CUBLAS_TO_TARGET macro). CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib.
# CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. Only available for CUDA version 4.0+.
# Only available for CUDA version 5.5+ CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
# CUDA_cudadevrt_LIBRARY -- Device runtime library. Only available for CUDA version 5.5+.
# Required for separable compilation. CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. Only available for CUDA version 5.5 - 8.0.
# Only available for CUDA version 4.0+. CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_curand_LIBRARY -- CUDA Random Number Generation library. Only available for CUDA version 9.0.
# Only available for CUDA version 3.2+. CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. Only available for CUDA version 9.0.
# Only available for CUDA version 7.0+. CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. Only available for CUDA version 9.0.
# Only available for CUDA version 3.2+. CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. Only available for CUDA version 9.0.
# Only available for CUDA version 4.0+. CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). Only available for CUDA version 9.0.
# Only available for CUDA version 5.5+. CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing Only available for CUDA version 9.0.
). CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# Only available for CUDA version 5.5 - 8.0. Only available for CUDA version 9.0.
# CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
). Only available for CUDA version 9.0.
# Only available for CUDA version 9.0. CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing Only available for CUDA version 9.0.
). CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# Only available for CUDA version 9.0. Only available for CUDA version 9.0.
# CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing)
). .
# Only available for CUDA version 9.0. Only available for CUDA version 5.5+.
# CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
). Only available for CUDA version 3.2+.
# Only available for CUDA version 9.0. Windows only.
# CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
). Only available for CUDA version 3.2+.
# Only available for CUDA version 9.0. Windows only.
# CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing
). #]=======================================================================]
# Only available for CUDA version 9.0.
# CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing
).
# Only available for CUDA version 9.0.
# CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing
).
# Only available for CUDA version 9.0.
# CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing
).
# Only available for CUDA version 9.0.
# CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing
).
# Only available for CUDA version 9.0.
# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processin
g).
# Only available for CUDA version 5.5+.
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
# Only available for CUDA version 3.2+.
# Windows only.
# CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
# Only available for CUDA version 3.2+.
# Windows only.
#
# James Bigler, NVIDIA Corp (nvidia.com - jbigler) # James Bigler, NVIDIA Corp (nvidia.com - jbigler)
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html # Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
# #
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. # Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
# #
# Copyright (c) 2007-2009 # Copyright (c) 2007-2009
# Scientific Computing and Imaging Institute, University of Utah # Scientific Computing and Imaging Institute, University of Utah
# #
# This code is licensed under the MIT License. See the FindCUDA.cmake script # This code is licensed under the MIT License. See the FindCUDA.cmake script
skipping to change at line 869 skipping to change at line 870
set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY)
endif() endif()
if(NOT CUDA_VERSION VERSION_LESS "5.0") if(NOT CUDA_VERSION VERSION_LESS "5.0")
cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library")
mark_as_advanced(CUDA_cudadevrt_LIBRARY) mark_as_advanced(CUDA_cudadevrt_LIBRARY)
endif() endif()
if(CUDA_USE_STATIC_CUDA_RUNTIME) if(CUDA_USE_STATIC_CUDA_RUNTIME)
if(UNIX) if(UNIX)
# Check for the dependent libraries. Here we look for pthreads. # Check for the dependent libraries.
if (DEFINED CMAKE_THREAD_PREFER_PTHREAD)
set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD})
endif()
set(CMAKE_THREAD_PREFER_PTHREAD 1)
# Many of the FindXYZ CMake comes with makes use of try_compile with int mai n(){return 0;} # Many of the FindXYZ CMake comes with makes use of try_compile with int mai n(){return 0;}
# as the source file. Unfortunately this causes a warning with -Wstrict-pro totypes and # as the source file. Unfortunately this causes a warning with -Wstrict-pro totypes and
# -Werror causes the try_compile to fail. We will just temporarily disable other flags # -Werror causes the try_compile to fail. We will just temporarily disable other flags
# when doing the find_package command here. # when doing the find_package command here.
set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "-fPIC") set(CMAKE_C_FLAGS "-fPIC")
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags})
if (DEFINED _cuda_cmake_thread_prefer_pthread)
set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread})
unset(_cuda_cmake_thread_prefer_pthread)
else()
unset(CMAKE_THREAD_PREFER_PTHREAD)
endif()
if(NOT APPLE) if(NOT APPLE)
#On Linux, you must link against librt when using the static cuda runtime. #On Linux, you must link against librt when using the static cuda runtime.
find_library(CUDA_rt_LIBRARY rt) find_library(CUDA_rt_LIBRARY rt)
if (NOT CUDA_rt_LIBRARY) if (NOT CUDA_rt_LIBRARY)
message(WARNING "Expecting to find librt for libcudart_static, but didn' t find it.") message(WARNING "Expecting to find librt for libcudart_static, but didn' t find it.")
endif() endif()
endif() endif()
endif() endif()
endif() endif()
 End of changes. 3 change blocks. 
415 lines changed or deleted 381 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)