[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: [PATCH] D21867: [CUDA] Add utility functions for dealing with CUDA versions / architectures.
From:       Artem Belevich via cfe-commits <cfe-commits () lists ! llvm ! org>
Date:       2016-06-30 20:44:05
Message-ID: 64c2d5dbf78eff264742e7c0f3b372f7 () localhost ! localdomain
[Download RAW message or body]

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:
> > 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.
> We really do use UNKNOWN here to represent multiple architectures.  It is used for \
> the architecture of the Action corresponding to the call to fatbin. 
> I think adding an enum value for multiple-archs is going to be more harmful than \
> useful, because it means that everywhere that we switch() on arch, we're going to \
> have to handle (and assert) MULTIPLE_ARCHs.
OK. No output is fine with me.


http://reviews.llvm.org/D21867



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic