Skip to content

Commit

Permalink
Installed cudf header use cudf::allocate_like (rapidsai#16087)
Browse files Browse the repository at this point in the history
Remove usage of non public cudf::allocate_like from implementations in headers we install

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Yunsong Wang (https://github.com/PointKernel)
  - Nghia Truong (https://github.com/ttnghia)

URL: rapidsai#16087
  • Loading branch information
robertmaynard authored Jun 28, 2024
1 parent 78f4a8a commit fb12d98
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cpp/include/cudf/detail/copy_if.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <cudf/column/column_device_view.cuh>
#include <cudf/column/column_factories.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/copying.hpp>
#include <cudf/detail/gather.hpp>
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/detail/utilities/cuda.cuh>
Expand Down Expand Up @@ -242,8 +242,8 @@ struct scatter_gather_functor {
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
auto output_column = cudf::detail::allocate_like(
input, output_size, cudf::mask_allocation_policy::RETAIN, stream, mr);
auto output_column =
cudf::allocate_like(input, output_size, cudf::mask_allocation_policy::RETAIN, stream, mr);
auto output = output_column->mutable_view();

bool has_valid = input.nullable();
Expand Down
13 changes: 6 additions & 7 deletions cpp/include/cudf/detail/gather.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
#pragma once

#include <cudf/detail/copy.hpp>
#include <cudf/copying.hpp>
#include <cudf/detail/indexalator.cuh>
#include <cudf/detail/null_mask.hpp>
#include <cudf/detail/utilities/assert.cuh>
Expand Down Expand Up @@ -217,10 +217,9 @@ struct column_gatherer_impl<Element, std::enable_if_t<is_rep_layout_compatible<E
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
auto const num_rows = cudf::distance(gather_map_begin, gather_map_end);
auto const policy = cudf::mask_allocation_policy::NEVER;
auto destination_column =
cudf::detail::allocate_like(source_column, num_rows, policy, stream, mr);
auto const num_rows = cudf::distance(gather_map_begin, gather_map_end);
auto const policy = cudf::mask_allocation_policy::NEVER;
auto destination_column = cudf::allocate_like(source_column, num_rows, policy, stream, mr);

gather_helper(source_column.data<Element>(),
source_column.size(),
Expand Down Expand Up @@ -413,8 +412,8 @@ struct column_gatherer_impl<dictionary32> {
auto keys_copy = std::make_unique<column>(dictionary.keys(), stream, mr);
// Perform gather on just the indices
column_view indices = dictionary.get_indices_annotated();
auto new_indices = cudf::detail::allocate_like(
indices, output_count, cudf::mask_allocation_policy::NEVER, stream, mr);
auto new_indices =
cudf::allocate_like(indices, output_count, cudf::mask_allocation_policy::NEVER, stream, mr);
gather_helper(
cudf::detail::indexalator_factory::make_input_iterator(indices),
indices.size(),
Expand Down
1 change: 1 addition & 0 deletions cpp/src/copying/sample.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <cudf/column/column.hpp>
#include <cudf/column/column_factories.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/detail/gather.cuh>
#include <cudf/detail/gather.hpp>
#include <cudf/detail/iterator.cuh>
Expand Down
1 change: 1 addition & 0 deletions cpp/src/lists/copying/segmented_gather.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cudf/detail/copy.hpp>
#include <cudf/detail/copy_range.cuh>
#include <cudf/detail/gather.cuh>
#include <cudf/detail/indexalator.cuh>
Expand Down

0 comments on commit fb12d98

Please sign in to comment.