[PATCH] D23037: [CUDA] Fix libdevice selection.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 15:24:45 PDT 2016


jlebar added inline comments.

================
Comment at: lib/Driver/ToolChains.cpp:4773
@@ +4772,3 @@
+  StringRef GpuArch =
+      DriverArgs.getLastArgValue(options::OPT_march_EQ, "sm_20");
+  std::string LibDeviceFile = CudaInstallation.getLibDeviceFile(GpuArch);
----------------
Hm.  I totally agree that we shouldn't crash (especially because assertions are disabled in production builds!).  But I'm not sure that defaulting to sm_20 every time we read this option is right.  "This option must always be set" seems like an easier invariant to enforce than "whenever you read this option, you must use a default of sm_20, unless you're really sure that it's always set.  And if you think you're really sure, you're probably wrong."  :)


https://reviews.llvm.org/D23037





More information about the cfe-commits mailing list