[nvptx-arch] Dynamically load the CUDA runtime if not found during the build
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 16 Jan 2023 17:18:54 +0000 (11:18 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Mon, 16 Jan 2023 19:13:47 +0000 (13:13 -0600)
commit9954516ffb10a39ae0c8517f4865eec24e07d56e
treea2928cfd9b56468d8ebf8446d1ac0c58cadcf8a3
parentf6ace23172e5930be0e7cc602f50e1e9c54d7a9a
[nvptx-arch] Dynamically load the CUDA runtime if not found during the build

Much like the changes in D141859, this patch allows the `nvptx-arch`
tool to be built and provided with every distrubition of LLVM / Clang.
This will make it more reliable for our toolchains to depend on. The
changes here configure a version that dynamically loads CUDA if it was
not found at build time.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D141861
clang/tools/nvptx-arch/CMakeLists.txt
clang/tools/nvptx-arch/NVPTXArch.cpp