1*88d28848SJoseph Huber //===-- Implementation of the lgamma_r function for GPU -------------------===// 2*88d28848SJoseph Huber // 3*88d28848SJoseph Huber // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*88d28848SJoseph Huber // See https://llvm.org/LICENSE.txt for license information. 5*88d28848SJoseph Huber // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*88d28848SJoseph Huber // 7*88d28848SJoseph Huber //===----------------------------------------------------------------------===// 8*88d28848SJoseph Huber 9*88d28848SJoseph Huber #include "src/math/lgamma_r.h" 10*88d28848SJoseph Huber #include "src/__support/common.h" 11*88d28848SJoseph Huber 12*88d28848SJoseph Huber #include "declarations.h" 13*88d28848SJoseph Huber #include "src/__support/macros/config.h" 14*88d28848SJoseph Huber 15*88d28848SJoseph Huber namespace LIBC_NAMESPACE_DECL { 16*88d28848SJoseph Huber 17*88d28848SJoseph Huber LLVM_LIBC_FUNCTION(double, lgamma_r, (double x, int *signp)) { 18*88d28848SJoseph Huber int tmp = *signp; 19*88d28848SJoseph Huber double r = __ocml_lgamma_r_f64(x, (gpu::Private<int> *)&tmp); 20*88d28848SJoseph Huber *signp = tmp; 21*88d28848SJoseph Huber return r; 22*88d28848SJoseph Huber } 23*88d28848SJoseph Huber 24*88d28848SJoseph Huber } // namespace LIBC_NAMESPACE_DECL 25