Skip to content

Commit 7099d11

Browse files
KyleFromKitwarekwrobot
authored andcommitted
Merge topic 'support_CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS'
8f1d22c CUDA: Support CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS global variable Acked-by: Kitware Robot <[email protected]> Merge-request: !3636
2 parents dabd169 + 8f1d22c commit 7099d11

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

Help/manual/cmake-variables.7.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ Variables that Control the Build
353353
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
354354
/variable/CMAKE_CONFIG_POSTFIX
355355
/variable/CMAKE_CUDA_SEPARABLE_COMPILATION
356+
/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
356357
/variable/CMAKE_DEBUG_POSTFIX
357358
/variable/CMAKE_ENABLE_EXPORTS
358359
/variable/CMAKE_EXE_LINKER_FLAGS
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cuda-CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
2+
--------------------------------------
3+
4+
* Variable :variable:`CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS` has been
5+
introduced to optionally initialize the
6+
:prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
2+
---------------------------------
3+
4+
Default value for :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target
5+
property. This variable is used to initialize the property on each target as
6+
it is created.

Source/cmTarget.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
343343
initProp("CUDA_EXTENSIONS");
344344
initProp("CUDA_COMPILER_LAUNCHER");
345345
initProp("CUDA_SEPARABLE_COMPILATION");
346+
initProp("CUDA_RESOLVE_DEVICE_SYMBOLS");
346347
initProp("LINK_SEARCH_START_STATIC");
347348
initProp("LINK_SEARCH_END_STATIC");
348349
initProp("FOLDER");

Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ endif()
2727
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
2828
set(CMAKE_CXX_STANDARD 11)
2929
set(CMAKE_CUDA_STANDARD 11)
30+
set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
3031

3132
add_library(CUDANoDeviceResolve SHARED file1.cu)
3233
set_target_properties(CUDANoDeviceResolve
3334
PROPERTIES
3435
CUDA_SEPARABLE_COMPILATION ON
35-
CUDA_RESOLVE_DEVICE_SYMBOLS OFF
3636
POSITION_INDEPENDENT_CODE ON)
3737
if(MSVC)
3838
target_link_options(CUDANoDeviceResolve PRIVATE "/FORCE:UNRESOLVED")

0 commit comments

Comments
 (0)