[Openmp-commits] [PATCH] D121467: [Libomptarget] Create device math wrappers
Jon Chesterfield via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Mar 11 16:16:45 PST 2022
JonChesterfield added a comment.
Given the header proposed in D121499 <https://reviews.llvm.org/D121499>, OpenMPMath.cpp can be replaced with:
#include "OpenMPMath.h"
#include "make_function.h"
#define M(SYMBOL, ARITY) \
__DEVICE__ MAKE_FUNCTION(__omp_##SYMBOL, SYMBOL, decltype(&SYMBOL), ARITY)
M(abs, 1);
M(fabs, 1);
M(acos, 1);
M(acosf, 1);
M(acosh, 1);
M(acoshf, 1);
M(asin, 1);
M(asinf, 1);
M(asinh, 1);
M(asinhf, 1);
M(atan, 1);
M(atan2, 2);
M(atan2f, 2);
M(atanf, 1);
M(atanh, 1);
M(atanhf, 1);
M(cbrt, 1);
M(cbrtf, 1);
M(ceil, 1);
M(ceilf, 1);
M(copysign, 2);
M(copysignf, 2);
M(cos, 1);
M(cosf, 1);
M(cosh, 1);
M(coshf, 1);
M(cospi, 1);
M(cospif, 1);
M(cyl_bessel_i0, 1);
M(cyl_bessel_i0f, 1);
M(cyl_bessel_i1, 1);
M(cyl_bessel_i1f, 1);
M(erf, 1);
M(erfc, 1);
M(erfcf, 1);
M(erfcinv, 1);
M(erfcinvf, 1);
M(erfcx, 1);
M(erfcxf, 1);
M(erff, 1);
M(erfinv, 1);
M(erfinvf, 1);
M(exp, 1);
M(exp10, 1);
M(exp10f, 1);
M(exp2, 1);
M(exp2f, 1);
M(expf, 1);
M(expm1, 1);
M(expm1f, 1);
M(fabsf, 1);
M(fdim, 2);
M(fdimf, 2);
M(fdivide, 2);
M(fdividef, 2);
M(floor, 1);
M(floorf, 1);
M(fma, 3);
M(fmaf, 3);
M(fmax, 2);
M(fmaxf, 2);
M(fmin, 2);
M(fminf, 2);
M(fmod, 2);
M(fmodf, 2);
M(frexp, 2);
M(frexpf, 2);
M(hypot, 2);
M(hypotf, 2);
M(ilogb, 1);
M(ilogbf, 1);
M(j0, 1);
M(j0f, 1);
M(j1, 1);
M(j1f, 1);
M(jn, 2);
M(jnf, 2);
M(labs, 1);
M(ldexp, 2);
M(ldexpf, 2);
M(lgamma, 1);
M(lgammaf, 1);
M(llabs, 1);
M(llmax, 2);
M(llmin, 2);
M(llrint, 1);
M(llrintf, 1);
M(llround, 1);
M(llroundf, 1);
M(round, 1);
M(roundf, 1);
M(log, 1);
M(log10, 1);
M(log10f, 1);
M(log1p, 1);
M(log1pf, 1);
M(log2, 1);
M(log2f, 1);
M(logb, 1);
M(logbf, 1);
M(logf, 1);
#if defined(__LP64__)
M(lrint, 1);
M(lrintf, 1);
M(lround, 1);
M(lroundf, 1);
#else
M(lrint, 1);
M(lrintf, 1);
M(lround, 1);
M(lroundf, 1);
#endif
M(max, 2);
M(min, 2);
M(modf, 2);
M(modff, 2);
M(nearbyint, 1);
M(nearbyintf, 1);
M(nextafter, 2);
M(nextafterf, 2);
M(norm, 2);
M(norm3d, 3);
M(norm3df, 3);
M(norm4d, 4);
M(norm4df, 4);
M(normcdf, 1);
M(normcdff, 1);
M(normcdfinv, 1);
M(normcdfinvf, 1);
M(normf, 2);
M(pow, 2);
M(powf, 2);
M(powi, 2);
M(powif, 2);
M(rcbrt, 1);
M(rcbrtf, 1);
M(remainder, 2);
M(remainderf, 2);
M(remquo, 3);
M(remquof, 3);
M(rhypot, 2);
M(rhypotf, 2);
M(rint, 1);
M(rintf, 1);
M(rnorm, 2);
M(rnorm3d, 3);
M(rnorm3df, 3);
M(rnorm4d, 4);
M(rnorm4df, 4);
M(rnormf, 2);
M(rsqrt, 1);
M(rsqrtf, 1);
M(scalbn, 2);
M(scalbnf, 2);
M(scalbln, 2);
M(scalblnf, 2);
M(sin, 1);
M(sincos, 3);
M(sincosf, 3);
M(sincospi, 3);
M(sincospif, 3);
M(sinf, 1);
M(sinh, 1);
M(sinhf, 1);
M(sinpi, 1);
M(sinpif, 1);
M(sqrt, 1);
M(sqrtf, 1);
M(tan, 1);
M(tanf, 1);
M(tanh, 1);
M(tanhf, 1);
M(tgamma, 1);
M(tgammaf, 1);
M(trunc, 1);
M(truncf, 1);
M(ullmax, 2);
M(ullmin, 2);
M(umax, 2);
M(umin, 2);
M(y0, 1);
M(y0f, 1);
M(y1, 1);
M(y1f, 1);
M(yn, 2);
M(ynf, 2);
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121467/new/
https://reviews.llvm.org/D121467
More information about the Openmp-commits
mailing list