Browse Source

Merge branch 'vs-cuda-machine' into release-3.10

Merge-request: !1390
Brad King 8 years ago
parent
commit
069c1bd908
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Source/cmVisualStudio10TargetGenerator.cxx

+ 7 - 0
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();