[HIPIFY] Add supported device functions (from math_functions.h)

+ [perl] Add generation of sub countSupportedDeviceFunctions
+ [FIX] Do not perform any replacement for supported device functions
+ [perl] Sync hipify-perl accordingly
这个提交包含在:
Evgeny Mankov
2019-09-17 16:17:28 +03:00
父节点 85553ec483
当前提交 33cd4dffd5
修改 5 个文件,包含 417 行新增31 行删除
@@ -25,6 +25,181 @@ THE SOFTWARE.
// Maps CUDA header names to HIP header names
const std::map<llvm::StringRef, hipCounter> CUDA_DEVICE_FUNC_MAP{
// math functions
{"abs", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"labs", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"llabs", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fabs", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fabsf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"min", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fminf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fmin", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"max", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fmaxf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fmax", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sin", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cos", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sincos", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sincosf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"tan", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sqrt", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rsqrt", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rsqrtf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log2", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"exp2", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"exp2f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"exp10", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"exp10f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"expm1", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"expm1f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log2f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log10", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log1p", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log1pf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"floor", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"exp", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cosh", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sinh", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"tanh", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"acosh", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"acoshf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"asinh", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"asinhf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"atanh", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"atanhf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ldexp", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ldexpf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"logb", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"logbf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ilogb", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ilogbf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"scalbn", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"scalbnf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"scalbln", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"scalblnf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"frexp", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"frexpf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"round", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"roundf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"lround", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"lroundf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"llround", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"llroundf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rint", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rintf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"lrint", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"lrintf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"llrint", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"llrintf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"nearbyint", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"nearbyintf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ceil", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"trunc", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"truncf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fdim", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fdimf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"atan2", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"atan", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"acos", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"asin", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"hypot", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rhypot", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"hypotf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rhypotf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"norm3d", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rnorm3d", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"norm4d", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rnorm4d", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"norm", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rnorm", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rnormf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"normf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"norm3df", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rnorm3df", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"norm4df", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rnorm4df", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cbrt", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cbrtf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rcbrt", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"rcbrtf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sinpi", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sinpif", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cospi", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cospif", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sincospi", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sincospif", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"pow", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"modf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fmod", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"remainder", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"remainderf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"remquo", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"remquof", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"j0", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"j0f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"j1", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"j1f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"jn", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"jnf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"y0", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"y0f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"y1", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"y1f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"yn", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ynf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cyl_bessel_i0", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cyl_bessel_i0f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cyl_bessel_i1", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cyl_bessel_i1f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erff", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfinv", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfinvf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfc", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfcf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"lgamma", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfcinv", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfcinvf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"normcdfinv", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"normcdfinvf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"normcdf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"normcdff", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfcx", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"erfcxf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"lgammaf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"tgamma", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"tgammaf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"copysign", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"copysignf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"nextafter", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"nextafterf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"nan", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"nanf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fma", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fmaf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"acosf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"asinf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"atanf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"atan2f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"cosf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sinf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"tanf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"coshf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sinhf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"tanhf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"expf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"logf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"log10f", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"modff", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"powf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"sqrtf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"ceilf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"floorf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"fmodf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"signbit", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"isfinite", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"isnan", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"isinf", {"", "", CONV_DEVICE_FUNC, API_RUNTIME}},
{"umin", {"", "", CONV_DEVICE_FUNC, API_RUNTIME, UNSUPPORTED}},
{"llmin", {"", "", CONV_DEVICE_FUNC, API_RUNTIME, UNSUPPORTED}},
{"ullmin", {"", "", CONV_DEVICE_FUNC, API_RUNTIME, UNSUPPORTED}},