Merge topic 'device-link'

4248bb452a CUDA: Device linking use now link options
ec48e023f6 CUDA: Add information for LINKER: pattern translation
3fdae5acaa Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>
38332fc4fa cmGeneratorExpressionDAGChecker: introduce method Top()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4577
This commit is contained in:
Brad King
2020-04-20 12:14:01 +00:00
committed by Kitware Robot
125 changed files with 986 additions and 212 deletions
+10
View File
@@ -0,0 +1,10 @@
When a device link step is involved, which is controlled by
:prop_tgt:`CUDA_SEPARABLE_COMPILATION` and
:prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties, the raw options will be
delivered to the host and device link steps (wrapped in ``-Xcompiler`` or
equivalent for device link). Options wrapped with ``$<DEVICE_LINK:...>``
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
only for the device link step. Options wrapped with ``$<HOST_LINK:...>``
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
only for the host link step.
+2
View File
@@ -26,6 +26,8 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: DEVICE_LINK_OPTIONS.txt
.. include:: OPTIONS_SHELL.txt
.. include:: LINK_OPTIONS_LINKER.txt
+2
View File
@@ -43,6 +43,8 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: DEVICE_LINK_OPTIONS.txt
.. include:: OPTIONS_SHELL.txt
.. include:: LINK_OPTIONS_LINKER.txt
@@ -362,6 +362,18 @@ Variable Queries
evaluation will give ``C`` as link language, so the second pass will
correctly add target ``libother`` as link dependency.
``$<DEVICE_LINK:list>``
Returns the list if it is the device link step, an empty list otherwise.
The device link step is controlled by :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
and :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties. This expression can
only be used to specify link options.
``$<HOST_LINK:list>``
Returns the list if it is the normal link step, an empty list otherwise.
This expression is mainly useful when a device link step is also involved
(see ``$<DEVICE_LINK:list>`` generator expression). This expression can only
be used to specify link options.
String-Valued Generator Expressions
===================================
+1
View File
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.18
.. toctree::
:maxdepth: 1
CMP0105: Device link step uses the link options. </policy/CMP0105>
CMP0104: CMAKE_CUDA_ARCHITECTURES now detected for NVCC, empty CUDA_ARCHITECTURES not allowed. </policy/CMP0104>
CMP0103: Multiple export() with same FILE without APPEND is not allowed. </policy/CMP0103>
+19
View File
@@ -0,0 +1,19 @@
CMP0105
-------
:prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
properties are now used for the device link step.
In CMake 3.17 and below, link options are not used by the device link step.
The ``OLD`` behavior for this policy is to ignore the link options.
The ``NEW`` behavior of this policy is to use the link options during the
device link step.
This policy was introduced in CMake version 3.17. Use the
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
Unlike many policies, CMake version |release| does *not* warn
when this policy is not set and simply uses ``OLD`` behavior.
.. include:: DEPRECATED.txt
+1 -1
View File
@@ -2,7 +2,7 @@ LINK_OPTIONS
------------
List of options to use for the link step of shared library, module
and executable targets.
and executable targets as well as the device link step.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
given so far to the :command:`add_link_options` command.
+8 -4
View File
@@ -2,12 +2,16 @@ LINK_OPTIONS
------------
List of options to use for the link step of shared library, module
and executable targets. Targets that are static libraries need to use
the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
and executable targets as well as the device link step. Targets that are static
libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
These options are used for both normal linking and device linking
(see policy :policy:`CMP0105`). To control link options for normal and device
link steps, ``$<HOST_LINK>`` and ``$<DEVICE_LINK>``
:manual:`generator expressions <cmake-generator-expressions(7)>` can be used.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use the :command:`target_link_options`
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of
options specified so far for its target. Use the :command:`target_link_options`
command to append more options.
This property is initialized by the :prop_dir:`LINK_OPTIONS` directory
+5
View File
@@ -0,0 +1,5 @@
device-link-options
-------------------
* the :prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
properties are now used for the device link step. See policy :policy:`CMP0105`.
@@ -0,0 +1,6 @@
genex-DEVICE_LINK-HOST_LINK
---------------------------
* To manage device and host link steps, the ``$<DEVICE_LINK:...>`` and
``$<HOST_LINK:...>``
:manual:`generator expressions <cmake-generator-expressions(7)>` were added.