Unverified Commit c73ad025 authored by Anton Rydahl's avatar Anton Rydahl Committed by GitHub
Browse files

[libc][libm][GPU] Add missing vendor entrypoints to the GPU version of `libm` (#66034)

This patch populates the GPU version of `libm` with missing vendor entrypoints. The vendor math entrypoints are disabled by default but can be enabled with the CMake option `LIBC_GPU_VENDOR_MATH=ON`.
parent a91a6648
Loading
Loading
Loading
Loading
+34 −3
Original line number Diff line number Diff line
@@ -125,11 +125,19 @@ set(TARGET_LIBC_ENTRYPOINTS

set(TARGET_LIBM_ENTRYPOINTS
    # math.h entrypoints
    libc.src.math.acos
    libc.src.math.acosf
    libc.src.math.acosh
    libc.src.math.acoshf
    libc.src.math.asin
    libc.src.math.asinf
    libc.src.math.asinh
    libc.src.math.asinhf
    libc.src.math.atan
    libc.src.math.atanf
    libc.src.math.atan2
    libc.src.math.atan2f
    libc.src.math.atanh
    libc.src.math.atanhf
    libc.src.math.ceil
    libc.src.math.ceilf
@@ -139,9 +147,15 @@ set(TARGET_LIBM_ENTRYPOINTS
    libc.src.math.cosf
    libc.src.math.cosh
    libc.src.math.coshf
    libc.src.math.erf
    libc.src.math.erff
    libc.src.math.exp10
    libc.src.math.exp10f
    libc.src.math.exp2
    libc.src.math.exp2f
    libc.src.math.exp
    libc.src.math.expf
    libc.src.math.expm1
    libc.src.math.expm1f
    libc.src.math.fabs
    libc.src.math.fabsf
@@ -169,15 +183,26 @@ set(TARGET_LIBM_ENTRYPOINTS
    libc.src.math.llrintf
    libc.src.math.llround
    libc.src.math.llroundf
    libc.src.math.pow
    libc.src.math.powf
    libc.src.math.sin
    libc.src.math.log10
    libc.src.math.log10f
    libc.src.math.log1p
    libc.src.math.log1pf
    libc.src.math.log2
    libc.src.math.log2f
    libc.src.math.log
    libc.src.math.logf
    libc.src.math.lrint
    libc.src.math.lrintf
    libc.src.math.lround
    libc.src.math.lroundf
    libc.src.math.modf
    libc.src.math.modff
    libc.src.math.nearbyint
    libc.src.math.nearbyintf
    libc.src.math.nextafter
    libc.src.math.nextafterf
    libc.src.math.pow
    libc.src.math.powf
    libc.src.math.remainder
    libc.src.math.remainderf
    libc.src.math.remquo
@@ -188,6 +213,10 @@ set(TARGET_LIBM_ENTRYPOINTS
    libc.src.math.roundf
    libc.src.math.scalbn
    libc.src.math.scalbnf
    libc.src.math.sin
    libc.src.math.sinf
    libc.src.math.sincos
    libc.src.math.sincosf
    libc.src.math.sinh
    libc.src.math.sinhf
    libc.src.math.sqrt
@@ -196,6 +225,8 @@ set(TARGET_LIBM_ENTRYPOINTS
    libc.src.math.tanf
    libc.src.math.tanh
    libc.src.math.tanhf
    libc.src.math.tgamma
    libc.src.math.tgammaf
    libc.src.math.trunc
    libc.src.math.truncf
)
+14 −0
Original line number Diff line number Diff line
@@ -54,14 +54,23 @@ function(add_math_entrypoint_object name)
  )
endfunction()

add_math_entrypoint_object(acos)
add_math_entrypoint_object(acosf)
add_math_entrypoint_object(acosh)
add_math_entrypoint_object(acoshf)

add_math_entrypoint_object(asin)
add_math_entrypoint_object(asinf)
add_math_entrypoint_object(asinh)
add_math_entrypoint_object(asinhf)

add_math_entrypoint_object(atan)
add_math_entrypoint_object(atanf)

add_math_entrypoint_object(atan2)
add_math_entrypoint_object(atan2f)

add_math_entrypoint_object(atanh)
add_math_entrypoint_object(atanhf)

add_math_entrypoint_object(ceil)
@@ -77,6 +86,7 @@ add_math_entrypoint_object(cosf)
add_math_entrypoint_object(cosh)
add_math_entrypoint_object(coshf)

add_math_entrypoint_object(erf)
add_math_entrypoint_object(erff)

add_math_entrypoint_object(exp)
@@ -199,6 +209,7 @@ add_math_entrypoint_object(scalbn)
add_math_entrypoint_object(scalbnf)
add_math_entrypoint_object(scalbnl)

add_math_entrypoint_object(sincos)
add_math_entrypoint_object(sincosf)

add_math_entrypoint_object(sin)
@@ -217,6 +228,9 @@ add_math_entrypoint_object(tanf)
add_math_entrypoint_object(tanh)
add_math_entrypoint_object(tanhf)

add_math_entrypoint_object(tgamma)
add_math_entrypoint_object(tgammaf)

add_math_entrypoint_object(trunc)
add_math_entrypoint_object(truncf)
add_math_entrypoint_object(truncl)

libc/src/math/acos.h

0 → 100644
+18 −0
Original line number Diff line number Diff line
//===-- Implementation header for acos --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_MATH_ACOS_H
#define LLVM_LIBC_SRC_MATH_ACOS_H

namespace LIBC_NAMESPACE {

double acos(double x);

} // namespace LIBC_NAMESPACE

#endif // LLVM_LIBC_SRC_MATH_ACOS_H

libc/src/math/acosh.h

0 → 100644
+18 −0
Original line number Diff line number Diff line
//===-- Implementation header for acosh -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_MATH_ACOSH_H
#define LLVM_LIBC_SRC_MATH_ACOSH_H

namespace LIBC_NAMESPACE {

double acosh(double x);

} // namespace LIBC_NAMESPACE

#endif // LLVM_LIBC_SRC_MATH_ACOSH_H

libc/src/math/asin.h

0 → 100644
+18 −0
Original line number Diff line number Diff line
//===-- Implementation header for asin --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_MATH_ASIN_H
#define LLVM_LIBC_SRC_MATH_ASIN_H

namespace LIBC_NAMESPACE {

double asin(double x);

} // namespace LIBC_NAMESPACE

#endif // LLVM_LIBC_SRC_MATH_ASIN_H
Loading