[PATCH] D99738: [HIP] remove overloaded abs in header

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 1 08:57:12 PDT 2021


yaxunl created this revision.
yaxunl added reviewers: tra, JonChesterfield, ashi1.
yaxunl requested review of this revision.

This function seems to be introduced by accident by https://github.com/llvm/llvm-project/commit/aa2b593f1495a972a4a592952760ec9d5f7c01f1

Such overloaded abs function did not exist before the refactoring, and does not exist in https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/__clang_cuda_cmath.h

Conceptually it also does not make sense, since it adds something like

double abs(int x) {

  return ::abs((double)x);

}

It caused regressions in CuPy.


https://reviews.llvm.org/D99738

Files:
  clang/lib/Headers/__clang_hip_cmath.h


Index: clang/lib/Headers/__clang_hip_cmath.h
===================================================================
--- clang/lib/Headers/__clang_hip_cmath.h
+++ clang/lib/Headers/__clang_hip_cmath.h
@@ -323,7 +323,6 @@
   }
 #endif
 
-__HIP_OVERLOAD1(double, abs)
 __HIP_OVERLOAD1(double, acos)
 __HIP_OVERLOAD1(double, acosh)
 __HIP_OVERLOAD1(double, asin)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99738.334716.patch
Type: text/x-patch
Size: 356 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210401/74ccc054/attachment.bin>


More information about the cfe-commits mailing list