[llvm-branch-commits] [clang] ba2612c - [HIP] cmath demote long double args to double

Aaron En Ye Shi via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 3 15:04:53 PST 2020


Author: Aaron En Ye Shi
Date: 2020-12-03T23:00:14Z
New Revision: ba2612ce01eae5859ae7adb99161775fb2c4e0b2

URL: https://github.com/llvm/llvm-project/commit/ba2612ce01eae5859ae7adb99161775fb2c4e0b2
DIFF: https://github.com/llvm/llvm-project/commit/ba2612ce01eae5859ae7adb99161775fb2c4e0b2.diff

LOG: [HIP] cmath demote long double args to double

Since there is no ROCm Device Library support for
long double, demote them to double, and use the fp64
math functions.

Differential Revision: https://reviews.llvm.org/D92130

Added: 
    

Modified: 
    clang/lib/Headers/__clang_hip_cmath.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/__clang_hip_cmath.h b/clang/lib/Headers/__clang_hip_cmath.h
index 00519a9795bc..3a702587ee17 100644
--- a/clang/lib/Headers/__clang_hip_cmath.h
+++ b/clang/lib/Headers/__clang_hip_cmath.h
@@ -224,6 +224,8 @@ template <class _Tp> struct __numeric_type {
   static double __test(long long);
   static double __test(unsigned long long);
   static double __test(double);
+  // No support for long double, use double instead.
+  static double __test(long double);
 
   typedef decltype(__test(std::declval<_Tp>())) type;
   static const bool value = !std::is_same<type, void>::value;


        


More information about the llvm-branch-commits mailing list