[PATCH] D77240: [CUDA] Add missing cmath overloads

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 2 09:44:25 PDT 2020


jdoerfert abandoned this revision.
jdoerfert added a comment.

In D77240#1957468 <https://reviews.llvm.org/D77240#1957468>, @tra wrote:

> In D77240#1957386 <https://reviews.llvm.org/D77240#1957386>, @jdoerfert wrote:
>
> > I just noticed those as well. I forgot to put the new definitions into the forward declare header. Will do it in a second. The OpenMP math overlay doesn't have one so I forgot :(
>
>
> I'm not sure how it's going to help. The problem is that the functions are already defined by CUDA headers. Moving the duplicate definition to a different header does not change that. 
>  Bottom line is that the already-existing definitions are not needed for CUDA. If OpenMP needs them, then they should probably go into an OpenMP-specific header.


I see. In my CUDA headers `float acos(float)` is conditionally defined as well but as a `__cudart_builtin__`.
So it seems we can redefine those but not the `float acosh(float)` which is a `__MATH_FUNCTIONS_DECL__` for some configurations.

I'll move the new functions into an OpenMP only header. I thought they might be needed here too but that was wrong. Thanks for spending the time on this!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77240





More information about the cfe-commits mailing list