From d5e6941fe097c2eceedbe3268e8e6baea30d1a0e Mon Sep 17 00:00:00 2001 From: David Wendt <45795991+davidwendt@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:02:21 -0400 Subject: [PATCH] Remove cudf::strings::string namespace (#10684) Minor change to change the unnecessary `cudf::strings::string` namespace in the `string.cuh` functions' declarations/definitions to just `cudf::strings`. The extra `string` namespace is confusing an not needed. Calling functions have been updated appropriately. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cudf/pull/10684 --- cpp/include/cudf/strings/string.cuh | 2 -- cpp/src/strings/convert/convert_floats.cu | 6 +++--- cpp/src/strings/convert/convert_integers.cu | 13 ++++++------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cpp/include/cudf/strings/string.cuh b/cpp/include/cudf/strings/string.cuh index 0cfcaeb913e..d20080cc0e5 100644 --- a/cpp/include/cudf/strings/string.cuh +++ b/cpp/include/cudf/strings/string.cuh @@ -23,7 +23,6 @@ namespace cudf { namespace strings { -namespace string { /** * @addtogroup strings_classes * @{ @@ -150,6 +149,5 @@ inline __device__ bool is_float(string_view const& d_str) } /** @} */ // end of group -} // namespace string } // namespace strings } // namespace cudf diff --git a/cpp/src/strings/convert/convert_floats.cu b/cpp/src/strings/convert/convert_floats.cu index b8a10a00f5b..8acf348ef05 100644 --- a/cpp/src/strings/convert/convert_floats.cu +++ b/cpp/src/strings/convert/convert_floats.cu @@ -67,8 +67,8 @@ __device__ inline double stod(string_view const& d_str) // special strings: NaN, Inf if ((in_ptr < end) && *in_ptr > '9') { auto const inf_nan = string_view(in_ptr, static_cast(thrust::distance(in_ptr, end))); - if (string::is_nan_str(inf_nan)) return std::numeric_limits::quiet_NaN(); - if (string::is_inf_str(inf_nan)) return sign * std::numeric_limits::infinity(); + if (is_nan_str(inf_nan)) return std::numeric_limits::quiet_NaN(); + if (is_inf_str(inf_nan)) return sign * std::numeric_limits::infinity(); } // Parse and store the mantissa as much as we can, @@ -567,7 +567,7 @@ std::unique_ptr is_float( d_results, [d_column] __device__(size_type idx) { if (d_column.is_null(idx)) return false; - return string::is_float(d_column.element(idx)); + return strings::is_float(d_column.element(idx)); }); results->set_null_count(strings.null_count()); return results; diff --git a/cpp/src/strings/convert/convert_integers.cu b/cpp/src/strings/convert/convert_integers.cu index 95ddf1822a7..75c2f851bab 100644 --- a/cpp/src/strings/convert/convert_integers.cu +++ b/cpp/src/strings/convert/convert_integers.cu @@ -150,14 +150,13 @@ std::unique_ptr is_integer( d_column->pair_begin(), d_column->pair_end(), d_results, - [] __device__(auto const& p) { return p.second ? string::is_integer(p.first) : false; }); + [] __device__(auto const& p) { return p.second ? strings::is_integer(p.first) : false; }); } else { - thrust::transform( - rmm::exec_policy(stream), - d_column->pair_begin(), - d_column->pair_end(), - d_results, - [] __device__(auto const& p) { return p.second ? string::is_integer(p.first) : false; }); + thrust::transform(rmm::exec_policy(stream), + d_column->pair_begin(), + d_column->pair_end(), + d_results, + [] __device__(auto const& p) { return strings::is_integer(p.first); }); } // Calling mutable_view() on a column invalidates it's null count so we need to set it back