From ce13ae9b840355676c4a6df7d9013e4383a0f848 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 18 Jun 2019 18:39:26 +0000 Subject: [OPENMP]Use host's long double when compiling the code for device. The device code must use the same long double type as the host. Otherwise the code cannot be linked and executed properly. Patch adds only basic support and checks for supporting of the host long double double on the device. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363717 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaOpenMP.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Sema/SemaOpenMP.cpp') diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index a4eafb180a..19057eb398 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -1576,7 +1576,9 @@ void Sema::checkOpenMPDeviceExpr(const Expr *E) { "OpenMP device compilation mode is expected."); QualType Ty = E->getType(); if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type()) || - (Ty->isFloat128Type() && !Context.getTargetInfo().hasFloat128Type()) || + ((Ty->isFloat128Type() || + (Ty->isRealFloatingType() && Context.getTypeSize(Ty) == 128)) && + !Context.getTargetInfo().hasFloat128Type()) || (Ty->isIntegerType() && Context.getTypeSize(Ty) == 128 && !Context.getTargetInfo().hasInt128Type())) targetDiag(E->getExprLoc(), diag::err_type_unsupported) -- cgit v1.2.1