[CUDA] Add a flag to manually specify the target feature to use with CUDA
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 13 May 2022 20:16:15 +0000 (16:16 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 13 May 2022 20:30:58 +0000 (16:30 -0400)
commit7dc23abbd3b298016cc6ae49a124f414e76903b6
treeac1c66c81acdcda197f91e8056a6696f5cd8cd72
parentbdba3d091c66e3ab87fe0d631d90771b747ddf0d
[CUDA] Add a flag to manually specify the target feature to use with CUDA

Summary:
Normally we parse through the CUDA installation to disover the needed
features. However, we may want to build libraries on targets that do not
currently have CUDA installed but still need to know which features to
make use of when creating the PTX or bitcode. This flag is a simple way
to specify this so we can compile certain codes withotu a valid CUDA
installation.

Ideally this could be done via an -Xarch or simimlar flag but currently
they cannot handle this. We would need to support using an -Xarch flag
that takes multiple arguments that then pass them to the -Xclang
functionality.
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Cuda.cpp
clang/test/Driver/cuda-openmp-driver.cu