[PATCH] D104904: [OpenMP][AMDGCN] Initial math headers support

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 9 15:37:02 PDT 2021


jdoerfert added inline comments.


================
Comment at: clang/test/Headers/Inputs/include/cstdlib:29
 float fabs(float __x) { return __builtin_fabs(__x); }
+#endif
 
----------------
estewart08 wrote:
> JonChesterfield wrote:
> > jdoerfert wrote:
> > > That seems to be fundamentally broken then, but let's see, maybe it will somehow work anyway.
> > I thought fabs was in math, not stdlib. Not sure what this file is doing but the functions above are inline and fabs isn't
> I am afraid this is just a workaround to get openmp_device_math_isnan.cpp to pass for AMDGCN. This stems from not having an #ifndef OPENMP_AMDGCN in __clang_hip_cmath.h where 'using ::fabs' is present. Currently, OPENMP_AMDGCN uses all of the overloaded functions created by the HIP macros where NVPTX does not use the CUDA overloads. This may be a new topic of discussion.
> 
> https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/__clang_cuda_cmath.h#L191
> 
> By using this ifndef, it seems NVPTX looses quite a few overloaded functions. Are these meant to eventually be present in openmp_wrappers/cmath? Not sure what issues @jdoerfert ran into with D75788.
> By using this ifndef, it seems NVPTX looses quite a few overloaded functions. Are these meant to eventually be present in openmp_wrappers/cmath? Not sure what issues @jdoerfert ran into with D75788.

Can you provide an example that shows how we "loose" something? So an input and command line that should work but doesn't, or that should be compiled to something else. That would help me a lot.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104904/new/

https://reviews.llvm.org/D104904



More information about the cfe-commits mailing list