[PATCH] D75811: [CUDA] Choose default architecture based on CUDA installation

Raul Tambre via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 7 10:16:51 PST 2020


tambre created this revision.
tambre added reviewers: tra, jlebar.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
tambre added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:642
+              *this, CudaTriple, *HostTC, C.getInputArgs(), OFK);
+      C.getArgs().AddJoinedArg(
+          nullptr, getOpts().getOption(options::OPT_cuda_version_EQ),
----------------
This isn't very pretty. Any better ideas for how to pass the current CUDA version or default arch to `CudaActionBuilder`?


Currently always defaults to sm_20.
However, CUDA >=9.0 doesn't support the sm_20 architecture.
Choose the minimum architecture the CUDA installation supports as the default.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75811

Files:
  clang/include/clang/Basic/Cuda.h
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Cuda.cpp
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/Cuda.cpp
  clang/lib/Driver/ToolChains/Cuda.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75811.248944.patch
Type: text/x-patch
Size: 4933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200307/bdd70f8e/attachment-0001.bin>


More information about the cfe-commits mailing list