Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add column sanitization checks in CUDF_TEST_EXPECT_COLUMN_* macros #14559

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cpp/tests/utilities/column_utilities.cu
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <cudf/column/column_view.hpp>
#include <cudf/copying.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/detail/get_value.cuh>
#include <cudf/detail/iterator.cuh>
#include <cudf/detail/utilities/vector_factories.hpp>
Expand Down Expand Up @@ -804,6 +805,12 @@ bool expect_column_properties_equal(column_view const& lhs,
column_view const& rhs,
debug_output_level verbosity)
{
if (cudf::detail::has_nonempty_nulls(lhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized lhs column");
SurajAralihalli marked this conversation as resolved.
Show resolved Hide resolved
}
if (cudf::detail::has_nonempty_nulls(rhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized rhs column");
}
auto lhs_indices = generate_all_row_indices(lhs.size());
auto rhs_indices = generate_all_row_indices(rhs.size());
return cudf::type_dispatcher(lhs.type(),
Expand All @@ -822,6 +829,12 @@ bool expect_column_properties_equivalent(column_view const& lhs,
column_view const& rhs,
debug_output_level verbosity)
{
if (cudf::detail::has_nonempty_nulls(lhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized lhs column");
}
if (cudf::detail::has_nonempty_nulls(rhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized rhs column");
}
SurajAralihalli marked this conversation as resolved.
Show resolved Hide resolved
auto lhs_indices = generate_all_row_indices(lhs.size());
auto rhs_indices = generate_all_row_indices(rhs.size());
return cudf::type_dispatcher(lhs.type(),
Expand All @@ -840,6 +853,12 @@ bool expect_columns_equal(cudf::column_view const& lhs,
cudf::column_view const& rhs,
debug_output_level verbosity)
{
if (cudf::detail::has_nonempty_nulls(lhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized lhs column");
}
if (cudf::detail::has_nonempty_nulls(rhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized rhs column");
}
auto lhs_indices = generate_all_row_indices(lhs.size());
auto rhs_indices = generate_all_row_indices(rhs.size());
return cudf::type_dispatcher(lhs.type(),
Expand All @@ -860,6 +879,12 @@ bool expect_columns_equivalent(cudf::column_view const& lhs,
debug_output_level verbosity,
size_type fp_ulps)
{
if (cudf::detail::has_nonempty_nulls(lhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized lhs column");
}
if (cudf::detail::has_nonempty_nulls(rhs, cudf::get_default_stream())) {
throw std::invalid_argument("Unsanitized rhs column");
}
auto lhs_indices = generate_all_row_indices(lhs.size());
auto rhs_indices = generate_all_row_indices(rhs.size());
return cudf::type_dispatcher(lhs.type(),
Expand Down
Loading