-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libcxx] Use lgamma
rather than lgamma_r
with LLVM libc
#109556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx @llvm/pr-subscribers-libc Author: Petr Hosek (petrhosek) Changes
Full diff: https://github.com/llvm/llvm-project/pull/109556.diff 1 Files Affected:
diff --git a/libcxx/include/__random/binomial_distribution.h b/libcxx/include/__random/binomial_distribution.h
index 3f19746bae238c..9538c15e2dc97b 100644
--- a/libcxx/include/__random/binomial_distribution.h
+++ b/libcxx/include/__random/binomial_distribution.h
@@ -103,7 +103,7 @@ extern "C" double lgamma_r(double, int*);
#endif
inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma(double __d) {
-#if defined(_LIBCPP_MSVCRT_LIKE)
+#if defined(_LIBCPP_MSVCRT_LIKE) || defined(__LLVM_LIBC__)
return lgamma(__d);
#else
int __sign;
|
But we don't have |
libc++ provides it's own implementation which uses llvm-project/libcxx/include/__math/gamma.h Lines 26 to 38 in eaedbbc
|
|
Please rebase onto main to re-trigger CI. The CI instability should be resolved now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ green CI (please rebase).
lgamma_r is currently only available on GPU targets.
a9376b9
to
c34a87b
Compare
I rebased. This can be landed once CI is green. |
I'm fine with this in general, since I think once the LLVM libc implements |
lgamma_r
is currently only available on GPU targets.