2828#include < rmm/resource_ref.hpp>
2929
3030#include < cub/warp/warp_reduce.cuh>
31+ #include < cuda/std/cmath>
32+ #include < cuda/std/limits>
3133#include < cuda/std/utility>
3234
3335using namespace cudf ;
@@ -44,7 +46,7 @@ __device__ __inline__ bool is_digit(char c) { return c >= '0' && c <= '9'; }
4446 * @param chr character to test
4547 * @return true if character is a whitespace character
4648 */
47- constexpr bool is_whitespace (char const chr)
49+ __host__ __device__ constexpr bool is_whitespace (char const chr)
4850{
4951 // Whitespace characters include:
5052 // - Space (0x20, ' ')
@@ -113,8 +115,8 @@ class string_to_float {
113115 // check for inf / infinity
114116 if (check_for_inf ()) {
115117 if (_warp_lane == 0 ) {
116- _out[_row] =
117- sign >= 0 ? std::numeric_limits<T>:: infinity () : -std::numeric_limits<T>::infinity ();
118+ _out[_row] = sign >= 0 ? cuda::std::numeric_limits<T>:: infinity ()
119+ : -cuda:: std::numeric_limits<T>::infinity ();
118120 }
119121 compute_validity (_valid, _except);
120122 return ;
@@ -164,9 +166,9 @@ class string_to_float {
164166 int exp_ten = exp_base + manual_exp;
165167
166168 // final value
167- if (exp_ten > std::numeric_limits<double >::max_exponent10) {
168- _out[_row] = sign >= 0 ? std::numeric_limits<double >::infinity ()
169- : -std::numeric_limits<double >::infinity ();
169+ if (exp_ten > cuda:: std::numeric_limits<double >::max_exponent10) {
170+ _out[_row] = sign >= 0 ? cuda:: std::numeric_limits<double >::infinity ()
171+ : -cuda:: std::numeric_limits<double >::infinity ();
170172 } else {
171173 // make sure we don't produce a subnormal number.
172174 // - a normal number is one where the leading digit of the floating point rep is not zero.
@@ -182,7 +184,7 @@ class string_to_float {
182184 // https://en.wikipedia.org/wiki/Denormal_number
183185 //
184186
185- auto const subnormal_shift = std::numeric_limits<double >::min_exponent10 - exp_ten;
187+ auto const subnormal_shift = cuda:: std::numeric_limits<double >::min_exponent10 - exp_ten;
186188 if (subnormal_shift > 0 ) {
187189 // Handle subnormal values. Ensure that both base and exponent are
188190 // normal values before computing their product.
@@ -192,7 +194,7 @@ class string_to_float {
192194 auto const exponent = exp10 (static_cast <double >(exp_ten + subnormal_shift));
193195 _out[_row] = static_cast <T>(digitsf * exponent);
194196 } else {
195- double const exponent = exp10 (static_cast <double >(std::abs (exp_ten)));
197+ double const exponent = exp10 (static_cast <double >(cuda:: std::abs (exp_ten)));
196198 double const result = exp_ten < 0 ? digitsf / exponent : digitsf * exponent;
197199
198200 _out[_row] = static_cast <T>(result);
@@ -426,7 +428,7 @@ class string_to_float {
426428 // 1,844,674,407,370,955,160 + 1X -> 18,446,744,073,709,551,61X -> potentially rolls
427429 // past the limit
428430 //
429- constexpr uint64_t max_holding = (std::numeric_limits<uint64_t >::max () - 9 ) / 10 ;
431+ constexpr uint64_t max_holding = (cuda:: std::numeric_limits<uint64_t >::max () - 9 ) / 10 ;
430432 // if we're already past the max_holding, just truncate.
431433 // eg: 9,999,999,999,999,999,999
432434 if (digits > max_holding) {
0 commit comments