Przeglądaj źródła

VS: Place CUDA host compiler options in proper project file fields

Original header commit v3.9.0-rc1~431^2~6

The CUDA Toolkit's VS integration provides abstractions for host
compiler options for `nvcc` to pass through `-Xcompiler` to the host
MSVC.  Populate our secondary flag table and use it to remove flags from
the `AdditionalCompilerOptions` in favor of their abstractions.

Unfortunately a bug in the CUDA 8.0 VS integration prevents us from
passing anything in `AdditionalCompilerOptions` reliably.  After taking
out the flags that have dedicated abstractions, drop the rest.
Stephan Szabo 7 lat temu
rodzic
commit
f044bbbf08

+ 20 - 0
Templates/MSBuild/FlagTables/v10_Cuda.json

@@ -1,2 +1,22 @@
 [
+  {
+    "name":  "AdditionalCompilerOptions",
+    "switch": "Xcompiler=",
+    "comment": "Host compiler options",
+    "value": "",
+    "flags": [
+      "UserValue",
+      "SpaceAppendable"
+    ]
+  },
+  {
+    "name":  "AdditionalCompilerOptions",
+    "switch": "Xcompiler",
+    "comment": "Host compiler options",
+    "value": "",
+    "flags": [
+      "UserFollowing",
+      "SpaceAppendable"
+    ]
+  }
 ]

+ 147 - 0
Templates/MSBuild/FlagTables/v10_CudaHost.json

@@ -1,2 +1,149 @@
 [
+  {
+    "name":  "Optimization",
+    "switch": "Od",
+    "comment": "Disabled",
+    "value": "Od",
+    "flags": []
+  },
+  {
+    "name":  "Optimization",
+    "switch": "O1",
+    "comment": "Minimize Size",
+    "value": "O1",
+    "flags": []
+  },
+  {
+    "name":  "Optimization",
+    "switch": "O2",
+    "comment": "Maximize Speed",
+    "value": "O2",
+    "flags": []
+  },
+  {
+    "name":  "Optimization",
+    "switch": "Ox",
+    "comment": "Full Optimization",
+    "value": "O3",
+    "flags": []
+  },
+  {
+    "name":  "Runtime",
+    "switch": "MT",
+    "comment": "Multi-Threaded",
+    "value": "MT",
+    "flags": []
+  },
+  {
+    "name":  "Runtime",
+    "switch": "MTd",
+    "comment": "Multi-Threaded Debug",
+    "value": "MTd",
+    "flags": []
+  },
+  {
+    "name":  "Runtime",
+    "switch": "MD",
+    "comment": "Multi-Threaded DLL",
+    "value": "MD",
+    "flags": []
+  },
+  {
+    "name":  "Runtime",
+    "switch": "MDd",
+    "comment": "Multi-threaded Debug DLL",
+    "value": "MDd",
+    "flags": []
+  },
+  {
+    "name":  "Runtime",
+    "switch": "ML",
+    "comment": "Single-Threaded",
+    "value": "ML",
+    "flags": []
+  },
+  {
+    "name":  "Runtime",
+    "switch": "MLd",
+    "comment": "Single-Threaded Debug",
+    "value": "MLd",
+    "flags": []
+  },
+  {
+    "name":  "RuntimeChecks",
+    "switch": "RTCs",
+    "comment": "Stack Frames",
+    "value": "RTCs",
+    "flags": []
+  },
+  {
+    "name":  "RuntimeChecks",
+    "switch": "RTCu",
+    "comment": "Uninitialized Variables",
+    "value": "RTCu",
+    "flags": []
+  },
+  {
+    "name":  "RuntimeChecks",
+    "switch": "RTC1",
+    "comment": "Both",
+    "value": "RTC1",
+    "flags": []
+  },
+  {
+    "name":  "TypeInfo",
+    "switch": "GR",
+    "comment": "Yes",
+    "value": "true",
+    "flags": []
+  },
+  {
+    "name":  "TypeInfo",
+    "switch": "GR-",
+    "comment": "No",
+    "value": "false",
+    "flags": []
+  },
+  {
+    "name":  "Warning",
+    "switch": "W0",
+    "comment": "Off: Turn Off All Warnings",
+    "value": "W0",
+    "flags": []
+  },
+  {
+    "name":  "Warning",
+    "switch": "W1",
+    "comment": "Level 1",
+    "value": "W1",
+    "flags": []
+  },
+  {
+    "name":  "Warning",
+    "switch": "W2",
+    "comment": "Level 2",
+    "value": "W2",
+    "flags": []
+  },
+  {
+    "name":  "Warning",
+    "switch": "W3",
+    "comment": "Level 3",
+    "value": "W3",
+    "flags": []
+  },
+  {
+    "name":  "Warning",
+    "switch": "W4",
+    "comment": "Level 4",
+    "value": "W4",
+    "flags": []
+  },
+  {
+    "name":  "Warning",
+    "switch": "Wall",
+    "comment": "Enable All Warnings",
+    "value": "Wall",
+    "flags": []
+  }
 ]