Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into pylibcudf/strings/wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored Sep 30, 2024
2 parents 695a46e + 9b2f892 commit 727edae
Show file tree
Hide file tree
Showing 76 changed files with 1,183 additions and 905 deletions.
3 changes: 2 additions & 1 deletion cpp/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Checks:
'modernize-*,
-modernize-use-equals-default,
-modernize-concat-nested-namespaces,
-modernize-use-trailing-return-type'
-modernize-use-trailing-return-type,
-modernize-use-bool-literals'

# -modernize-use-equals-default # auto-fix is broken (doesn't insert =default correctly)
# -modernize-concat-nested-namespaces # auto-fix is broken (can delete code)
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/column/column_device_view.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1425,13 +1425,13 @@ struct pair_rep_accessor {

private:
template <typename R, std::enable_if_t<std::is_same_v<R, rep_type>, void>* = nullptr>
__device__ inline auto get_rep(cudf::size_type i) const
__device__ [[nodiscard]] inline auto get_rep(cudf::size_type i) const
{
return col.element<R>(i);
}

template <typename R, std::enable_if_t<not std::is_same_v<R, rep_type>, void>* = nullptr>
__device__ inline auto get_rep(cudf::size_type i) const
__device__ [[nodiscard]] inline auto get_rep(cudf::size_type i) const
{
return col.element<R>(i).value();
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/column/column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class column_view_base {
*
* @return Typed pointer to underlying data
*/
virtual void const* get_data() const noexcept { return _data; }
[[nodiscard]] virtual void const* get_data() const noexcept { return _data; }

data_type _type{type_id::EMPTY}; ///< Element type
size_type _size{}; ///< Number of elements
Expand Down Expand Up @@ -695,7 +695,7 @@ class mutable_column_view : public detail::column_view_base {
*
* @return Typed pointer to underlying data
*/
void const* get_data() const noexcept override;
[[nodiscard]] void const* get_data() const noexcept override;

private:
friend mutable_column_view bit_cast(mutable_column_view const& input, data_type type);
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/detail/aggregation/aggregation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ class ewma_aggregation final : public scan_aggregation {
{
}

std::unique_ptr<aggregation> clone() const override
[[nodiscard]] std::unique_ptr<aggregation> clone() const override
{
return std::make_unique<ewma_aggregation>(*this);
}
Expand All @@ -694,7 +694,7 @@ class ewma_aggregation final : public scan_aggregation {
return collector.visit(col_type, *this);
}

bool is_equal(aggregation const& _other) const override
[[nodiscard]] bool is_equal(aggregation const& _other) const override
{
if (!this->aggregation::is_equal(_other)) { return false; }
auto const& other = dynamic_cast<ewma_aggregation const&>(_other);
Expand Down
1 change: 0 additions & 1 deletion cpp/include/cudf/detail/groupby/sort_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ struct sort_groupby_helper {
*/
column_view keys_bitmask_column(rmm::cuda_stream_view stream);

private:
column_ptr _key_sorted_order; ///< Indices to produce _keys in sorted order
column_ptr _unsorted_keys_labels; ///< Group labels for unsorted _keys
column_ptr _keys_bitmask_column; ///< Column representing rows with one or more nulls values
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/detail/utilities/host_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class rmm_host_allocator {
*/
inline bool operator!=(rmm_host_allocator const& x) const { return !operator==(x); }

bool is_device_accessible() const { return _is_device_accessible; }
[[nodiscard]] bool is_device_accessible() const { return _is_device_accessible; }

private:
rmm::host_async_resource_ref mr;
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/dictionary/dictionary_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class dictionary_column_view : private column_view {
dictionary_column_view(column_view const& dictionary_column);
dictionary_column_view(dictionary_column_view&&) = default; ///< Move constructor
dictionary_column_view(dictionary_column_view const&) = default; ///< Copy constructor
~dictionary_column_view() = default;
~dictionary_column_view() override = default;

/**
* @brief Move assignment operator
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/groupby.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace CUDF_EXPORT cudf {
namespace groupby {
namespace detail {
namespace sort {
class sort_groupby_helper;
struct sort_groupby_helper;

} // namespace sort
} // namespace detail
Expand Down
3 changes: 0 additions & 3 deletions cpp/include/cudf/io/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class json_reader_options {
// Whether to parse dates as DD/MM versus MM/DD
bool _dayfirst = false;

// Whether to use the legacy reader
bool _legacy = false;

// Whether to keep the quote characters of string values
bool _keep_quotes = false;

Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/io/parquet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ class parquet_writer_options : public parquet_writer_options_base {
* @param sink The sink used for writer output
* @param table Table to be written to output
*/
explicit parquet_writer_options(sink_info const& sink, table_view const& table);
explicit parquet_writer_options(sink_info const& sink, table_view table);

public:
/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/lists/lists_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class lists_column_view : private column_view {
lists_column_view(column_view const& lists_column);
lists_column_view(lists_column_view&&) = default; ///< Move constructor
lists_column_view(lists_column_view const&) = default; ///< Copy constructor
~lists_column_view() = default;
~lists_column_view() override = default;
/**
* @brief Copy assignment operator
*
Expand Down
6 changes: 2 additions & 4 deletions cpp/include/cudf/scalar/scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace CUDF_EXPORT cudf {
*/
class scalar {
public:
scalar() = delete;
virtual ~scalar() = default;
scalar& operator=(scalar const& other) = delete;
scalar& operator=(scalar&& other) = delete;
Expand Down Expand Up @@ -96,8 +97,6 @@ class scalar {
data_type _type{type_id::EMPTY}; ///< Logical type of value in the scalar
rmm::device_scalar<bool> _is_valid; ///< Device bool signifying validity

scalar() = delete;

/**
* @brief Move constructor for scalar.
* @param other The other scalar to move from.
Expand Down Expand Up @@ -145,6 +144,7 @@ class fixed_width_scalar : public scalar {
public:
using value_type = T; ///< Type of the value held by the scalar.

fixed_width_scalar() = delete;
~fixed_width_scalar() override = default;

/**
Expand Down Expand Up @@ -203,8 +203,6 @@ class fixed_width_scalar : public scalar {
protected:
rmm::device_scalar<T> _data; ///< device memory containing the value

fixed_width_scalar() = delete;

/**
* @brief Construct a new fixed width scalar object.
*
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/strings/detail/char_tables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ character_cases_table_type const* get_character_cases_table();
*/
struct special_case_mapping {
uint16_t num_upper_chars;
uint16_t upper[3];
uint16_t upper[3]; // NOLINT
uint16_t num_lower_chars;
uint16_t lower[3];
uint16_t lower[3]; // NOLINT
};

/**
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/strings/regex/regex_program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct regex_program {
regex_flags flags = regex_flags::DEFAULT,
capture_groups capture = capture_groups::EXTRACT);

regex_program() = delete;

/**
* @brief Move constructor
*
Expand Down Expand Up @@ -115,8 +117,6 @@ struct regex_program {
~regex_program();

private:
regex_program() = delete;

std::string _pattern;
regex_flags _flags;
capture_groups _capture;
Expand Down
13 changes: 5 additions & 8 deletions cpp/include/cudf/strings/string_view.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ __device__ inline std::pair<size_type, size_type> bytes_to_character_position(st
* values. Also, this char pointer serves as valid device pointer of identity
* value for minimum operator on string values.
*/
static __constant__ char max_string_sentinel[5]{"\xF7\xBF\xBF\xBF"};
static __constant__ char max_string_sentinel[5]{"\xF7\xBF\xBF\xBF"}; // NOLINT
} // namespace detail
} // namespace strings

Expand Down Expand Up @@ -283,14 +283,11 @@ __device__ inline size_type string_view::const_iterator::position() const { retu

__device__ inline size_type string_view::const_iterator::byte_offset() const { return byte_pos; }

__device__ inline string_view::const_iterator string_view::begin() const
{
return const_iterator(*this, 0, 0);
}
__device__ inline string_view::const_iterator string_view::begin() const { return {*this, 0, 0}; }

__device__ inline string_view::const_iterator string_view::end() const
{
return const_iterator(*this, length(), size_bytes());
return {*this, length(), size_bytes()};
}
// @endcond

Expand Down Expand Up @@ -411,7 +408,7 @@ __device__ inline size_type string_view::find(char const* str,

__device__ inline size_type string_view::find(char_utf8 chr, size_type pos, size_type count) const
{
char str[sizeof(char_utf8)];
char str[sizeof(char_utf8)]; // NOLINT
size_type chwidth = strings::detail::from_char_utf8(chr, str);
return find(str, chwidth, pos, count);
}
Expand All @@ -433,7 +430,7 @@ __device__ inline size_type string_view::rfind(char const* str,

__device__ inline size_type string_view::rfind(char_utf8 chr, size_type pos, size_type count) const
{
char str[sizeof(char_utf8)];
char str[sizeof(char_utf8)]; // NOLINT
size_type chwidth = strings::detail::from_char_utf8(chr, str);
return rfind(str, chwidth, pos, count);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/strings/strings_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class strings_column_view : private column_view {
strings_column_view(column_view strings_column);
strings_column_view(strings_column_view&&) = default; ///< Move constructor
strings_column_view(strings_column_view const&) = default; ///< Copy constructor
~strings_column_view() = default;
~strings_column_view() override = default;
/**
* @brief Copy assignment operator
*
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/structs/structs_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class structs_column_view : public column_view {
// Foundation members:
structs_column_view(structs_column_view const&) = default; ///< Copy constructor
structs_column_view(structs_column_view&&) = default; ///< Move constructor
~structs_column_view() = default;
~structs_column_view() override = default;
/**
* @brief Copy assignment operator
*
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/tdigest/tdigest_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class tdigest_column_view : private column_view {
tdigest_column_view(column_view const&); ///< Construct tdigest_column_view from a column_view
tdigest_column_view(tdigest_column_view&&) = default; ///< Move constructor
tdigest_column_view(tdigest_column_view const&) = default; ///< Copy constructor
~tdigest_column_view() = default;
~tdigest_column_view() override = default;
/**
* @brief Copy assignment operator
*
Expand Down
64 changes: 32 additions & 32 deletions cpp/include/cudf/utilities/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,26 +236,26 @@ struct host_span : public cudf::detail::span_base<T, Extent, host_span<T, Extent

/// Constructor from container
/// @param in The container to construct the span from
template <
typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_host_span_supported_container<C>::value &&
std::is_convertible_v<std::remove_pointer_t<decltype(thrust::raw_pointer_cast(
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr>
template <typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_host_span_supported_container<C>::value &&
std::is_convertible_v<
std::remove_pointer_t<decltype(thrust::raw_pointer_cast( // NOLINT
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr> // NOLINT
constexpr host_span(C& in) : base(thrust::raw_pointer_cast(in.data()), in.size())
{
}

/// Constructor from const container
/// @param in The container to construct the span from
template <
typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_host_span_supported_container<C>::value &&
std::is_convertible_v<std::remove_pointer_t<decltype(thrust::raw_pointer_cast(
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr>
template <typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_host_span_supported_container<C>::value &&
std::is_convertible_v<
std::remove_pointer_t<decltype(thrust::raw_pointer_cast( // NOLINT
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr> // NOLINT
constexpr host_span(C const& in) : base(thrust::raw_pointer_cast(in.data()), in.size())
{
}
Expand All @@ -264,7 +264,7 @@ struct host_span : public cudf::detail::span_base<T, Extent, host_span<T, Extent
/// @param in The host_vector to construct the span from
template <typename OtherT,
// Only supported containers of types convertible to T
std::enable_if_t<std::is_convertible_v<OtherT (*)[], T (*)[]>>* = nullptr>
std::enable_if_t<std::is_convertible_v<OtherT (*)[], T (*)[]>>* = nullptr> // NOLINT
constexpr host_span(cudf::detail::host_vector<OtherT>& in)
: base(in.data(), in.size()), _is_device_accessible{in.get_allocator().is_device_accessible()}
{
Expand All @@ -274,7 +274,7 @@ struct host_span : public cudf::detail::span_base<T, Extent, host_span<T, Extent
/// @param in The host_vector to construct the span from
template <typename OtherT,
// Only supported containers of types convertible to T
std::enable_if_t<std::is_convertible_v<OtherT (*)[], T (*)[]>>* = nullptr>
std::enable_if_t<std::is_convertible_v<OtherT (*)[], T (*)[]>>* = nullptr> // NOLINT
constexpr host_span(cudf::detail::host_vector<OtherT> const& in)
: base(in.data(), in.size()), _is_device_accessible{in.get_allocator().is_device_accessible()}
{
Expand All @@ -285,7 +285,7 @@ struct host_span : public cudf::detail::span_base<T, Extent, host_span<T, Extent
template <typename OtherT,
std::size_t OtherExtent,
std::enable_if_t<(Extent == OtherExtent || Extent == dynamic_extent) &&
std::is_convertible_v<OtherT (*)[], T (*)[]>,
std::is_convertible_v<OtherT (*)[], T (*)[]>, // NOLINT
void>* = nullptr>
constexpr host_span(host_span<OtherT, OtherExtent> const& other) noexcept
: base(other.data(), other.size())
Expand Down Expand Up @@ -333,26 +333,26 @@ struct device_span : public cudf::detail::span_base<T, Extent, device_span<T, Ex

/// Constructor from container
/// @param in The container to construct the span from
template <
typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_device_span_supported_container<C>::value &&
std::is_convertible_v<std::remove_pointer_t<decltype(thrust::raw_pointer_cast(
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr>
template <typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_device_span_supported_container<C>::value &&
std::is_convertible_v<
std::remove_pointer_t<decltype(thrust::raw_pointer_cast( // NOLINT
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr> // NOLINT
constexpr device_span(C& in) : base(thrust::raw_pointer_cast(in.data()), in.size())
{
}

/// Constructor from const container
/// @param in The container to construct the span from
template <
typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_device_span_supported_container<C>::value &&
std::is_convertible_v<std::remove_pointer_t<decltype(thrust::raw_pointer_cast(
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr>
template <typename C,
// Only supported containers of types convertible to T
std::enable_if_t<is_device_span_supported_container<C>::value &&
std::is_convertible_v<
std::remove_pointer_t<decltype(thrust::raw_pointer_cast( // NOLINT
std::declval<C&>().data()))> (*)[],
T (*)[]>>* = nullptr> // NOLINT
constexpr device_span(C const& in) : base(thrust::raw_pointer_cast(in.data()), in.size())
{
}
Expand All @@ -362,7 +362,7 @@ struct device_span : public cudf::detail::span_base<T, Extent, device_span<T, Ex
template <typename OtherT,
std::size_t OtherExtent,
std::enable_if_t<(Extent == OtherExtent || Extent == dynamic_extent) &&
std::is_convertible_v<OtherT (*)[], T (*)[]>,
std::is_convertible_v<OtherT (*)[], T (*)[]>, // NOLINT
void>* = nullptr>
constexpr device_span(device_span<OtherT, OtherExtent> const& other) noexcept
: base(other.data(), other.size())
Expand Down
5 changes: 2 additions & 3 deletions cpp/include/cudf_test/type_list_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,8 @@ struct RemoveIfImpl<PRED, Types<>> {

template <class PRED, class HEAD, class... TAIL>
struct RemoveIfImpl<PRED, Types<HEAD, TAIL...>> {
using type =
Concat<typename std::conditional<PRED::template Call<HEAD>::value, Types<>, Types<HEAD>>::type,
typename RemoveIfImpl<PRED, Types<TAIL...>>::type>;
using type = Concat<std::conditional_t<PRED::template Call<HEAD>::value, Types<>, Types<HEAD>>,
typename RemoveIfImpl<PRED, Types<TAIL...>>::type>;
};
// @endcond

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/datetime/timezone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::string const tzif_system_directory = "/usr/share/zoneinfo/";
struct timezone_file_header {
uint32_t magic; ///< "TZif"
uint8_t version; ///< 0:version1, '2':version2, '3':version3
uint8_t reserved15[15]; ///< unused, reserved for future use
uint8_t reserved15[15]; ///< unused, reserved for future use // NOLINT
uint32_t isutccnt; ///< number of UTC/local indicators contained in the body
uint32_t isstdcnt; ///< number of standard/wall indicators contained in the body
uint32_t leapcnt; ///< number of leap second records contained in the body
Expand Down
Loading

0 comments on commit 727edae

Please sign in to comment.