diff --git a/cpp/src/scalar/scalar.cpp b/cpp/src/scalar/scalar.cpp index 045bfbe0327..3d208928f8d 100644 --- a/cpp/src/scalar/scalar.cpp +++ b/cpp/src/scalar/scalar.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -567,12 +567,13 @@ void struct_scalar::superimpose_nulls(rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) { // push validity mask down - std::vector host_validity({0}); - auto validity = cudf::detail::make_device_uvector_sync(host_validity, stream, mr); + std::vector host_validity( + cudf::bitmask_allocation_size_bytes(1) / sizeof(bitmask_type), 0); + auto validity = cudf::detail::create_null_mask(1, mask_state::ALL_NULL, stream); auto iter = thrust::make_counting_iterator(0); std::for_each(iter, iter + _data.num_columns(), [&](size_type i) { cudf::structs::detail::superimpose_parent_nulls( - validity.data(), 1, _data.get_column(i), stream, mr); + static_cast(validity.data()), 1, _data.get_column(i), stream, mr); }); } diff --git a/cpp/src/structs/utilities.cpp b/cpp/src/structs/utilities.cpp index 80bea2ab55e..aa32c555324 100644 --- a/cpp/src/structs/utilities.cpp +++ b/cpp/src/structs/utilities.cpp @@ -187,8 +187,7 @@ void superimpose_parent_nulls(bitmask_type const* parent_null_mask, { if (!child.nullable()) { // Child currently has no null mask. Copy parent's null mask. - child.set_null_mask(rmm::device_buffer{ - parent_null_mask, cudf::bitmask_allocation_size_bytes(child.size()), stream, mr}); + child.set_null_mask(cudf::detail::copy_bitmask(parent_null_mask, 0, child.size(), stream, mr)); child.set_null_count(parent_null_count); } else { // Child should have a null mask.