[PATCH] D94337: Add cuda header type for cuh files

Ryan Greenblatt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 13 12:56:43 PST 2021


rgreenblatt added a comment.

In D94337#2496329 <https://reviews.llvm.org/D94337#2496329>, @tra wrote:

> We were talking about the case where clang can't expand CUDA-specific macros.

Somehow I totally forgot about or missed this context.

> I think this kind of compilation pipeline restructuring is a bit premature.

Yeah for sure. I was trying to make `clang++ file.cuh ...` do something same - this isn't at all needed for tooling. Also I was mostly doing this to improve my understanding of what is going on in Driver.cpp wrt. cuda compilation.

Sorry about missing or misunderstanding a lot of what you're saying and saying obvious things.

>> However, the fact that the preprocessor includes depend on arch
>> means that the __clang_cuda_standalone_defs.h approach won't always be perfectly
>> correct.
>
> `...` The goal of `__clang_cuda_standalone_defs.h` is to make it possible to parse CUDA sources at all w/o having to rely on CUDA SDK. `...`

Should `__clang_cuda_standalone_defs.h` depend on the arch? For example, `__match_all_sync` doesn't exist in sm_35 but does exist in sm_75.
For tooling this might not matter because the host cuda includes don't depend on the arch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94337/new/

https://reviews.llvm.org/D94337



More information about the cfe-commits mailing list