summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-10-17 14:32:34 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-17 14:41:41 (GMT)
commitfd90a14f1b98b44dc29a27a46d44d4405a7b0faa (patch)
tree3ae643b423283e109baafd5804b800cb7d465d3c /Source
parenta91eb5e41f486628910f189bf40403568af013c7 (diff)
downloadCMake-fd90a14f1b98b44dc29a27a46d44d4405a7b0faa.zip
CMake-fd90a14f1b98b44dc29a27a46d44d4405a7b0faa.tar.gz
CMake-fd90a14f1b98b44dc29a27a46d44d4405a7b0faa.tar.bz2
VS: Set CUDA TargetMachinePlatform explicitly on x64
The `TargetMachinePlatform` setting tells CUDA what `--machine {32,64}` flag to pass to nvcc. While CUDA automatically chooses the proper default for the target architecture, it does not reflect this in the user-visible IDE settings. Set it explicitly to fix the user-visible setting. Fixes: #17355
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 0087957..c61902a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2648,6 +2648,13 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).ptx");
}
+ // CUDA automatically passes the proper '--machine' flag to nvcc
+ // for the current architecture, but does not reflect this default
+ // in the user-visible IDE settings. Set it explicitly.
+ if (this->Platform == "x64") {
+ cudaOptions.AddFlag("TargetMachinePlatform", "64");
+ }
+
// Convert the host compiler options to the toolset's abstractions
// using a secondary flag table.
cudaOptions.ClearTables();