diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2019-05-09 13:13:39 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2019-05-21 15:40:07 (GMT) |
commit | 81b4d10d8f421242f9989ff0c2d37a12be66f405 (patch) | |
tree | 74ee6499eb43e48f18dd41ff0b0b1bdd809768cc /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 3205c7c950d5b90d47ce1c5c58073e511339b78c (diff) | |
download | CMake-81b4d10d8f421242f9989ff0c2d37a12be66f405.zip CMake-81b4d10d8f421242f9989ff0c2d37a12be66f405.tar.gz CMake-81b4d10d8f421242f9989ff0c2d37a12be66f405.tar.bz2 |
CUDA: More exhaustive checks to determine when to do device linking
Previously CMake used fairly naive logic to determine when to do
device linking which caused unnecessary device linking to occur
frequently. We now use a more exhaustive algorithm to determine
when we have a need for device linking.
Fixes: #19238
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index c60706d..0685a41 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -10,6 +10,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalVisualStudio10Generator.h" +#include "cmLinkLineDeviceComputer.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" @@ -3007,21 +3008,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions( Options& cudaLinkOptions = *pOptions; // Determine if we need to do a device link - bool doDeviceLinking = false; - if (const char* resolveDeviceSymbols = - this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) { - doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols); - } else { - switch (this->GeneratorTarget->GetType()) { - case cmStateEnums::SHARED_LIBRARY: - case cmStateEnums::MODULE_LIBRARY: - case cmStateEnums::EXECUTABLE: - doDeviceLinking = true; - break; - default: - break; - } - } + bool doDeviceLinking = requireDeviceLinking( + *this->GeneratorTarget, *this->LocalGenerator, configName); cudaLinkOptions.AddFlag("PerformDeviceLink", doDeviceLinking ? "true" : "false"); |