[clang] [clang][SYCL] Disable float128 device mode diagnostic (PR #128513)
Nicolas Miller via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 13 03:54:34 PDT 2025
================
@@ -4700,7 +4700,8 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI,
if (NewElemTy.isNull()) {
// Only emit diagnostic on host for 128-bit mode attribute
- if (!(DestWidth == 128 && getLangOpts().CUDAIsDevice))
+ if (!(DestWidth == 128 &&
+ (getLangOpts().CUDAIsDevice || getLangOpts().SYCLIsDevice)))
----------------
npmiller wrote:
Not sure exactly how it works for OpenMP, but it doesn't seem to be affected, with a `float128.cpp` file just containing:
```cpp
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
```
And testing without this patch:
With SYCL:
```
$ ./bin/clang++ float128.cpp -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xclang -fsycl-is-device -fsyntax-only -o o
float128.cpp:1:52: error: unsupported machine mode '__TC__'
1 | typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
| ^
1 error generated.
$
```
With OpenMP:
```
$ ./bin/clang++ ../build/float128.cpp -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xclang -fopenmp-is-target-device -fsyntax-only -o o
$
```
And same thing without specifying an OpenMP target.
https://github.com/llvm/llvm-project/pull/128513
More information about the cfe-commits
mailing list