From a4f4fa9ba38d1cea98b2fef011a23f3680d8b78d Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Tue, 2 Jun 2020 23:08:29 +0300 Subject: [PATCH] [SYCL] Disable FP16 support check for SYCL CUDA BE Disable check for SYCL CUDA BE until FP16 support is properly reported there (issue#1799) --- clang/lib/Sema/Sema.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 882048d766b0c..6b6b5a239dbf0 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1753,7 +1753,12 @@ void Sema::checkDeviceDecl(const ValueDecl *D, SourceLocation Loc) { if (Ty->isDependentType()) return; - if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type()) || + auto IsSYCLDeviceCuda = getLangOpts().SYCLIsDevice && + Context.getTargetInfo().getTriple().isNVPTX(); + if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type() && + // Disable check for SYCL CUDA BE until FP16 support is properly + // reported there (issue#1799) + !IsSYCLDeviceCuda) || ((Ty->isFloat128Type() || (Ty->isRealFloatingType() && Context.getTypeSize(Ty) == 128)) && !Context.getTargetInfo().hasFloat128Type()) ||