tra accepted this revision. tra added a comment. This revision is now accepted and ready to land.
LGTM. ================ Comment at: lib/Basic/Cuda.cpp:8-19 @@ +7,14 @@ + +const char *CudaVersionToString(CudaVersion V) { + switch (V) { + case CudaVersion::UNKNOWN: + return "unknown"; + case CudaVersion::CUDA_70: + return "7.0"; + case CudaVersion::CUDA_75: + return "7.5"; + case CudaVersion::CUDA_80: + return "8.0"; + } +} + ---------------- We seem to do a lot of enum->string and string->enum mapping in this file. Is there something comparable to Boost.bimap in standard c++ library or in LLVM? ================ 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) << "}"; ---------------- I think this could be collapsed to just CudaArchToString(CDA->getGpuArch()). "(multiple archs)" is as informative as (and indistinguishable from) "unknown" here. http://reviews.llvm.org/D21867 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits