Skip to content

Commit

Permalink
Properly qualify function calls in cmath
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Nov 12, 2024
1 parent 3d1c5ed commit 43e28e6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
14 changes: 7 additions & 7 deletions libcudacxx/include/cuda/std/__cmath/nvbf16.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isnan(__nv_bfloat16 __x) noexcept

_LIBCUDACXX_HIDE_FROM_ABI bool isnan(__nv_bfloat16 __v)
{
return __constexpr_isnan(__v);
return _CUDA_VSTD::__constexpr_isnan(__v);
}

_LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isinf(__nv_bfloat16 __x) noexcept
Expand All @@ -108,17 +108,17 @@ _LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isinf(__nv_bfloat16 __x) noexcept

_LIBCUDACXX_HIDE_FROM_ABI bool isinf(__nv_bfloat16 __v)
{
return __constexpr_isinf(__v);
return _CUDA_VSTD::__constexpr_isinf(__v);
}

_LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isfinite(__nv_bfloat16 __x) noexcept
{
return !__constexpr_isnan(__x) && !__constexpr_isinf(__x);
return !_CUDA_VSTD::__constexpr_isnan(__x) && !_CUDA_VSTD::__constexpr_isinf(__x);
}

_LIBCUDACXX_HIDE_FROM_ABI bool isfinite(__nv_bfloat16 __v)
{
return __constexpr_isfinite(__v);
return _CUDA_VSTD::__constexpr_isfinite(__v);
}

_LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 __constexpr_copysign(__nv_bfloat16 __x, __nv_bfloat16 __y) noexcept
Expand All @@ -128,7 +128,7 @@ _LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 __constexpr_copysign(__nv_bfloat16 __x,

_LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 copysign(__nv_bfloat16 __x, __nv_bfloat16 __y)
{
return __constexpr_copysign(__x, __y);
return _CUDA_VSTD::__constexpr_copysign(__x, __y);
}

_LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 __constexpr_fabs(__nv_bfloat16 __x) noexcept
Expand All @@ -138,12 +138,12 @@ _LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 __constexpr_fabs(__nv_bfloat16 __x) noex

_LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 fabs(__nv_bfloat16 __x)
{
return __constexpr_fabs(__x);
return _CUDA_VSTD::__constexpr_fabs(__x);
}

_LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 abs(__nv_bfloat16 __x)
{
return __constexpr_fabs(__x);
return _CUDA_VSTD::__constexpr_fabs(__x);
}

_LIBCUDACXX_HIDE_FROM_ABI __nv_bfloat16 __constexpr_fmax(__nv_bfloat16 __x, __nv_bfloat16 __y) noexcept
Expand Down
14 changes: 7 additions & 7 deletions libcudacxx/include/cuda/std/__cmath/nvfp16.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ _LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isnan(__half __x) noexcept

_LIBCUDACXX_HIDE_FROM_ABI bool isnan(__half __v)
{
return __constexpr_isnan(__v);
return _CUDA_VSTD::__constexpr_isnan(__v);
}

_LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isinf(__half __x) noexcept
Expand All @@ -195,17 +195,17 @@ _LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isinf(__half __x) noexcept

_LIBCUDACXX_HIDE_FROM_ABI bool isinf(__half __v)
{
return __constexpr_isinf(__v);
return _CUDA_VSTD::__constexpr_isinf(__v);
}

_LIBCUDACXX_HIDE_FROM_ABI bool __constexpr_isfinite(__half __x) noexcept
{
return !__constexpr_isnan(__x) && !__constexpr_isinf(__x);
return !_CUDA_VSTD::__constexpr_isnan(__x) && !_CUDA_VSTD::__constexpr_isinf(__x);
}

_LIBCUDACXX_HIDE_FROM_ABI bool isfinite(__half __v)
{
return __constexpr_isfinite(__v);
return _CUDA_VSTD::__constexpr_isfinite(__v);
}

_LIBCUDACXX_HIDE_FROM_ABI __half __constexpr_copysign(__half __x, __half __y) noexcept
Expand All @@ -215,7 +215,7 @@ _LIBCUDACXX_HIDE_FROM_ABI __half __constexpr_copysign(__half __x, __half __y) no

_LIBCUDACXX_HIDE_FROM_ABI __half copysign(__half __x, __half __y)
{
return __constexpr_copysign(__x, __y);
return _CUDA_VSTD::__constexpr_copysign(__x, __y);
}

_LIBCUDACXX_HIDE_FROM_ABI __half __constexpr_fabs(__half __x) noexcept
Expand All @@ -225,12 +225,12 @@ _LIBCUDACXX_HIDE_FROM_ABI __half __constexpr_fabs(__half __x) noexcept

_LIBCUDACXX_HIDE_FROM_ABI __half fabs(__half __x)
{
return __constexpr_fabs(__x);
return _CUDA_VSTD::__constexpr_fabs(__x);
}

_LIBCUDACXX_HIDE_FROM_ABI __half abs(__half __x)
{
return __constexpr_fabs(__x);
return _CUDA_VSTD::__constexpr_fabs(__x);
}

_LIBCUDACXX_HIDE_FROM_ABI __half __constexpr_fmax(__half __x, __half __y) noexcept
Expand Down
30 changes: 15 additions & 15 deletions libcudacxx/include/cuda/std/detail/libcxx/include/cmath
Original file line number Diff line number Diff line change
Expand Up @@ -588,16 +588,16 @@ using ::truncl;
#if _CCCL_STD_VER > 2014 && !defined(__cuda_std__)
_LIBCUDACXX_HIDE_FROM_ABI float hypot(float x, float y, float z)
{
return sqrt(x * x + y * y + z * z);
return _CUDA_VSTD::sqrt(x * x + y * y + z * z);
}
_LIBCUDACXX_HIDE_FROM_ABI double hypot(double x, double y, double z)
{
return sqrt(x * x + y * y + z * z);
return _CUDA_VSTD::sqrt(x * x + y * y + z * z);
}
# ifdef _LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE
_LIBCUDACXX_HIDE_FROM_ABI long double hypot(long double x, long double y, long double z)
{
return sqrt(x * x + y * y + z * z);
return _CUDA_VSTD::sqrt(x * x + y * y + z * z);
}
# endif

Expand All @@ -611,7 +611,7 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) noexcept
static_assert(
(!(is_same<_A1, __result_type>::value && is_same<_A2, __result_type>::value && is_same<_A3, __result_type>::value)),
"");
return ::hypot((__result_type) __lcpp_x, (__result_type) __lcpp_y, (__result_type) __lcpp_z);
return _CUDA_VSTD::hypot((__result_type) __lcpp_x, (__result_type) __lcpp_y, (__result_type) __lcpp_z);
}
#endif

Expand Down Expand Up @@ -763,11 +763,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX float __constexpr_fmax(f
if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED())
# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
{
if (__constexpr_isnan(__x))
if (_CUDA_VSTD::__constexpr_isnan(__x))
{
return __y;
}
if (__constexpr_isnan(__y))
if (_CUDA_VSTD::__constexpr_isnan(__y))
{
return __x;
}
Expand All @@ -786,11 +786,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX double __constexpr_fmax(
if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED())
# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
{
if (__constexpr_isnan(__x))
if (_CUDA_VSTD::__constexpr_isnan(__x))
{
return __y;
}
if (__constexpr_isnan(__y))
if (_CUDA_VSTD::__constexpr_isnan(__y))
{
return __x;
}
Expand All @@ -810,11 +810,11 @@ __constexpr_fmax(long double __x, long double __y) noexcept
if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED())
# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
{
if (__constexpr_isnan(__x))
if (_CUDA_VSTD::__constexpr_isnan(__x))
{
return __y;
}
if (__constexpr_isnan(__y))
if (_CUDA_VSTD::__constexpr_isnan(__y))
{
return __x;
}
Expand Down Expand Up @@ -851,17 +851,17 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX _Tp __constexpr_logb(_Tp
return -numeric_limits<_Tp>::infinity();
}

if (__constexpr_isinf(__x))
if (_CUDA_VSTD::__constexpr_isinf(__x))
{
return numeric_limits<_Tp>::infinity();
}

if (__constexpr_isnan(__x))
if (_CUDA_VSTD::__constexpr_isnan(__x))
{
return numeric_limits<_Tp>::quiet_NaN();
}

__x = __constexpr_fabs(__x);
__x = _CUDA_VSTD::__constexpr_fabs(__x);
unsigned long long __exp = 0;
while (__x >= _Tp(numeric_limits<_Tp>::radix))
{
Expand Down Expand Up @@ -913,7 +913,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX _Tp __constexpr_scalbn(_
return __x;
}

if (__constexpr_isinf(__x))
if (_CUDA_VSTD::__constexpr_isinf(__x))
{
return __x;
}
Expand All @@ -923,7 +923,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX _Tp __constexpr_scalbn(_
return __x;
}

if (__constexpr_isnan(__x))
if (_CUDA_VSTD::__constexpr_isnan(__x))
{
return numeric_limits<_Tp>::quiet_NaN();
}
Expand Down

0 comments on commit 43e28e6

Please sign in to comment.