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

Anton Rydahl via libc-commits libc-commits at lists.llvm.org
Tue Sep 12 11:50:17 PDT 2023


================
@@ -15,35 +15,61 @@ namespace __llvm_libc {
 
 extern "C" {
 float __ocml_acos_f32(float);
+double __ocml_acos_f64(double);
 float __ocml_acosh_f32(float);
+double __ocml_acosh_f64(double);
 float __ocml_asin_f32(float);
+double __ocml_asin_f64(double);
 float __ocml_asinh_f32(float);
+double __ocml_asinh_f64(double);
 float __ocml_atan_f32(float);
+double __ocml_atan_f64(double);
+float __ocml_atan2_f32(float, float);
+double __ocml_atan2_f64(double, double);
 float __ocml_atanh_f32(float);
+double __ocml_atanh_f64(double);
 float __ocml_cos_f32(float);
 double __ocml_cos_f64(double);
 float __ocml_cosh_f32(float);
 double __ocml_cosh_f64(double);
+float __ocml_erf_f32(float);
+double __ocml_erf_f64(double);
 float __ocml_exp_f32(float);
+double __ocml_exp_f64(double);
 float __ocml_exp2_f32(float);
+double __ocml_exp2_f64(double);
 float __ocml_exp10_f32(float);
+double __ocml_exp2_f64(double);
 float __ocml_expm1_f32(float);
+double __ocml_expm1_f64(double);
 float __ocml_fdim_f32(float, float);
 double __ocml_fdim_f64(double, double);
-double __ocml_hypot_f64(double, double);
 float __ocml_hypot_f32(float, float);
+double __ocml_hypot_f64(double, double);
 int __ocml_ilogb_f64(double);
 int __ocml_ilogb_f32(float);
 float __ocml_ldexp_f32(float, int);
 double __ocml_ldexp_f64(double, int);
+float __ocml_log10_f32(float);
+double __ocml_log10_f64(double);
+float __ocml_log1p_f32(float);
+double __ocml_log1p_f64(double);
+float __ocml_log2_f32(float);
+double __ocml_log2_f64(double);
+float __ocml_log_f32(float);
+double __ocml_log_f64(double);
+long __ocml_lrint_f32(float);
----------------
AntonRydahl wrote:

I just looked more carefully through my test results. I think only the target agnostic implementation from `libc/src/math/generic` produces correct results on AMD GPU targets. __nv_rint/__nv_rintf is correct on NVIDIA targets, though.

I think it would be better to remove them for now and rely on `libc/src/math/generic/rint.cpp`, `libc/src/math/generic/lrint.cpp`, and `libc/src/math/generic/llrint.cpp`. 

https://github.com/llvm/llvm-project/pull/66034


More information about the libc-commits mailing list