[libc-commits] [PATCH] D148532: [libc] Add special handling for CUDA PTX features

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 17 07:22:19 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, lntue, sivachandra, tra.
Herald added subscribers: libc-commits, mattd, gchakrabarti, asavonic, ecnelises, tschuett, yaxunl.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

The NVIDIA compilation path requires some special options. This is
mostly because compilation is dependent on having a valid CUDA
toolchain. We don't actually need the CUDA toolchain to create the
exported `libcgpu.a` library because it's pure LLVM-IR. However, for
some language features we need the PTX version to be set. This is
normally set by checking the CUDA version, but without one installed it
will fail to build. We instead choose a minimum set of features on the
desired target, inferred from
https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#release-notes
and the PTX refernece for functions like `nanosleep`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148532

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake
  libc/cmake/modules/LLVMLibCTestRules.cmake
  libc/startup/gpu/nvptx/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148532.514224.patch
Type: text/x-patch
Size: 5456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230417/c0cac0c9/attachment.bin>


More information about the libc-commits mailing list