[PATCH] D141375: [SYCL][OpenMP] Fix compilation errors for unsupported __bf16 intrinsics

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 15:59:50 PDT 2023


tra added inline comments.


================
Comment at: clang/lib/Sema/Sema.cpp:1978-1979
          !Context.getTargetInfo().hasInt128Type()) ||
+        (Ty->isBFloat16Type() && !Context.getTargetInfo().hasBFloat16Type() &&
+         !LangOpts.CUDAIsDevice) ||
         LongDoubleMismatched) {
----------------
eandrews wrote:
> tra wrote:
> > @eandrews Do you recall what was the reason for *not* issuing the diagnostic on the GPU side?
> > 
> > It appears to do the opposite to what the patch description says. We're supposed to  `emit error for unsupported type __bf16 in device code`, but instead we specifically ignore it during GPU-side compilation. What am I missing?
> > 
> > 
> > 
> I don't recall the specifics but I think CUDA had code handling __bf16 differently and this change broke a test with CUDA diagnostics and so I excluded it from the patch. I could try removing this check and seeing what breaks if you'd like. 
It may have been around the time when x86 started exposing bf16 type in the host headers, but NVPTX didn't have any support for the type yet.

This change may have just papered over the problem. Oh, well. That would be just one of the places where we currently don't handle the 'unusual' types across the host/GPU boundary. I'm attempting to clean it up, and will take care of this instance there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141375



More information about the cfe-commits mailing list