Skip to content

Commit

Permalink
add missing stream, mr arguments at libcudf column creation (#7779)
Browse files Browse the repository at this point in the history
Follow up on PR #7769
This PR fixes few more places of missing stream, and memory resource arguments.

Authors:
  - Karthikeyan (https://github.com/karthikeyann)

Approvers:
  - Ram (Ramakrishna Prabhu) (https://github.com/rgsl888prabhu)
  - Nghia Truong (https://github.com/ttnghia)

URL: #7779
  • Loading branch information
karthikeyann authored Apr 12, 2021
1 parent 9433ac9 commit 7ad07b4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cpp/src/dictionary/replace.cu
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ std::unique_ptr<column> replace_nulls(dictionary_column_view const& input,
rmm::mr::device_memory_resource* mr)
{
if (input.is_empty()) { return cudf::empty_like(input.parent()); }
if (!input.has_nulls()) { return std::make_unique<cudf::column>(input.parent()); }
if (!input.has_nulls()) { return std::make_unique<cudf::column>(input.parent(), stream, mr); }
CUDF_EXPECTS(input.keys().type() == replacement.keys().type(), "keys must match");
CUDF_EXPECTS(replacement.size() == input.size(), "column sizes must match");

Expand Down Expand Up @@ -118,7 +118,7 @@ std::unique_ptr<column> replace_nulls(dictionary_column_view const& input,
{
if (input.is_empty()) { return cudf::empty_like(input.parent()); }
if (!input.has_nulls() || !replacement.is_valid()) {
return std::make_unique<cudf::column>(input.parent());
return std::make_unique<cudf::column>(input.parent(), stream, mr);
}
CUDF_EXPECTS(input.keys().type() == replacement.type(), "keys must match scalar type");

Expand Down
4 changes: 3 additions & 1 deletion cpp/src/lists/copying/copying.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ std::unique_ptr<cudf::column> copy_slice(lists_column_view const& lists,
(lists.child().type() == cudf::data_type{type_id::LIST})
? copy_slice(lists_column_view(lists.child()), start_offset, end_offset, stream, mr)
: std::make_unique<cudf::column>(
cudf::detail::slice(lists.child(), {start_offset, end_offset}, stream).front());
cudf::detail::slice(lists.child(), {start_offset, end_offset}, stream).front(),
stream,
mr);

// Compute the null mask of the result:
auto null_mask = cudf::detail::copy_bitmask(lists.null_mask(), start, end, stream, mr);
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/replace/replace.cu
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ std::unique_ptr<cudf::column> find_and_replace_all(cudf::column_view const& inpu
"Columns type mismatch");
CUDF_EXPECTS(values_to_replace.has_nulls() == false, "values_to_replace must not have nulls");

if (0 == input_col.size() || 0 == values_to_replace.size() || 0 == replacement_values.size()) {
return std::make_unique<cudf::column>(input_col);
if (input_col.is_empty() or values_to_replace.is_empty() or replacement_values.is_empty()) {
return std::make_unique<cudf::column>(input_col, stream, mr);
}

return cudf::type_dispatcher<dispatch_storage_type>(input_col.type(),
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/strings/convert/convert_urls.cu
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ std::unique_ptr<column> url_decode(

if (esc_count == 0) {
// nothing to replace, so just copy the input column
return std::make_unique<cudf::column>(strings.parent());
return std::make_unique<cudf::column>(strings.parent(), stream, mr);
}

// create a vector of the potential escape sequence positions
Expand All @@ -378,7 +378,7 @@ std::unique_ptr<column> url_decode(
esc_count = esc_pos_end - d_esc_positions;
if (esc_count == 0) {
// nothing to replace, so just copy the input column
return std::make_unique<cudf::column>(strings.parent());
return std::make_unique<cudf::column>(strings.parent(), stream, mr);
}

device_span<size_type const> d_esc_positions_span(d_esc_positions, esc_count);
Expand Down

0 comments on commit 7ad07b4

Please sign in to comment.