[PATCH] D138651: [CUDA][HIP] Don't diagnose use for __bf16
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 1 10:39:06 PST 2022
tra added inline comments.
================
Comment at: clang/test/SemaCUDA/amdgpu-bf16.cu:9
+
+__device__ void devicefn() {
+}
----------------
Pierre-vh wrote:
> tra wrote:
> > We should probably also have a case verifying that actual attempt to use `__bf16` in device code is still diagnosed.
> Good catch, it's currently no longer diagnosed.
> What can I use in `ConvertDeclSpecToType` to make it diagnose only if the current function is a device function? If I understand correctly, LangOpts are for the whole TU so I can't use that (e.g. CUDAIsDevice), right?
I don't have a good answer. That was one of the reasons I ended up implementing `__bf16` support in NVPTX. :-)
You may need to use deferred diagnostics, instead of disabling them) and trigger them if we need to codegen anything that uses `__bf16`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138651/new/
https://reviews.llvm.org/D138651
More information about the cfe-commits
mailing list