This is an archive of the discontinued LLVM Phabricator instance.

[libc] Search for the CUDA patch explicitly when testing
ClosedPublic

Authored by jhuber6 on Apr 5 2023, 12:19 PM.

Details

Summary

The packaged version of the libc library does not depend on the CUDA
installation because it only uses clang and emits LLVM-IR. However,
for testing we directly need the CUDA toolkit to emit and execute the
files. This patch explicitly passes --cuda-path to the relevant
compilations for NVPTX testing.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 5 2023, 12:19 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 5 2023, 12:19 PM
jhuber6 requested review of this revision.Apr 5 2023, 12:19 PM
tra accepted this revision.Apr 5 2023, 12:37 PM
tra added inline comments.
libc/cmake/modules/prepare_libc_gpu_build.cmake
105

Nit: .. may potentially backfire if we're operating on a tree of symlinks, depending on whether cmake would actually traverse the filesystem, or process the ,, itself and just stripping one path component.

It may be safer to calculate absolute path to CUDAToolkit_BIN_DIR and then use get_filename_component(DIRECTORY) on it.

This revision is now accepted and ready to land.Apr 5 2023, 12:37 PM
This revision was automatically updated to reflect the committed changes.