[clang] cuda clang: Add support for CUDA surfaces (PR #132883)
Artem Belevich via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 26 14:41:49 PDT 2025
Artem-B wrote:
> > LGTM in principle, but it could use some tests. The change is surprisingly nicely compact. Thank you for filling in one of the long-standing gaps in clang's cuda support story.
>
> I might need some hints on where to start. How would you go about testing this, or are there any tests I can start from? I cribbed heavily from your texture code, which only has a compile test of the headers.
Ideally it would be great to see that each builtin call generates correct surface instruction, and that those instructions are accepted by ptxas. The catch is that `ptxas` is part of CUDA SDK and we can't use it for testing unconditionally. We've plumbed it through as an optional testing tool on the LLVM side, but I do not think we have it on clang side at the moment.
If the header is compileable without CUDA SDK (maybe with some stub headers in tests Inputs), then a source file with a lot of builtin calls and [autogenerated checks](https://github.com/llvm/llvm-project/blob/d724bab8064685c98cdded88157b6e2245e0d7bc/llvm/utils/update_cc_test_checks.py#L2) to verify produced instructions would do.
https://github.com/llvm/llvm-project/pull/132883
More information about the cfe-commits
mailing list