[PATCH] D21867: [CUDA] Add utility functions for dealing with CUDA versions / architectures.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 13:27:43 PDT 2016


tra added inline comments.

================
Comment at: lib/Driver/Driver.cpp:1026-1028
@@ -1024,4 +1025,5 @@
   } else if (CudaDeviceAction *CDA = dyn_cast<CudaDeviceAction>(A)) {
-    os << '"'
-       << (CDA->getGpuArchName() ? CDA->getGpuArchName() : "(multiple archs)")
+    os << '"' << (CDA->getGpuArch() != CudaArch::UNKNOWN
+                      ? CudaArchToString(CDA->getGpuArch())
+                      : "(multiple archs)")
        << '"' << ", {" << PrintActions1(C, *CDA->input_begin(), Ids) << "}";
----------------
jlebar wrote:
> tra wrote:
> > I think this could be collapsed to just CudaArchToString(CDA->getGpuArch()).
> > "(multiple archs)" is as informative as (and indistinguishable from) "unknown" here.
> > 
> > 
> I'm not crazy about "unknown", since it *is* actually known.  How about we just not output anything?
It's a debugging output so it would be good to accurately reflect our internal state.
In this case if we for some reason end up with CudaArch::UNKNOWN, I'd want to know that. 
If we really use UNKNOWN to represent multiple archs, perhaps it needs an enum for multiple-archs.


http://reviews.llvm.org/D21867





More information about the cfe-commits mailing list