removed host math functions from math_functions.h

Change-Id: I90d8784e2d6b58c6fade9f0fa12c0db3ee417d3e
Esse commit está contido em:
Aditya Atluri
2017-01-27 17:38:43 -06:00
commit 60013396f6
5 arquivos alterados com 41 adições e 80 exclusões
+18 -16
Ver Arquivo
@@ -27,8 +27,9 @@ THE SOFTWARE.
*/
#include <hip/hip_runtime.h>
#include <hip/math_functions.h>
//#include <hip/math_functions.h>
#include "test_common.h"
#include<cmath>
#pragma GCC diagnostic ignored "-Wall"
#pragma clang diagnostic ignored "-Wunused-variable"
@@ -50,14 +51,14 @@ __host__ void double_precision_math_functions()
copysign(1.0, -2.0);
cos(0.0);
cosh(0.0);
cospi(0.0);
//cospi(0.0);
//cyl_bessel_i0(0.0);
//cyl_bessel_i1(0.0);
erf(0.0);
erfc(0.0);
erfcinv(2.0);
erfcx(0.0);
erfinv(1.0);
//erfcinv(2.0);
//erfcx(0.0);
//erfinv(1.0);
exp(0.0);
exp10(0.0);
exp2(0.0);
@@ -93,36 +94,37 @@ __host__ void double_precision_math_functions()
nan("1");
nearbyint(0.0);
//nextafter(0.0);
fX = 1.0; norm(1, &fX);
fX = 1.0; //norm(1, &fX);
#if defined(__HIP_PLATFORM_HCC__)
norm3d(1.0, 0.0, 0.0);
norm4d(1.0, 0.0, 0.0, 0.0);
//norm3d(1.0, 0.0, 0.0);
//norm4d(1.0, 0.0, 0.0, 0.0);
#endif
// normcdf(0.0);
// normcdfinv(1.0);
pow(1.0, 0.0);
rcbrt(1.0);
//rcbrt(1.0);
remainder(2.0, 1.0);
remquo(1.0, 2.0, &iX);
#if defined(__HIP_PLATFORM_HCC__)
rhypot(0.0, 1.0);
//rhypot(0.0, 1.0);
#endif
rint(1.0);
#if defined(__HIP_PLATFORM_HCC__)
fX = 1.0; rnorm(1, &fX);
rnorm3d(0.0, 0.0, 1.0);
rnorm4d(0.0, 0.0, 0.0, 1.0);
fX = 1.0; //rnorm(1, &fX);
//rnorm3d(0.0, 0.0, 1.0);
//rnorm4d(0.0, 0.0, 0.0, 1.0);
#endif
round(0.0);
rsqrt(1.0);
//rsqrt(1.0);
scalbln(0.0, 1);
scalbn(0.0, 1);
signbit(1.0);
sin(0.0);
sincos(0.0, &fX, &fY);
sincospi(0.0, &fX, &fY);
//sincospi(0.0, &fX, &fY);
sinh(0.0);
sinpi(0.0);
//sinpi(0.0);
sqrt(0.0);
tan(0.0);
tanh(0.0);
+19 -18
Ver Arquivo
@@ -27,8 +27,9 @@ THE SOFTWARE.
*/
#include <hip/hip_runtime.h>
#include <hip/math_functions.h>
//#include <hip/math_functions.h>
#include "test_common.h"
#include<cmath>
#pragma GCC diagnostic ignored "-Wall"
#pragma clang diagnostic ignored "-Wunused-variable"
@@ -50,14 +51,14 @@ __host__ void single_precision_math_functions()
copysignf(1.0f, -2.0f);
cosf(0.0f);
coshf(0.0f);
cospif(0.0f);
//cospif(0.0f);
//cyl_bessel_i0f(0.0f);
//cyl_bessel_i1f(0.0f);
erfcf(0.0f);
erfcinvf(2.0f);
erfcxf(0.0f);
//erfcinvf(2.0f);
//erfcxf(0.0f);
erff(0.0f);
erfinvf(1.0f);
//erfinvf(1.0f);
exp10f(0.0f);
exp2f(0.0f);
expf(0.0f);
@@ -65,7 +66,7 @@ __host__ void single_precision_math_functions()
fabsf(1.0f);
fdimf(1.0f, 0.0f);
#if defined(__HIP_PLATFORM_HCC__)
fdividef(0.0f, 1.0f);
//fdividef(0.0f, 1.0f);
#endif
floorf(0.0f);
fmaf(1.0f, 2.0f, 3.0f);
@@ -97,35 +98,35 @@ __host__ void single_precision_math_functions()
nearbyintf(0.0f);
//nextafterf(0.0f);
#if defined(__HIP_PLATFORM_HCC__)
norm3df(1.0f, 0.0f, 0.0f);
norm4df(1.0f, 0.0f, 0.0f, 0.0f);
//norm3df(1.0f, 0.0f, 0.0f);
//norm4df(1.0f, 0.0f, 0.0f, 0.0f);
#endif
normcdff(0.0f);
normcdfinvf(1.0f);
//normcdff(0.0f);
//normcdfinvf(1.0f);
//fX = 1.0f; normf(1, &fX);
powf(1.0f, 0.0f);
rcbrtf(1.0f);
//rcbrtf(1.0f);
remainderf(2.0f, 1.0f);
remquof(1.0f, 2.0f, &iX);
#if defined(__HIP_PLATFORM_HCC__)
rhypotf(0.0f, 1.0f);
//rhypotf(0.0f, 1.0f);
#endif
rintf(1.0f);
#if defined(__HIP_PLATFORM_HCC__)
rnorm3df(0.0f, 0.0f, 1.0f);
rnorm4df(0.0f, 0.0f, 0.0f, 1.0f);
fX = 1.0f; rnormf(1, &fX);
//rnorm3df(0.0f, 0.0f, 1.0f);
//rnorm4df(0.0f, 0.0f, 0.0f, 1.0f);
fX = 1.0f; //rnormf(1, &fX);
#endif
roundf(0.0f);
rsqrtf(1.0f);
///rsqrtf(1.0f);
scalblnf(0.0f, 1);
scalbnf(0.0f, 1);
signbit(1.0f);
sincosf(0.0f, &fX, &fY);
sincospif(0.0f, &fX, &fY);
//sincospif(0.0f, &fX, &fY);
sinf(0.0f);
sinhf(0.0f);
sinpif(0.0f);
//sinpif(0.0f);
sqrtf(0.0f);
tanf(0.0f);
tanhf(0.0f);
+2 -2
Ver Arquivo
@@ -164,13 +164,13 @@ hipMemcpy(B, Bd, SIZE, hipMemcpyDeviceToHost);
hipMemcpy(C, Cd, SIZE, hipMemcpyDeviceToHost);
int passed = 0;
for(int i=0;i<512;i++){
if(B[i] - sinpif(1.0f) < 0.1){
if(B[i] - sinf(3.14*1.0f) < 0.1){
passed = 1;
}
}
passed = 0;
for(int i=0;i<512;i++){
if(C[i] - cospif(1.0f) < 0.1){
if(C[i] - cosf(3.14*1.0f) < 0.1){
passed = 1;
}
}
+2 -2
Ver Arquivo
@@ -153,13 +153,13 @@ hipMemcpy(B, Bd, SIZE, hipMemcpyDeviceToHost);
hipMemcpy(C, Cd, SIZE, hipMemcpyDeviceToHost);
int passed = 0;
for(int i=0;i<512;i++){
if(B[i] - sinpi(1.0) < 0.1){
if(B[i] - sin(3.14*1.0) < 0.1){
passed = 1;
}
}
passed = 0;
for(int i=0;i<512;i++){
if(C[i] - cospi(1.0) < 0.1){
if(C[i] - cos(3.14*1.0) < 0.1){
passed = 1;
}
}