remove unsupported erf(c)inv related host functionality

Change-Id: I665c33616359a0124b5552076359d2f8faa54930
Этот коммит содержится в:
Maneesh Gupta
2017-07-14 11:31:40 +05:30
родитель 3690fbcc33
Коммит cc6e6b2a0a
3 изменённых файлов: 0 добавлений и 128 удалений
-102
Просмотреть файл
@@ -1267,108 +1267,6 @@ __device__ void __threadfence_system(void){
// no-op
}
float __hip_host_erfinvf(float x)
{
float ret;
int sign;
if (x < -1 || x > 1){
return NAN;
}
if (x == 0){
return 0;
}
if (x > 0){
sign = 1;
} else {
sign = -1;
x = -x;
}
if (x <= 0.7) {
float x1 = x * x;
float x2 = std::fma(__hip_erfinva3, x1, __hip_erfinva2);
float x3 = std::fma(x2, x1, __hip_erfinva1);
float x4 = x * std::fma(x3, x1, __hip_erfinva0);
float r1 = std::fma(__hip_erfinvb4, x1, __hip_erfinvb3);
float r2 = std::fma(r1, x1, __hip_erfinvb2);
float r3 = std::fma(r2, x1, __hip_erfinvb1);
ret = x4 / std::fma(r3, x1, __hip_erfinvb0);
} else {
float x1 = std::sqrt(-std::log((1 - x) / 2));
float x2 = std::fma(__hip_erfinvc3, x1, __hip_erfinvc2);
float x3 = std::fma(x2, x1, __hip_erfinvc1);
float x4 = std::fma(x3, x1, __hip_erfinvc0);
float r1 = std::fma(__hip_erfinvd2, x1, __hip_erfinvd1);
ret = x4 / std::fma(r1, x1, __hip_erfinvd0);
}
ret = ret * sign;
x = x * sign;
ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret));
ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret));
return ret;
}
double __hip_host_erfinv(double x)
{
double ret;
int sign;
if (x < -1 || x > 1){
return NAN;
}
if (x == 0){
return 0;
}
if (x > 0){
sign = 1;
} else {
sign = -1;
x = -x;
}
if (x <= 0.7) {
double x1 = x * x;
double x2 = std::fma(__hip_erfinva3, x1, __hip_erfinva2);
double x3 = std::fma(x2, x1, __hip_erfinva1);
double x4 = x * std::fma(x3, x1, __hip_erfinva0);
double r1 = std::fma(__hip_erfinvb4, x1, __hip_erfinvb3);
double r2 = std::fma(r1, x1, __hip_erfinvb2);
double r3 = std::fma(r2, x1, __hip_erfinvb1);
ret = x4 / std::fma(r3, x1, __hip_erfinvb0);
} else {
double x1 = std::sqrt(-std::log((1 - x) / 2));
double x2 = std::fma(__hip_erfinvc3, x1, __hip_erfinvc2);
double x3 = std::fma(x2, x1, __hip_erfinvc1);
double x4 = std::fma(x3, x1, __hip_erfinvc0);
double r1 = std::fma(__hip_erfinvd2, x1, __hip_erfinvd1);
ret = x4 / std::fma(r1, x1, __hip_erfinvd0);
}
ret = ret * sign;
x = x * sign;
ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret));
ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret));
return ret;
}
float __hip_host_erfcinvf(float y)
{
return __hip_host_erfinvf(1 - y);
}
double __hip_host_erfcinv(double y)
{
return __hip_host_erfinv(1 - y);
}
double __hip_host_j0(double x)
{
double ret, a = std::fabs(x);
-6
Просмотреть файл
@@ -128,12 +128,6 @@ __device__ double __hip_fast_dsqrt_ru(double x);
__device__ double __hip_fast_dsqrt_rz(double x);
__device__ void __threadfence_system(void);
float __hip_host_erfinvf(float x);
double __hip_host_erfinv(double x);
float __hip_host_erfcinvf(float y);
double __hip_host_erfcinv(double y);
float __hip_host_j0f(float x);
double __hip_host_j0(double x);
-20
Просмотреть файл
@@ -820,16 +820,6 @@ __host__ float modff(float x, float *iptr)
return std::modf(x, iptr);
}
__host__ float erfcinvf(float y)
{
return __hip_host_erfcinvf(y);
}
__host__ double erfcinv(double y)
{
return __hip_host_erfcinv(y);
}
__host__ double fdivide(double x, double y)
{
return x/y;
@@ -937,16 +927,6 @@ __host__ void sincospi(double x, double *sptr, double *cptr)
*cptr = std::cos(HIP_PI*x);
}
//__host__ float normcdfinvf(float x)
//{
// return std::sqrt(2) * erfinvf(2*x-1);
//}
//__host__ double normcdfinv(double x)
//{
// return std::sqrt(2) * erfinv(2*x-1);
//}
__host__ float nextafterf(float x, float y)
{
return std::nextafter(x, y);