Fixed compilation errors being observed on windows

[ROCm/clr commit: c4f6d58354]
Bu işleme şunda yer alıyor:
lthakur
2019-08-07 15:54:46 +05:30
ebeveyn b75cd71dd4
işleme 6a15871e91
2 değiştirilmiş dosya ile 310 ekleme ve 286 silme
+158 -142
Dosyayı Görüntüle
@@ -1,142 +1,158 @@
/* /*
Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START /* HIT_START
* BUILD: %t %s ../test_common.cpp * BUILD: %t %s ../test_common.cpp
* TEST: %t * TEST: %t
* HIT_END * HIT_END
*/ */
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
//#include <hip/math_functions.h> //#include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
#include <cmath> #include <cmath>
#pragma GCC diagnostic ignored "-Wall" #pragma GCC diagnostic ignored "-Wall"
#pragma clang diagnostic ignored "-Wunused-variable" #pragma clang diagnostic ignored "-Wunused-variable"
__host__ void double_precision_math_functions() { __host__ void double_precision_math_functions() {
int iX; int iX;
double fX, fY; double fX, fY;
acos(1.0); acos(1.0);
acosh(1.0); acosh(1.0);
asin(0.0); asin(0.0);
asinh(0.0); asinh(0.0);
atan(0.0); atan(0.0);
atan2(0.0, 1.0); atan2(0.0, 1.0);
atanh(0.0); atanh(0.0);
cbrt(0.0); cbrt(0.0);
ceil(0.0); ceil(0.0);
copysign(1.0, -2.0); copysign(1.0, -2.0);
cos(0.0); cos(0.0);
cosh(0.0); cosh(0.0);
// cospi(0.0); // cospi(0.0);
// cyl_bessel_i0(0.0); // cyl_bessel_i0(0.0);
// cyl_bessel_i1(0.0); // cyl_bessel_i1(0.0);
erf(0.0); erf(0.0);
erfc(0.0); erfc(0.0);
// erfcinv(2.0); // erfcinv(2.0);
// erfcx(0.0); // erfcx(0.0);
// erfinv(1.0); // erfinv(1.0);
exp(0.0); exp(0.0);
exp10(0.0); #ifdef __unix__
exp2(0.0); exp10(0.0);
expm1(0.0); #endif
fabs(1.0); exp2(0.0);
fdim(1.0, 0.0); expm1(0.0);
floor(0.0); fabs(1.0);
fma(1.0, 2.0, 3.0); fdim(1.0, 0.0);
fmax(0.0, 0.0); floor(0.0);
fmin(0.0, 0.0); fma(1.0, 2.0, 3.0);
fmod(0.0, 1.0); fmax(0.0, 0.0);
frexp(0.0, &iX); fmin(0.0, 0.0);
hypot(1.0, 0.0); fmod(0.0, 1.0);
ilogb(1.0); frexp(0.0, &iX);
std::isfinite(0.0); hypot(1.0, 0.0);
std::isinf(0.0); ilogb(1.0);
std::isnan(0.0); std::isfinite(0.0);
j0(0.0); std::isinf(0.0);
j1(0.0); std::isnan(0.0);
jn(-1.0, 1.0); #ifdef __unix__
ldexp(0.0, 0); j0(1.0);
// lgamma(1.0); j1(1.0);
llrint(0.0); jn(-1.0, 1.0);
llround(0.0); #elif _WIN64
log(1.0); _j0(0.0);
log10(1.0); _j1(0.0);
log1p(-1.0); _jn(-1.0, 1.0);
log2(1.0); #endif
logb(1.0); ldexp(0.0, 0);
lrint(0.0); // lgamma(1.0);
lround(0.0); llrint(0.0);
modf(0.0, &fX); llround(0.0);
nan("1"); log(1.0);
nearbyint(0.0); log10(1.0);
// nextafter(0.0); log1p(-1.0);
fX = 1.0; // norm(1, &fX); log2(1.0);
#if defined(__HIP_PLATFORM_HCC__) logb(1.0);
// norm3d(1.0, 0.0, 0.0); lrint(0.0);
// norm4d(1.0, 0.0, 0.0, 0.0); lround(0.0);
#endif modf(0.0, &fX);
// normcdf(0.0); nan("1");
// normcdfinv(1.0); nearbyint(0.0);
pow(1.0, 0.0); // nextafter(0.0);
// rcbrt(1.0); fX = 1.0; // norm(1, &fX);
#if defined(__HIP_PLATFORM_HCC__)
remainder(2.0, 1.0); // norm3d(1.0, 0.0, 0.0);
remquo(1.0, 2.0, &iX); // norm4d(1.0, 0.0, 0.0, 0.0);
#if defined(__HIP_PLATFORM_HCC__) #endif
// rhypot(0.0, 1.0); // normcdf(0.0);
#endif // normcdfinv(1.0);
rint(1.0); pow(1.0, 0.0);
#if defined(__HIP_PLATFORM_HCC__) // rcbrt(1.0);
fX = 1.0; // rnorm(1, &fX);
// rnorm3d(0.0, 0.0, 1.0); remainder(2.0, 1.0);
// rnorm4d(0.0, 0.0, 0.0, 1.0); remquo(1.0, 2.0, &iX);
#endif #if defined(__HIP_PLATFORM_HCC__)
round(0.0); // rhypot(0.0, 1.0);
// rsqrt(1.0); #endif
scalbln(0.0, 1); rint(1.0);
scalbn(0.0, 1); #if defined(__HIP_PLATFORM_HCC__)
std::signbit(1.0); fX = 1.0; // rnorm(1, &fX);
sin(0.0); // rnorm3d(0.0, 0.0, 1.0);
sincos(0.0, &fX, &fY); // rnorm4d(0.0, 0.0, 0.0, 1.0);
// sincospi(0.0, &fX, &fY); #endif
sinh(0.0); round(0.0);
// sinpi(0.0); // rsqrt(1.0);
sqrt(0.0); scalbln(0.0, 1);
tan(0.0); scalbn(0.0, 1);
tanh(0.0); std::signbit(1.0);
tgamma(2.0); sin(0.0);
trunc(0.0); #ifdef __unix__
y0(1.0); sincos(0.0, &fX, &fY);
y1(1.0); #endif
yn(1, 1.0); // sincospi(0.0, &fX, &fY);
} sinh(0.0);
// sinpi(0.0);
static void compileOnHost() { double_precision_math_functions(); } sqrt(0.0);
tan(0.0);
int main() { tanh(0.0);
compileOnHost(); tgamma(2.0);
passed(); trunc(0.0);
} #ifdef __unix__
y0(1.0);
y1(1.0);
yn(1, 1.0);
#elif _WIN64
_y0(1.0);
_y1(1.0);
_yn(1, 1.0);
#endif
}
static void compileOnHost() { double_precision_math_functions(); }
int main() {
compileOnHost();
passed();
}
+152 -144
Dosyayı Görüntüle
@@ -1,144 +1,152 @@
/* /*
Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
/* HIT_START /* HIT_START
* BUILD: %t %s ../test_common.cpp * BUILD: %t %s ../test_common.cpp
* TEST: %t * TEST: %t
* HIT_END * HIT_END
*/ */
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
//#include <hip/math_functions.h> //#include <hip/math_functions.h>
#include "test_common.h" #include "test_common.h"
#include <cmath> #include <cmath>
#pragma GCC diagnostic ignored "-Wall" #pragma GCC diagnostic ignored "-Wall"
#pragma clang diagnostic ignored "-Wunused-variable" #pragma clang diagnostic ignored "-Wunused-variable"
__host__ void single_precision_math_functions() { __host__ void single_precision_math_functions() {
int iX; int iX;
float fX, fY; float fX, fY;
acosf(1.0f); acosf(1.0f);
acoshf(1.0f); acoshf(1.0f);
asinf(0.0f); asinf(0.0f);
asinhf(0.0f); asinhf(0.0f);
atan2f(0.0f, 1.0f); atan2f(0.0f, 1.0f);
atanf(0.0f); atanf(0.0f);
atanhf(0.0f); atanhf(0.0f);
cbrtf(0.0f); cbrtf(0.0f);
ceilf(0.0f); ceilf(0.0f);
copysignf(1.0f, -2.0f); copysignf(1.0f, -2.0f);
cosf(0.0f); cosf(0.0f);
coshf(0.0f); coshf(0.0f);
// cospif(0.0f); // cospif(0.0f);
// cyl_bessel_i0f(0.0f); // cyl_bessel_i0f(0.0f);
// cyl_bessel_i1f(0.0f); // cyl_bessel_i1f(0.0f);
erfcf(0.0f); erfcf(0.0f);
// erfcinvf(2.0f); // erfcinvf(2.0f);
// erfcxf(0.0f); // erfcxf(0.0f);
erff(0.0f); erff(0.0f);
// erfinvf(1.0f); // erfinvf(1.0f);
exp10f(0.0f); #ifdef __unix__
exp2f(0.0f); exp10f(0.0f);
expf(0.0f); #endif
expm1f(0.0f); exp2f(0.0f);
fabsf(1.0f); expf(0.0f);
fdimf(1.0f, 0.0f); expm1f(0.0f);
#if defined(__HIP_PLATFORM_HCC__) fabsf(1.0f);
// fdividef(0.0f, 1.0f); fdimf(1.0f, 0.0f);
#endif #if defined(__HIP_PLATFORM_HCC__)
floorf(0.0f); // fdividef(0.0f, 1.0f);
fmaf(1.0f, 2.0f, 3.0f); #endif
fmaxf(0.0f, 0.0f); floorf(0.0f);
fminf(0.0f, 0.0f); fmaf(1.0f, 2.0f, 3.0f);
fmodf(0.0f, 1.0f); fmaxf(0.0f, 0.0f);
frexpf(0.0f, &iX); fminf(0.0f, 0.0f);
hypotf(1.0f, 0.0f); fmodf(0.0f, 1.0f);
ilogbf(1.0f); frexpf(0.0f, &iX);
std::isfinite(0.0f); hypotf(1.0f, 0.0f);
std::isinf(0.0f); ilogbf(1.0f);
std::isnan(0.0f); std::isfinite(0.0f);
j0f(0.0f); std::isinf(0.0f);
j1f(0.0f); std::isnan(0.0f);
jnf(-1.0f, 1.0f); #ifdef __unix__
ldexpf(0.0f, 0); j0f(0.0f);
lgammaf(1.0f); j1f(0.0f);
llrintf(0.0f); jnf(-1.0f, 1.0f);
llroundf(0.0f); #endif
log10f(1.0f); ldexpf(0.0f, 0);
log1pf(-1.0f); lgammaf(1.0f);
log2f(1.0f); llrintf(0.0f);
logbf(1.0f); llroundf(0.0f);
logf(1.0f); log10f(1.0f);
lrintf(0.0f); log1pf(-1.0f);
lroundf(0.0f); log2f(1.0f);
modff(0.0f, &fX); logbf(1.0f);
nanf("1"); logf(1.0f);
nearbyintf(0.0f); lrintf(0.0f);
// nextafterf(0.0f); lroundf(0.0f);
#if defined(__HIP_PLATFORM_HCC__) modff(0.0f, &fX);
// norm3df(1.0f, 0.0f, 0.0f); nanf("1");
// norm4df(1.0f, 0.0f, 0.0f, 0.0f); nearbyintf(0.0f);
#endif // nextafterf(0.0f);
// normcdff(0.0f); #if defined(__HIP_PLATFORM_HCC__)
// normcdfinvf(1.0f); // norm3df(1.0f, 0.0f, 0.0f);
// fX = 1.0f; normf(1, &fX); // norm4df(1.0f, 0.0f, 0.0f, 0.0f);
powf(1.0f, 0.0f); #endif
// rcbrtf(1.0f); // normcdff(0.0f);
remainderf(2.0f, 1.0f); // normcdfinvf(1.0f);
remquof(1.0f, 2.0f, &iX); // fX = 1.0f; normf(1, &fX);
#if defined(__HIP_PLATFORM_HCC__) powf(1.0f, 0.0f);
// rhypotf(0.0f, 1.0f); // rcbrtf(1.0f);
#endif remainderf(2.0f, 1.0f);
rintf(1.0f); remquof(1.0f, 2.0f, &iX);
#if defined(__HIP_PLATFORM_HCC__) #if defined(__HIP_PLATFORM_HCC__)
// rnorm3df(0.0f, 0.0f, 1.0f); // rhypotf(0.0f, 1.0f);
// rnorm4df(0.0f, 0.0f, 0.0f, 1.0f); #endif
fX = 1.0f; // rnormf(1, &fX); rintf(1.0f);
#endif #if defined(__HIP_PLATFORM_HCC__)
roundf(0.0f); // rnorm3df(0.0f, 0.0f, 1.0f);
/// rsqrtf(1.0f); // rnorm4df(0.0f, 0.0f, 0.0f, 1.0f);
scalblnf(0.0f, 1); fX = 1.0f; // rnormf(1, &fX);
scalbnf(0.0f, 1); #endif
std::signbit(1.0f); roundf(0.0f);
sincosf(0.0f, &fX, &fY); /// rsqrtf(1.0f);
// sincospif(0.0f, &fX, &fY); scalblnf(0.0f, 1);
sinf(0.0f); scalbnf(0.0f, 1);
sinhf(0.0f); std::signbit(1.0f);
// sinpif(0.0f); #ifdef __unix__
sqrtf(0.0f); sincosf(0.0f, &fX, &fY);
tanf(0.0f); #endif
tanhf(0.0f); // sincospif(0.0f, &fX, &fY);
tgammaf(2.0f); sinf(0.0f);
truncf(0.0f); sinhf(0.0f);
y0f(1.0f); // sinpif(0.0f);
y1f(1.0f); sqrtf(0.0f);
ynf(1, 1.0f); tanf(0.0f);
} tanhf(0.0f);
tgammaf(2.0f);
static void compileOnHost() { single_precision_math_functions(); } truncf(0.0f);
#ifdef __unix__
int main() { y0f(1.0f);
compileOnHost(); y1f(1.0f);
passed(); ynf(1, 1.0f);
} #endif
}
static void compileOnHost() { single_precision_math_functions(); }
int main() {
compileOnHost();
passed();
}