[PATCH] D13144: [CUDA] propagate to CUDA sub-compilations target triple of opposite side.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 14:22:14 PST 2015


echristo accepted this revision.
echristo added a comment.
This revision is now accepted and ready to land.

One inline comment then OK for now.

-eric


================
Comment at: lib/Driver/Tools.cpp:3227-3240
@@ -3226,2 +3226,16 @@
 
+  if (IsCuda) {
+    const ToolChain *AuxToolChain;
+    if (&getToolChain() == C.getCudaDeviceToolChain())
+      AuxToolChain = C.getCudaHostToolChain();
+    else if (&getToolChain() == C.getCudaHostToolChain())
+      AuxToolChain = C.getCudaDeviceToolChain();
+    else
+      llvm_unreachable("Can't figure out CUDA compilation mode.");
+    if (AuxToolChain) {
+      CmdArgs.push_back("-aux-triple");
+      CmdArgs.push_back(Args.MakeArgString(AuxToolChain->getTriple().str()));
+    }
+  }
+
   if (Triple.isOSWindows() && (Triple.getArch() == llvm::Triple::arm ||
----------------
This is pretty heinous. I don't have a better way of doing it offhand, but please document this with a rather large FIXME and continue on the path to generic compilation support we've been talking about.


http://reviews.llvm.org/D13144





More information about the cfe-commits mailing list