From 9192d259633c382c6f98f956dc7f43d754ebbf44 Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Wed, 17 Apr 2024 22:21:38 +1000 Subject: [PATCH] Convert libcudf resource parameters to rmm::device_async_resource_ref (#15507) Closes https://github.com/rapidsai/cudf/issues/15498 For reviewers: Almost all of the thousands of changes are simple textual replace of `rmm::mr::device_memory_resource *` with `rmm::device_async_resource_ref`. I think the only substantial changes that are different are in `contiguous_split.cu` (which was assigning `nullptr` to the MR pointer -- I have changed these cases to use a `std::optional`), and in JNI code. ~I still need to figure out how to build and test the JNI bindings. And figure out necessary Cython changes.~ JNI is passing CI now. Cython required no changes. Authors: - Mark Harris (https://github.com/harrism) Approvers: - Jason Lowe (https://github.com/jlowe) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cudf/pull/15507 --- cpp/benchmarks/copying/shift.cu | 10 +- cpp/benchmarks/fixture/benchmark_fixture.hpp | 1 + .../cudf/ast/detail/expression_parser.hpp | 10 +- cpp/include/cudf/binaryop.hpp | 23 +-- cpp/include/cudf/column/column.hpp | 9 +- cpp/include/cudf/column/column_factories.hpp | 75 ++++---- cpp/include/cudf/concatenate.hpp | 15 +- cpp/include/cudf/contiguous_split.hpp | 10 +- cpp/include/cudf/copying.hpp | 77 ++++---- cpp/include/cudf/datetime.hpp | 43 ++--- cpp/include/cudf/detail/binaryop.hpp | 19 +- .../detail/calendrical_month_sequence.cuh | 5 +- cpp/include/cudf/detail/concatenate.hpp | 11 +- cpp/include/cudf/detail/concatenate_masks.hpp | 7 +- cpp/include/cudf/detail/contiguous_split.hpp | 7 +- cpp/include/cudf/detail/copy.hpp | 35 ++-- cpp/include/cudf/detail/copy_if.cuh | 7 +- cpp/include/cudf/detail/copy_if_else.cuh | 3 +- cpp/include/cudf/detail/copy_range.cuh | 3 +- cpp/include/cudf/detail/datetime.hpp | 66 +++---- .../cudf/detail/distinct_hash_join.cuh | 5 +- cpp/include/cudf/detail/fill.hpp | 5 +- cpp/include/cudf/detail/gather.cuh | 17 +- cpp/include/cudf/detail/gather.hpp | 9 +- cpp/include/cudf/detail/groupby.hpp | 5 +- .../detail/groupby/group_replace_nulls.hpp | 5 +- .../cudf/detail/groupby/sort_helper.hpp | 11 +- .../cudf/detail/hash_reduce_by_row.cuh | 3 +- cpp/include/cudf/detail/interop.hpp | 14 +- cpp/include/cudf/detail/join.hpp | 13 +- cpp/include/cudf/detail/label_bins.hpp | 5 +- cpp/include/cudf/detail/merge.hpp | 7 +- cpp/include/cudf/detail/null_mask.cuh | 11 +- cpp/include/cudf/detail/null_mask.hpp | 25 +-- cpp/include/cudf/detail/quantiles.hpp | 11 +- cpp/include/cudf/detail/repeat.hpp | 11 +- cpp/include/cudf/detail/replace.hpp | 27 +-- cpp/include/cudf/detail/reshape.hpp | 7 +- cpp/include/cudf/detail/rolling.hpp | 7 +- cpp/include/cudf/detail/round.hpp | 7 +- cpp/include/cudf/detail/scan.hpp | 13 +- cpp/include/cudf/detail/scatter.cuh | 17 +- cpp/include/cudf/detail/scatter.hpp | 19 +- cpp/include/cudf/detail/search.hpp | 15 +- cpp/include/cudf/detail/sequence.hpp | 13 +- .../cudf/detail/sizes_to_offsets_iterator.cuh | 3 +- cpp/include/cudf/detail/sorting.hpp | 23 +-- cpp/include/cudf/detail/stream_compaction.hpp | 21 ++- cpp/include/cudf/detail/structs/utilities.hpp | 11 +- cpp/include/cudf/detail/tdigest/tdigest.hpp | 17 +- cpp/include/cudf/detail/timezone.hpp | 7 +- cpp/include/cudf/detail/transform.hpp | 19 +- cpp/include/cudf/detail/transpose.hpp | 5 +- cpp/include/cudf/detail/unary.hpp | 15 +- .../detail/utilities/vector_factories.hpp | 23 +-- cpp/include/cudf/detail/valid_if.cuh | 3 +- .../cudf/dictionary/detail/concatenate.hpp | 5 +- cpp/include/cudf/dictionary/detail/encode.hpp | 7 +- cpp/include/cudf/dictionary/detail/merge.hpp | 5 +- .../cudf/dictionary/detail/replace.hpp | 7 +- cpp/include/cudf/dictionary/detail/search.hpp | 9 +- .../cudf/dictionary/detail/update_keys.hpp | 17 +- .../cudf/dictionary/dictionary_factories.hpp | 11 +- cpp/include/cudf/dictionary/encode.hpp | 13 +- cpp/include/cudf/dictionary/search.hpp | 7 +- cpp/include/cudf/dictionary/update_keys.hpp | 23 +-- cpp/include/cudf/filling.hpp | 27 +-- cpp/include/cudf/groupby.hpp | 25 +-- cpp/include/cudf/hashing.hpp | 43 ++--- cpp/include/cudf/hashing/detail/hashing.hpp | 19 +- cpp/include/cudf/interop.hpp | 22 ++- cpp/include/cudf/io/avro.hpp | 5 +- cpp/include/cudf/io/csv.hpp | 11 +- cpp/include/cudf/io/detail/avro.hpp | 5 +- cpp/include/cudf/io/detail/csv.hpp | 7 +- cpp/include/cudf/io/detail/json.hpp | 9 +- cpp/include/cudf/io/detail/orc.hpp | 3 +- cpp/include/cudf/io/detail/parquet.hpp | 5 +- cpp/include/cudf/io/detail/tokenize_json.hpp | 5 +- cpp/include/cudf/io/json.hpp | 9 +- cpp/include/cudf/io/orc.hpp | 5 +- cpp/include/cudf/io/parquet.hpp | 13 +- .../cudf/io/text/detail/tile_state.hpp | 4 +- cpp/include/cudf/io/text/detail/trie.hpp | 7 +- cpp/include/cudf/io/text/multibyte_split.hpp | 11 +- cpp/include/cudf/join.hpp | 90 ++++----- cpp/include/cudf/json/json.hpp | 9 +- cpp/include/cudf/labeling/label_bins.hpp | 5 +- cpp/include/cudf/lists/combine.hpp | 7 +- cpp/include/cudf/lists/contains.hpp | 27 +-- cpp/include/cudf/lists/count_elements.hpp | 7 +- cpp/include/cudf/lists/detail/combine.hpp | 8 +- cpp/include/cudf/lists/detail/concatenate.hpp | 5 +- cpp/include/cudf/lists/detail/contains.hpp | 20 +- cpp/include/cudf/lists/detail/copying.hpp | 5 +- cpp/include/cudf/lists/detail/extract.hpp | 12 +- cpp/include/cudf/lists/detail/gather.cuh | 15 +- .../cudf/lists/detail/interleave_columns.hpp | 5 +- .../lists/detail/lists_column_factories.hpp | 9 +- cpp/include/cudf/lists/detail/reverse.hpp | 6 +- cpp/include/cudf/lists/detail/scatter.cuh | 9 +- .../cudf/lists/detail/scatter_helper.cuh | 5 +- .../cudf/lists/detail/set_operations.hpp | 9 +- cpp/include/cudf/lists/detail/sorting.hpp | 7 +- .../cudf/lists/detail/stream_compaction.hpp | 9 +- cpp/include/cudf/lists/explode.hpp | 11 +- cpp/include/cudf/lists/extract.hpp | 11 +- cpp/include/cudf/lists/filling.hpp | 11 +- cpp/include/cudf/lists/gather.hpp | 9 +- cpp/include/cudf/lists/reverse.hpp | 7 +- cpp/include/cudf/lists/set_operations.hpp | 35 ++-- cpp/include/cudf/lists/sorting.hpp | 11 +- cpp/include/cudf/lists/stream_compaction.hpp | 15 +- cpp/include/cudf/merge.hpp | 5 +- cpp/include/cudf/null_mask.hpp | 23 +-- cpp/include/cudf/partitioning.hpp | 15 +- cpp/include/cudf/quantiles.hpp | 15 +- cpp/include/cudf/reduction.hpp | 17 +- .../cudf/reduction/detail/histogram.hpp | 5 +- .../cudf/reduction/detail/reduction.cuh | 9 +- .../cudf/reduction/detail/reduction.hpp | 8 +- .../reduction/detail/reduction_functions.hpp | 37 ++-- .../detail/segmented_reduction_functions.hpp | 25 +-- cpp/include/cudf/replace.hpp | 39 ++-- cpp/include/cudf/reshape.hpp | 9 +- cpp/include/cudf/rolling.hpp | 33 ++-- cpp/include/cudf/round.hpp | 7 +- cpp/include/cudf/scalar/scalar.hpp | 173 +++++++++--------- cpp/include/cudf/scalar/scalar_factories.hpp | 51 +++--- cpp/include/cudf/search.hpp | 15 +- cpp/include/cudf/sorting.hpp | 25 +-- cpp/include/cudf/stream_compaction.hpp | 43 ++--- cpp/include/cudf/strings/attributes.hpp | 9 +- cpp/include/cudf/strings/capitalize.hpp | 15 +- cpp/include/cudf/strings/case.hpp | 15 +- .../cudf/strings/char_types/char_types.hpp | 7 +- cpp/include/cudf/strings/combine.hpp | 27 +-- cpp/include/cudf/strings/contains.hpp | 19 +- .../cudf/strings/convert/convert_booleans.hpp | 11 +- .../cudf/strings/convert/convert_datetime.hpp | 19 +- .../strings/convert/convert_durations.hpp | 13 +- .../strings/convert/convert_fixed_point.hpp | 17 +- .../cudf/strings/convert/convert_floats.hpp | 15 +- .../cudf/strings/convert/convert_integers.hpp | 31 ++-- .../cudf/strings/convert/convert_ipv4.hpp | 15 +- .../cudf/strings/convert/convert_lists.hpp | 5 +- .../cudf/strings/convert/convert_urls.hpp | 11 +- cpp/include/cudf/strings/detail/combine.hpp | 15 +- .../cudf/strings/detail/concatenate.hpp | 5 +- .../cudf/strings/detail/converters.hpp | 51 +++--- .../cudf/strings/detail/copy_if_else.cuh | 3 +- .../cudf/strings/detail/copy_range.hpp | 3 +- cpp/include/cudf/strings/detail/copying.hpp | 7 +- cpp/include/cudf/strings/detail/fill.hpp | 5 +- cpp/include/cudf/strings/detail/gather.cuh | 7 +- cpp/include/cudf/strings/detail/merge.cuh | 3 +- cpp/include/cudf/strings/detail/replace.hpp | 17 +- cpp/include/cudf/strings/detail/scan.hpp | 5 +- cpp/include/cudf/strings/detail/scatter.cuh | 3 +- .../cudf/strings/detail/strings_children.cuh | 7 +- .../detail/strings_column_factories.cuh | 5 +- cpp/include/cudf/strings/detail/utilities.hpp | 5 +- cpp/include/cudf/strings/extract.hpp | 11 +- cpp/include/cudf/strings/find.hpp | 49 ++--- cpp/include/cudf/strings/find_multiple.hpp | 7 +- cpp/include/cudf/strings/findall.hpp | 7 +- cpp/include/cudf/strings/padding.hpp | 15 +- cpp/include/cudf/strings/repeat_strings.hpp | 15 +- cpp/include/cudf/strings/replace.hpp | 23 +-- cpp/include/cudf/strings/replace_re.hpp | 15 +- cpp/include/cudf/strings/reverse.hpp | 7 +- cpp/include/cudf/strings/slice.hpp | 9 +- cpp/include/cudf/strings/split/partition.hpp | 15 +- cpp/include/cudf/strings/split/split.hpp | 35 ++-- cpp/include/cudf/strings/split/split_re.hpp | 27 +-- cpp/include/cudf/strings/strip.hpp | 11 +- cpp/include/cudf/strings/translate.hpp | 15 +- cpp/include/cudf/strings/wrap.hpp | 7 +- .../cudf/structs/detail/concatenate.hpp | 6 +- cpp/include/cudf/structs/detail/scan.hpp | 5 +- cpp/include/cudf/table/table.hpp | 11 +- cpp/include/cudf/timezone.hpp | 5 +- cpp/include/cudf/transform.hpp | 20 +- cpp/include/cudf/transpose.hpp | 5 +- cpp/include/cudf/unary.hpp | 25 +-- cpp/include/cudf_test/base_fixture.hpp | 9 +- cpp/include/nvtext/byte_pair_encoding.hpp | 18 +- cpp/include/nvtext/detail/generate_ngrams.hpp | 7 +- cpp/include/nvtext/detail/load_hash_file.hpp | 3 +- cpp/include/nvtext/detail/tokenize.hpp | 19 +- cpp/include/nvtext/edit_distance.hpp | 12 +- cpp/include/nvtext/generate_ngrams.hpp | 18 +- cpp/include/nvtext/jaccard.hpp | 8 +- cpp/include/nvtext/minhash.hpp | 20 +- cpp/include/nvtext/ngrams_tokenize.hpp | 8 +- cpp/include/nvtext/normalize.hpp | 12 +- cpp/include/nvtext/replace.hpp | 8 +- cpp/include/nvtext/stemmer.hpp | 16 +- cpp/include/nvtext/subword_tokenize.hpp | 8 +- cpp/include/nvtext/tokenize.hpp | 36 ++-- cpp/src/binaryop/binaryop.cpp | 29 +-- cpp/src/binaryop/compiled/binary_ops.cu | 19 +- cpp/src/binaryop/compiled/binary_ops.hpp | 15 +- cpp/src/bitmask/null_mask.cu | 25 +-- cpp/src/column/column.cu | 9 +- cpp/src/column/column_factories.cpp | 16 +- cpp/src/column/column_factories.cu | 16 +- cpp/src/copying/concatenate.cu | 19 +- cpp/src/copying/contiguous_split.cu | 49 ++--- cpp/src/copying/copy.cpp | 7 +- cpp/src/copying/copy.cu | 39 ++-- cpp/src/copying/copy_range.cu | 11 +- cpp/src/copying/gather.cu | 7 +- cpp/src/copying/get_element.cu | 17 +- cpp/src/copying/pack.cpp | 7 +- cpp/src/copying/purge_nonempty_nulls.cu | 8 +- cpp/src/copying/reverse.cu | 9 +- cpp/src/copying/sample.cu | 5 +- cpp/src/copying/scatter.cu | 37 ++-- cpp/src/copying/segmented_shift.cu | 11 +- cpp/src/copying/shift.cu | 11 +- cpp/src/datetime/datetime_ops.cu | 89 +++++---- cpp/src/datetime/timezone.cpp | 6 +- cpp/src/dictionary/add_keys.cu | 7 +- cpp/src/dictionary/decode.cu | 7 +- cpp/src/dictionary/detail/concatenate.cu | 5 +- cpp/src/dictionary/detail/merge.cu | 5 +- cpp/src/dictionary/dictionary_factories.cu | 11 +- cpp/src/dictionary/encode.cu | 7 +- cpp/src/dictionary/remove_keys.cu | 13 +- cpp/src/dictionary/replace.cu | 13 +- cpp/src/dictionary/search.cu | 19 +- cpp/src/dictionary/set_keys.cu | 15 +- cpp/src/filling/calendrical_month_sequence.cu | 7 +- cpp/src/filling/fill.cu | 13 +- cpp/src/filling/repeat.cu | 9 +- cpp/src/filling/sequence.cu | 15 +- cpp/src/groupby/common/utils.hpp | 6 +- cpp/src/groupby/groupby.cu | 17 +- cpp/src/groupby/hash/groupby.cu | 11 +- cpp/src/groupby/sort/aggregate.cpp | 3 +- cpp/src/groupby/sort/functors.hpp | 9 +- cpp/src/groupby/sort/group_argmax.cu | 3 +- cpp/src/groupby/sort/group_argmin.cu | 3 +- cpp/src/groupby/sort/group_collect.cu | 7 +- cpp/src/groupby/sort/group_correlation.cu | 5 +- cpp/src/groupby/sort/group_count.cu | 5 +- cpp/src/groupby/sort/group_count_scan.cu | 3 +- cpp/src/groupby/sort/group_histogram.cu | 7 +- cpp/src/groupby/sort/group_m2.cu | 7 +- cpp/src/groupby/sort/group_max.cu | 3 +- cpp/src/groupby/sort/group_max_scan.cu | 3 +- cpp/src/groupby/sort/group_merge_lists.cu | 5 +- cpp/src/groupby/sort/group_merge_m2.cu | 5 +- cpp/src/groupby/sort/group_min.cu | 3 +- cpp/src/groupby/sort/group_min_scan.cu | 3 +- cpp/src/groupby/sort/group_nth_element.cu | 3 +- cpp/src/groupby/sort/group_nunique.cu | 5 +- cpp/src/groupby/sort/group_product.cu | 3 +- cpp/src/groupby/sort/group_product_scan.cu | 3 +- cpp/src/groupby/sort/group_quantiles.cu | 5 +- cpp/src/groupby/sort/group_rank_scan.cu | 17 +- cpp/src/groupby/sort/group_reductions.hpp | 43 ++--- cpp/src/groupby/sort/group_replace_nulls.cu | 5 +- cpp/src/groupby/sort/group_scan.hpp | 29 +-- cpp/src/groupby/sort/group_scan_util.cuh | 9 +- .../sort/group_single_pass_reduction_util.cuh | 7 +- cpp/src/groupby/sort/group_std.cu | 7 +- cpp/src/groupby/sort/group_sum.cu | 3 +- cpp/src/groupby/sort/group_sum_scan.cu | 3 +- cpp/src/groupby/sort/scan.cpp | 3 +- cpp/src/groupby/sort/sort_helper.cu | 9 +- cpp/src/hash/md5_hash.cu | 5 +- cpp/src/hash/murmurhash3_x64_128.cu | 7 +- cpp/src/hash/murmurhash3_x86_32.cu | 7 +- cpp/src/hash/sha1_hash.cu | 5 +- cpp/src/hash/sha224_hash.cu | 5 +- cpp/src/hash/sha256_hash.cu | 5 +- cpp/src/hash/sha384_hash.cu | 5 +- cpp/src/hash/sha512_hash.cu | 5 +- cpp/src/hash/sha_hash.cuh | 3 +- cpp/src/hash/xxhash_64.cu | 7 +- cpp/src/interop/dlpack.cpp | 9 +- cpp/src/interop/from_arrow.cu | 40 ++-- cpp/src/interop/to_arrow_device.cu | 34 ++-- cpp/src/io/avro/reader_impl.cu | 5 +- cpp/src/io/csv/durations.cu | 7 +- cpp/src/io/csv/durations.hpp | 5 +- cpp/src/io/csv/reader_impl.cu | 7 +- cpp/src/io/csv/writer_impl.cu | 11 +- cpp/src/io/functions.cpp | 21 ++- cpp/src/io/json/json_column.cu | 7 +- cpp/src/io/json/json_normalization.cu | 5 +- cpp/src/io/json/json_tree.cu | 11 +- cpp/src/io/json/legacy/read_json.hpp | 3 +- cpp/src/io/json/legacy/reader_impl.cu | 5 +- cpp/src/io/json/nested_json.hpp | 12 +- cpp/src/io/json/nested_json_gpu.cu | 9 +- cpp/src/io/json/read_json.cu | 3 +- cpp/src/io/json/read_json.hpp | 3 +- cpp/src/io/json/write_json.cu | 15 +- cpp/src/io/orc/reader_impl.cu | 6 +- cpp/src/io/orc/reader_impl.hpp | 5 +- cpp/src/io/orc/reader_impl_helpers.cpp | 4 +- cpp/src/io/orc/reader_impl_helpers.hpp | 3 +- cpp/src/io/orc/reader_impl_preprocess.cu | 5 +- cpp/src/io/parquet/predicate_pushdown.cpp | 7 +- cpp/src/io/parquet/reader.cpp | 8 +- cpp/src/io/parquet/reader_impl.cpp | 6 +- cpp/src/io/parquet/reader_impl.hpp | 8 +- cpp/src/io/text/multibyte_split.cu | 9 +- cpp/src/io/utilities/column_buffer.cpp | 9 +- cpp/src/io/utilities/column_buffer.hpp | 16 +- cpp/src/io/utilities/data_casting.cu | 5 +- cpp/src/io/utilities/output_builder.cuh | 7 +- cpp/src/io/utilities/string_parsing.hpp | 3 +- cpp/src/join/conditional_join.cu | 23 +-- cpp/src/join/conditional_join.hpp | 7 +- cpp/src/join/cross_join.cu | 7 +- cpp/src/join/distinct_hash_join.cu | 13 +- cpp/src/join/hash_join.cu | 25 +-- cpp/src/join/join.cu | 15 +- cpp/src/join/join_common_utils.cuh | 5 +- cpp/src/join/join_utils.cu | 7 +- cpp/src/join/mixed_join.cu | 15 +- cpp/src/join/mixed_join_semi.cu | 7 +- cpp/src/join/semi_join.cu | 7 +- cpp/src/json/json_path.cu | 5 +- cpp/src/labeling/label_bins.cu | 9 +- .../combine/concatenate_list_elements.cu | 13 +- cpp/src/lists/combine/concatenate_rows.cu | 7 +- cpp/src/lists/contains.cu | 25 +-- cpp/src/lists/copying/concatenate.cu | 7 +- cpp/src/lists/copying/copying.cu | 5 +- cpp/src/lists/copying/gather.cu | 7 +- cpp/src/lists/copying/scatter_helper.cu | 14 +- cpp/src/lists/copying/segmented_gather.cu | 5 +- cpp/src/lists/count_elements.cu | 7 +- cpp/src/lists/explode.cu | 25 +-- cpp/src/lists/extract.cu | 17 +- cpp/src/lists/interleave_columns.cu | 13 +- cpp/src/lists/lists_column_factories.cu | 11 +- cpp/src/lists/reverse.cu | 7 +- cpp/src/lists/segmented_sort.cu | 13 +- cpp/src/lists/sequences.cu | 17 +- cpp/src/lists/set_operations.cu | 17 +- .../stream_compaction/apply_boolean_mask.cu | 7 +- cpp/src/lists/stream_compaction/distinct.cu | 5 +- cpp/src/lists/utilities.cu | 10 +- cpp/src/lists/utilities.hpp | 9 +- cpp/src/merge/merge.cu | 19 +- cpp/src/partitioning/partitioning.cu | 17 +- cpp/src/partitioning/round_robin.cu | 9 +- cpp/src/quantiles/quantile.cu | 9 +- cpp/src/quantiles/quantiles.cu | 7 +- cpp/src/quantiles/tdigest/tdigest.cu | 13 +- .../quantiles/tdigest/tdigest_aggregation.cu | 23 +-- cpp/src/reductions/all.cu | 8 +- cpp/src/reductions/any.cu | 8 +- cpp/src/reductions/collect_ops.cu | 12 +- cpp/src/reductions/compound.cuh | 14 +- cpp/src/reductions/histogram.cu | 10 +- cpp/src/reductions/max.cu | 5 +- cpp/src/reductions/mean.cu | 5 +- cpp/src/reductions/min.cu | 6 +- cpp/src/reductions/minmax.cu | 15 +- cpp/src/reductions/nth_element.cu | 3 +- cpp/src/reductions/product.cu | 5 +- cpp/src/reductions/reductions.cpp | 11 +- cpp/src/reductions/scan/rank_scan.cu | 11 +- cpp/src/reductions/scan/scan.cpp | 8 +- cpp/src/reductions/scan/scan.cuh | 7 +- cpp/src/reductions/scan/scan_exclusive.cu | 5 +- cpp/src/reductions/scan/scan_inclusive.cu | 13 +- cpp/src/reductions/segmented/all.cu | 6 +- cpp/src/reductions/segmented/any.cu | 6 +- cpp/src/reductions/segmented/compound.cuh | 14 +- cpp/src/reductions/segmented/counts.cu | 6 +- cpp/src/reductions/segmented/counts.hpp | 5 +- cpp/src/reductions/segmented/max.cu | 6 +- cpp/src/reductions/segmented/mean.cu | 5 +- cpp/src/reductions/segmented/min.cu | 6 +- cpp/src/reductions/segmented/nunique.cu | 5 +- cpp/src/reductions/segmented/product.cu | 6 +- cpp/src/reductions/segmented/reductions.cpp | 15 +- cpp/src/reductions/segmented/simple.cuh | 31 ++-- cpp/src/reductions/segmented/std.cu | 5 +- cpp/src/reductions/segmented/sum.cu | 6 +- .../reductions/segmented/sum_of_squares.cu | 5 +- .../reductions/segmented/update_validity.cu | 6 +- .../reductions/segmented/update_validity.hpp | 5 +- cpp/src/reductions/segmented/var.cu | 5 +- cpp/src/reductions/simple.cuh | 39 ++-- cpp/src/reductions/std.cu | 5 +- cpp/src/reductions/sum.cu | 5 +- cpp/src/reductions/sum_of_squares.cu | 5 +- cpp/src/reductions/var.cu | 5 +- cpp/src/replace/clamp.cu | 25 +-- cpp/src/replace/nans.cu | 17 +- cpp/src/replace/nulls.cu | 31 ++-- cpp/src/replace/replace.cu | 13 +- cpp/src/reshape/byte_cast.cu | 15 +- cpp/src/reshape/interleave_columns.cu | 15 +- cpp/src/reshape/tile.cu | 7 +- cpp/src/rolling/detail/lead_lag_nested.cuh | 3 +- cpp/src/rolling/detail/nth_element.cuh | 5 +- .../detail/optimized_unbounded_window.cpp | 10 +- .../detail/optimized_unbounded_window.hpp | 5 +- cpp/src/rolling/detail/rolling.cuh | 17 +- cpp/src/rolling/detail/rolling.hpp | 12 +- .../rolling/detail/rolling_collect_list.cu | 5 +- .../rolling/detail/rolling_collect_list.cuh | 7 +- .../rolling/detail/rolling_fixed_window.cu | 4 +- .../rolling/detail/rolling_variable_window.cu | 4 +- cpp/src/rolling/grouped_rolling.cu | 40 ++-- cpp/src/rolling/rolling.cu | 10 +- cpp/src/round/round.cu | 11 +- cpp/src/scalar/scalar.cpp | 73 ++++---- cpp/src/scalar/scalar_factories.cpp | 35 ++-- cpp/src/search/contains_column.cu | 11 +- cpp/src/search/contains_table.cu | 3 +- cpp/src/search/search_ordered.cu | 13 +- cpp/src/sort/rank.cu | 5 +- cpp/src/sort/segmented_sort.cu | 11 +- cpp/src/sort/segmented_sort_impl.cuh | 7 +- cpp/src/sort/sort.cu | 13 +- cpp/src/sort/sort_column.cu | 6 +- cpp/src/sort/sort_column_impl.cuh | 3 +- cpp/src/sort/sort_impl.cuh | 7 +- cpp/src/sort/stable_segmented_sort.cu | 12 +- cpp/src/sort/stable_sort.cu | 13 +- cpp/src/sort/stable_sort_column.cu | 6 +- .../stream_compaction/apply_boolean_mask.cu | 7 +- cpp/src/stream_compaction/distinct.cu | 9 +- cpp/src/stream_compaction/distinct_helpers.cu | 6 +- .../stream_compaction/distinct_helpers.hpp | 5 +- cpp/src/stream_compaction/drop_nans.cu | 9 +- cpp/src/stream_compaction/drop_nulls.cu | 9 +- cpp/src/stream_compaction/stable_distinct.cu | 8 +- cpp/src/stream_compaction/unique.cu | 7 +- cpp/src/strings/attributes.cu | 17 +- cpp/src/strings/capitalize.cu | 15 +- cpp/src/strings/case.cu | 15 +- cpp/src/strings/char_types/char_types.cu | 9 +- cpp/src/strings/combine/concatenate.cu | 9 +- cpp/src/strings/combine/join.cu | 5 +- cpp/src/strings/combine/join_list_elements.cu | 9 +- cpp/src/strings/contains.cu | 15 +- cpp/src/strings/convert/convert_booleans.cu | 9 +- cpp/src/strings/convert/convert_datetime.cu | 15 +- cpp/src/strings/convert/convert_durations.cu | 11 +- .../strings/convert/convert_fixed_point.cu | 25 +-- cpp/src/strings/convert/convert_floats.cu | 17 +- cpp/src/strings/convert/convert_hex.cu | 15 +- cpp/src/strings/convert/convert_integers.cu | 25 +-- cpp/src/strings/convert/convert_ipv4.cu | 13 +- cpp/src/strings/convert/convert_lists.cu | 5 +- cpp/src/strings/convert/convert_urls.cu | 9 +- cpp/src/strings/copying/concatenate.cu | 3 +- cpp/src/strings/copying/copy_range.cu | 3 +- cpp/src/strings/copying/copying.cu | 3 +- cpp/src/strings/copying/shift.cu | 3 +- cpp/src/strings/count_matches.cu | 4 +- cpp/src/strings/count_matches.hpp | 5 +- cpp/src/strings/extract/extract.cu | 5 +- cpp/src/strings/extract/extract_all.cu | 5 +- cpp/src/strings/filling/fill.cu | 3 +- cpp/src/strings/filter_chars.cu | 5 +- cpp/src/strings/like.cu | 13 +- cpp/src/strings/padding.cu | 9 +- cpp/src/strings/regex/utilities.cuh | 3 +- cpp/src/strings/repeat_strings.cu | 15 +- cpp/src/strings/replace/backref_re.cu | 5 +- cpp/src/strings/replace/find_replace.cu | 3 +- cpp/src/strings/replace/multi.cu | 9 +- cpp/src/strings/replace/multi_re.cu | 5 +- cpp/src/strings/replace/replace.cu | 9 +- cpp/src/strings/replace/replace_nulls.cu | 3 +- cpp/src/strings/replace/replace_re.cu | 5 +- cpp/src/strings/replace/replace_slice.cu | 5 +- cpp/src/strings/reverse.cu | 5 +- cpp/src/strings/scan/scan_inclusive.cu | 9 +- cpp/src/strings/search/find.cu | 45 ++--- cpp/src/strings/search/find_multiple.cu | 7 +- cpp/src/strings/search/findall.cu | 7 +- cpp/src/strings/slice.cu | 11 +- cpp/src/strings/split/partition.cu | 11 +- cpp/src/strings/split/split.cu | 15 +- cpp/src/strings/split/split.cuh | 5 +- cpp/src/strings/split/split_re.cu | 21 ++- cpp/src/strings/split/split_record.cu | 11 +- cpp/src/strings/strings_column_factories.cu | 5 +- cpp/src/strings/strings_scalar_factories.cpp | 5 +- cpp/src/strings/strip.cu | 7 +- cpp/src/strings/translate.cu | 5 +- cpp/src/strings/utilities.cu | 5 +- cpp/src/strings/wrap.cu | 5 +- cpp/src/structs/copying/concatenate.cu | 5 +- cpp/src/structs/scan/scan_inclusive.cu | 7 +- cpp/src/structs/structs_column_factories.cu | 3 +- cpp/src/structs/utilities.cpp | 18 +- cpp/src/table/row_operators.cu | 9 +- cpp/src/table/table.cpp | 7 +- cpp/src/text/bpe/byte_pair_encoding.cu | 5 +- cpp/src/text/bpe/load_merge_pairs.cu | 11 +- cpp/src/text/detokenize.cu | 5 +- cpp/src/text/edit_distance.cu | 9 +- cpp/src/text/generate_ngrams.cu | 13 +- cpp/src/text/jaccard.cu | 5 +- cpp/src/text/minhash.cu | 21 ++- cpp/src/text/ngrams_tokenize.cu | 5 +- cpp/src/text/normalize.cu | 9 +- cpp/src/text/replace.cu | 9 +- cpp/src/text/stemmer.cu | 15 +- cpp/src/text/subword/load_hash_file.cu | 5 +- cpp/src/text/subword/subword_tokenize.cu | 7 +- cpp/src/text/tokenize.cu | 25 +-- cpp/src/text/vocabulary_tokenize.cu | 9 +- cpp/src/transform/bools_to_mask.cu | 7 +- cpp/src/transform/compute_column.cu | 5 +- cpp/src/transform/encode.cu | 10 +- cpp/src/transform/mask_to_bools.cu | 5 +- cpp/src/transform/nans_to_nulls.cu | 11 +- cpp/src/transform/one_hot_encode.cu | 5 +- cpp/src/transform/row_bit_count.cu | 9 +- cpp/src/transform/transform.cpp | 5 +- cpp/src/transpose/transpose.cu | 7 +- cpp/src/unary/cast_ops.cu | 21 ++- cpp/src/unary/math_ops.cu | 33 ++-- cpp/src/unary/nan_ops.cu | 15 +- cpp/src/unary/null_ops.cu | 12 +- cpp/src/unary/unary_ops.cuh | 5 +- cpp/tests/copying/shift_tests.cpp | 9 +- cpp/tests/io/json_chunked_reader.cpp | 4 +- cpp/tests/join/join_tests.cpp | 6 +- cpp/tests/join/semi_anti_join_tests.cpp | 6 +- .../main/native/include/maps_column_view.hpp | 20 +- java/src/main/native/src/RmmJni.cpp | 10 +- java/src/main/native/src/maps_column_view.cu | 23 +-- 539 files changed, 3613 insertions(+), 3012 deletions(-) diff --git a/cpp/benchmarks/copying/shift.cu b/cpp/benchmarks/copying/shift.cu index e1169e3bcd6..efc385cf10b 100644 --- a/cpp/benchmarks/copying/shift.cu +++ b/cpp/benchmarks/copying/shift.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,13 @@ #include #include +#include + template > std::unique_ptr make_scalar( - T value = 0, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + T value = 0, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { auto s = new ScalarType(value, true, stream, mr); return std::unique_ptr(s); diff --git a/cpp/benchmarks/fixture/benchmark_fixture.hpp b/cpp/benchmarks/fixture/benchmark_fixture.hpp index adde0ae1720..8c8d6756b00 100644 --- a/cpp/benchmarks/fixture/benchmark_fixture.hpp +++ b/cpp/benchmarks/fixture/benchmark_fixture.hpp @@ -120,6 +120,7 @@ class memory_stats_logger { } private: + // TODO change to resource_ref once set_current_device_resource supports it rmm::mr::device_memory_resource* existing_mr; rmm::mr::statistics_resource_adaptor statistics_mr; }; diff --git a/cpp/include/cudf/ast/detail/expression_parser.hpp b/cpp/include/cudf/ast/detail/expression_parser.hpp index a36a831a7aa..38f7ac5291f 100644 --- a/cpp/include/cudf/ast/detail/expression_parser.hpp +++ b/cpp/include/cudf/ast/detail/expression_parser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,8 @@ #include #include +#include + #include #include @@ -118,7 +120,7 @@ class expression_parser { std::optional> right, bool has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : _left{left}, _right{right}, _expression_count{0}, @@ -139,7 +141,7 @@ class expression_parser { cudf::table_view const& table, bool has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : expression_parser(expr, table, {}, has_nulls, stream, mr) { } @@ -240,7 +242,7 @@ class expression_parser { data_pointers.push_back(v.data()); } - void move_to_device(rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + void move_to_device(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { std::vector sizes; std::vector data_pointers; diff --git a/cpp/include/cudf/binaryop.hpp b/cpp/include/cudf/binaryop.hpp index 9df4b4eb00f..20550e92f9f 100644 --- a/cpp/include/cudf/binaryop.hpp +++ b/cpp/include/cudf/binaryop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -116,8 +117,8 @@ std::unique_ptr binary_operation( column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a binary operation between a column and a scalar. @@ -147,8 +148,8 @@ std::unique_ptr binary_operation( scalar const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a binary operation between two columns. @@ -177,8 +178,8 @@ std::unique_ptr binary_operation( column_view const& rhs, binary_operator op, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a binary operation between two columns using a @@ -208,8 +209,8 @@ std::unique_ptr binary_operation( column_view const& rhs, std::string const& ptx, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the `scale` for a `fixed_point` number based on given binary operator `op` @@ -249,8 +250,8 @@ namespace binops { std::pair scalar_col_valid_mask_and( column_view const& col, scalar const& s, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); namespace compiled { namespace detail { diff --git a/cpp/include/cudf/column/column.hpp b/cpp/include/cudf/column/column.hpp index 023e58c5300..22db25bdc83 100644 --- a/cpp/include/cudf/column/column.hpp +++ b/cpp/include/cudf/column/column.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -63,8 +64,8 @@ class column { * @param mr Device memory resource to use for all device memory allocations */ column(column const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Move the contents from `other` to create a new column. @@ -141,8 +142,8 @@ class column { * @param mr Device memory resource to use for all device memory allocations */ explicit column(column_view view, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the column's logical element type diff --git a/cpp/include/cudf/column/column_factories.hpp b/cpp/include/cudf/column/column_factories.hpp index 96322159f0f..dc4700576e6 100644 --- a/cpp/include/cudf/column/column_factories.hpp +++ b/cpp/include/cudf/column/column_factories.hpp @@ -23,6 +23,7 @@ #include #include +#include #include @@ -75,9 +76,9 @@ std::unique_ptr make_empty_column(type_id id); std::unique_ptr make_numeric_column( data_type type, size_type size, - mask_state state = mask_state::UNALLOCATED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_state state = mask_state::UNALLOCATED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct column with sufficient uninitialized storage to hold `size` elements of the @@ -102,8 +103,8 @@ std::unique_ptr make_numeric_column( size_type size, B&& null_mask, size_type null_count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { CUDF_EXPECTS(is_numeric(type), "Invalid, non-numeric type."); return std::make_unique(type, @@ -133,9 +134,9 @@ std::unique_ptr make_numeric_column( std::unique_ptr make_fixed_point_column( data_type type, size_type size, - mask_state state = mask_state::UNALLOCATED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_state state = mask_state::UNALLOCATED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct column with sufficient uninitialized storage to hold `size` elements of the @@ -159,8 +160,8 @@ std::unique_ptr make_fixed_point_column( size_type size, B&& null_mask, size_type null_count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { CUDF_EXPECTS(is_fixed_point(type), "Invalid, non-fixed_point type."); return std::make_unique(type, @@ -191,9 +192,9 @@ std::unique_ptr make_fixed_point_column( std::unique_ptr make_timestamp_column( data_type type, size_type size, - mask_state state = mask_state::UNALLOCATED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_state state = mask_state::UNALLOCATED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct column with sufficient uninitialized storage to hold `size` elements of the @@ -218,8 +219,8 @@ std::unique_ptr make_timestamp_column( size_type size, B&& null_mask, size_type null_count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { CUDF_EXPECTS(is_timestamp(type), "Invalid, non-timestamp type."); return std::make_unique(type, @@ -250,9 +251,9 @@ std::unique_ptr make_timestamp_column( std::unique_ptr make_duration_column( data_type type, size_type size, - mask_state state = mask_state::UNALLOCATED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_state state = mask_state::UNALLOCATED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct column with sufficient uninitialized storage to hold `size` elements of the @@ -277,8 +278,8 @@ std::unique_ptr make_duration_column( size_type size, B&& null_mask, size_type null_count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { CUDF_EXPECTS(is_duration(type), "Invalid, non-duration type."); return std::make_unique(type, @@ -309,9 +310,9 @@ std::unique_ptr make_duration_column( std::unique_ptr make_fixed_width_column( data_type type, size_type size, - mask_state state = mask_state::UNALLOCATED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_state state = mask_state::UNALLOCATED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct column with sufficient uninitialized storage to hold `size` elements of the @@ -336,8 +337,8 @@ std::unique_ptr make_fixed_width_column( size_type size, B&& null_mask, size_type null_count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { CUDF_EXPECTS(is_fixed_width(type), "Invalid, non-fixed-width type."); if (is_timestamp(type)) { @@ -375,8 +376,8 @@ std::unique_ptr make_fixed_width_column( */ std::unique_ptr make_strings_column( cudf::device_span const> strings, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a STRING type column given a device span of string_view. @@ -407,8 +408,8 @@ std::unique_ptr make_strings_column( std::unique_ptr make_strings_column( cudf::device_span string_views, string_view const null_placeholder, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a STRING type column given offsets column, chars columns, and null mask and null @@ -495,8 +496,8 @@ std::unique_ptr make_lists_column( std::unique_ptr child_column, size_type null_count, rmm::device_buffer&& null_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a STRUCT column using specified child columns as members. @@ -526,8 +527,8 @@ std::unique_ptr make_structs_column( std::vector>&& child_columns, size_type null_count, rmm::device_buffer&& null_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a column with size elements that are all equal to the given scalar. @@ -546,8 +547,8 @@ std::unique_ptr make_structs_column( std::unique_ptr make_column_from_scalar( scalar const& s, size_type size, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a dictionary column with size elements that are all equal to the given scalar. @@ -566,8 +567,8 @@ std::unique_ptr make_column_from_scalar( std::unique_ptr make_dictionary_from_scalar( scalar const& s, size_type size, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/concatenate.hpp b/cpp/include/cudf/concatenate.hpp index 9ee55275a5e..e7b55a2e6d0 100644 --- a/cpp/include/cudf/concatenate.hpp +++ b/cpp/include/cudf/concatenate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -46,8 +47,8 @@ namespace cudf { */ rmm::device_buffer concatenate_masks( host_span views, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Concatenates multiple columns into a single column @@ -63,8 +64,8 @@ rmm::device_buffer concatenate_masks( */ std::unique_ptr concatenate( host_span columns_to_concat, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Columns of `tables_to_concat` are concatenated vertically to return a @@ -92,8 +93,8 @@ std::unique_ptr concatenate( */ std::unique_ptr concatenate( host_span tables_to_concat, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/contiguous_split.hpp b/cpp/include/cudf/contiguous_split.hpp index 1bbbf73bd5d..0d4f20d1ef2 100644 --- a/cpp/include/cudf/contiguous_split.hpp +++ b/cpp/include/cudf/contiguous_split.hpp @@ -19,6 +19,8 @@ #include #include +#include + #include #include @@ -119,7 +121,7 @@ struct packed_table { std::vector contiguous_split( cudf::table_view const& input, std::vector const& splits, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); namespace detail { struct contiguous_split_state; @@ -196,7 +198,7 @@ class chunked_pack { explicit chunked_pack( cudf::table_view const& input, std::size_t user_buffer_size, - rmm::mr::device_memory_resource* temp_mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref temp_mr = rmm::mr::get_current_device_resource()); /** * @brief Destructor that will be implemented as default. Declared with definition here because @@ -261,7 +263,7 @@ class chunked_pack { [[nodiscard]] static std::unique_ptr create( cudf::table_view const& input, std::size_t user_buffer_size, - rmm::mr::device_memory_resource* temp_mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref temp_mr = rmm::mr::get_current_device_resource()); private: // internal state of contiguous split @@ -281,7 +283,7 @@ class chunked_pack { * and device memory respectively */ packed_columns pack(cudf::table_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Produce the metadata used for packing a table stored in a contiguous buffer. diff --git a/cpp/include/cudf/copying.hpp b/cpp/include/cudf/copying.hpp index df96efdaffc..b17cafb05ab 100644 --- a/cpp/include/cudf/copying.hpp +++ b/cpp/include/cudf/copying.hpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -84,9 +85,9 @@ enum class out_of_bounds_policy : bool { std::unique_ptr
gather( table_view const& source_table, column_view const& gather_map, - out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Reverses the rows within a table. @@ -105,8 +106,8 @@ std::unique_ptr
gather( */ std::unique_ptr
reverse( table_view const& source_table, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Reverses the elements of a column @@ -125,8 +126,8 @@ std::unique_ptr
reverse( */ std::unique_ptr reverse( column_view const& source_column, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Scatters the rows of the source table into a copy of the target table @@ -174,8 +175,8 @@ std::unique_ptr
scatter( table_view const& source, column_view const& scatter_map, table_view const& target, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Scatters a row of scalar values into a copy of the target table @@ -217,8 +218,8 @@ std::unique_ptr
scatter( std::vector> const& source, column_view const& indices, table_view const& target, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Indicates when to allocate a mask, based on an existing mask. @@ -264,9 +265,9 @@ std::unique_ptr empty_like(scalar const& input); */ std::unique_ptr allocate_like( column_view const& input, - mask_allocation_policy mask_alloc = mask_allocation_policy::RETAIN, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_allocation_policy mask_alloc = mask_allocation_policy::RETAIN, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates an uninitialized new column of the specified size and same type as the `input`. @@ -287,9 +288,9 @@ std::unique_ptr allocate_like( std::unique_ptr allocate_like( column_view const& input, size_type size, - mask_allocation_policy mask_alloc = mask_allocation_policy::RETAIN, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + mask_allocation_policy mask_alloc = mask_allocation_policy::RETAIN, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a table of empty columns with the same types as the `input_table` @@ -380,8 +381,8 @@ std::unique_ptr copy_range( size_type source_begin, size_type source_end, size_type target_begin, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a new column by shifting all values by an offset. @@ -424,8 +425,8 @@ std::unique_ptr shift( column_view const& input, size_type offset, scalar const& fill_value, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Slices a `column_view` into a set of `column_view`s according to a set of indices. @@ -627,8 +628,8 @@ std::unique_ptr copy_if_else( column_view const& lhs, column_view const& rhs, column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new column, where each element is selected from either @p lhs or @@ -653,8 +654,8 @@ std::unique_ptr copy_if_else( scalar const& lhs, column_view const& rhs, column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new column, where each element is selected from either @p lhs or @@ -679,8 +680,8 @@ std::unique_ptr copy_if_else( column_view const& lhs, scalar const& rhs, column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new column, where each element is selected from either @p lhs or @@ -703,8 +704,8 @@ std::unique_ptr copy_if_else( scalar const& lhs, scalar const& rhs, column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Scatters rows from the input table to rows of the output corresponding @@ -747,8 +748,8 @@ std::unique_ptr
boolean_mask_scatter( table_view const& input, table_view const& target, column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Scatters scalar values to rows of the output corresponding @@ -786,8 +787,8 @@ std::unique_ptr
boolean_mask_scatter( std::vector> const& input, table_view const& target, column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Get the element at specified index from a column @@ -806,8 +807,8 @@ std::unique_ptr
boolean_mask_scatter( std::unique_ptr get_element( column_view const& input, size_type index, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Indicates whether a row can be sampled more than once. @@ -851,7 +852,7 @@ std::unique_ptr
sample( sample_with_replacement replacement = sample_with_replacement::FALSE, int64_t const seed = 0, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Checks if a column or its descendants have non-empty null rows @@ -967,8 +968,8 @@ bool may_have_nonempty_nulls(column_view const& input); */ std::unique_ptr purge_nonempty_nulls( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ } // namespace cudf diff --git a/cpp/include/cudf/datetime.hpp b/cpp/include/cudf/datetime.hpp index 44736ca0762..06b7d24f6cd 100644 --- a/cpp/include/cudf/datetime.hpp +++ b/cpp/include/cudf/datetime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include @@ -47,7 +48,7 @@ namespace datetime { */ std::unique_ptr extract_year( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts month from any datetime type and returns an int16_t @@ -61,7 +62,7 @@ std::unique_ptr extract_year( */ std::unique_ptr extract_month( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts day from any datetime type and returns an int16_t @@ -75,7 +76,7 @@ std::unique_ptr extract_month( */ std::unique_ptr extract_day( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts a weekday from any datetime type and returns an int16_t @@ -89,7 +90,7 @@ std::unique_ptr extract_day( */ std::unique_ptr extract_weekday( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts hour from any datetime type and returns an int16_t @@ -103,7 +104,7 @@ std::unique_ptr extract_weekday( */ std::unique_ptr extract_hour( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts minute from any datetime type and returns an int16_t @@ -117,7 +118,7 @@ std::unique_ptr extract_hour( */ std::unique_ptr extract_minute( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts second from any datetime type and returns an int16_t @@ -131,7 +132,7 @@ std::unique_ptr extract_minute( */ std::unique_ptr extract_second( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts millisecond fraction from any datetime type and returns an int16_t @@ -148,7 +149,7 @@ std::unique_ptr extract_second( */ std::unique_ptr extract_millisecond_fraction( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts microsecond fraction from any datetime type and returns an int16_t @@ -165,7 +166,7 @@ std::unique_ptr extract_millisecond_fraction( */ std::unique_ptr extract_microsecond_fraction( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extracts nanosecond fraction from any datetime type and returns an int16_t @@ -182,7 +183,7 @@ std::unique_ptr extract_microsecond_fraction( */ std::unique_ptr extract_nanosecond_fraction( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group /** @@ -203,7 +204,7 @@ std::unique_ptr extract_nanosecond_fraction( */ std::unique_ptr last_day_of_month( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the day number since the start of the year from the datetime and @@ -217,7 +218,7 @@ std::unique_ptr last_day_of_month( */ std::unique_ptr day_of_year( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Adds or subtracts a number of months from the datetime type and returns a @@ -252,7 +253,7 @@ std::unique_ptr day_of_year( std::unique_ptr add_calendrical_months( cudf::column_view const& timestamps, cudf::column_view const& months, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Adds or subtracts a number of months from the datetime type and returns a @@ -287,7 +288,7 @@ std::unique_ptr add_calendrical_months( std::unique_ptr add_calendrical_months( cudf::column_view const& timestamps, cudf::scalar const& months, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Check if the year of the given date is a leap year @@ -304,7 +305,7 @@ std::unique_ptr add_calendrical_months( */ std::unique_ptr is_leap_year( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Extract the number of days in the month @@ -320,7 +321,7 @@ std::unique_ptr is_leap_year( */ std::unique_ptr days_in_month( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the quarter of the date @@ -336,7 +337,7 @@ std::unique_ptr days_in_month( */ std::unique_ptr extract_quarter( cudf::column_view const& column, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Fixed frequencies supported by datetime rounding functions ceil, floor, round. @@ -365,7 +366,7 @@ enum class rounding_frequency : int32_t { std::unique_ptr ceil_datetimes( cudf::column_view const& column, rounding_frequency freq, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Round datetimes down to the nearest multiple of the given frequency. @@ -380,7 +381,7 @@ std::unique_ptr ceil_datetimes( std::unique_ptr floor_datetimes( cudf::column_view const& column, rounding_frequency freq, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Round datetimes to the nearest multiple of the given frequency. @@ -395,7 +396,7 @@ std::unique_ptr floor_datetimes( std::unique_ptr round_datetimes( cudf::column_view const& column, rounding_frequency freq, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group diff --git a/cpp/include/cudf/detail/binaryop.hpp b/cpp/include/cudf/detail/binaryop.hpp index e5609568d10..de1fde8bc96 100644 --- a/cpp/include/cudf/detail/binaryop.hpp +++ b/cpp/include/cudf/detail/binaryop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { //! Inner interfaces and implementations @@ -26,7 +27,7 @@ namespace detail { /** * @copydoc cudf::binary_operation(column_view const&, column_view const&, - * std::string const&, data_type, rmm::mr::device_memory_resource *) + * std::string const&, data_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -35,11 +36,11 @@ std::unique_ptr binary_operation(column_view const& lhs, std::string const& ptx, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::binary_operation(scalar const&, column_view const&, binary_operator, - * data_type, rmm::mr::device_memory_resource *) + * data_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -48,11 +49,11 @@ std::unique_ptr binary_operation(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::binary_operation(column_view const&, scalar const&, binary_operator, - * data_type, rmm::mr::device_memory_resource *) + * data_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -61,11 +62,11 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::binary_operation(column_view const&, column_view const&, - * binary_operator, data_type, rmm::mr::device_memory_resource *) + * binary_operator, data_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -74,6 +75,6 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/calendrical_month_sequence.cuh b/cpp/include/cudf/detail/calendrical_month_sequence.cuh index 59fb6758973..a9cf54e29b8 100644 --- a/cpp/include/cudf/detail/calendrical_month_sequence.cuh +++ b/cpp/include/cudf/detail/calendrical_month_sequence.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -38,7 +39,7 @@ struct calendrical_month_sequence_functor { scalar const& input, size_type months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Return empty column if n = 0 if (n == 0) return cudf::make_empty_column(input.type()); diff --git a/cpp/include/cudf/detail/concatenate.hpp b/cpp/include/cudf/detail/concatenate.hpp index 442814bc4fd..3e039175542 100644 --- a/cpp/include/cudf/detail/concatenate.hpp +++ b/cpp/include/cudf/detail/concatenate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -29,22 +30,22 @@ namespace cudf { //! Inner interfaces and implementations namespace detail { /** - * @copydoc cudf::concatenate(host_span,rmm::mr::device_memory_resource*) + * @copydoc cudf::concatenate(host_span,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr concatenate(host_span columns_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::concatenate(host_span,rmm::mr::device_memory_resource*) + * @copydoc cudf::concatenate(host_span,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr
concatenate(host_span tables_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/concatenate_masks.hpp b/cpp/include/cudf/detail/concatenate_masks.hpp index e7086ea17a5..dd2fb471a7d 100644 --- a/cpp/include/cudf/detail/concatenate_masks.hpp +++ b/cpp/include/cudf/detail/concatenate_masks.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include #include +#include namespace cudf { //! Inner interfaces and implementations @@ -59,13 +60,13 @@ size_type concatenate_masks(host_span views, rmm::cuda_stream_view stream); /** - * @copydoc cudf::concatenate_masks(host_span, rmm::mr::device_memory_resource*) + * @copydoc cudf::concatenate_masks(host_span, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ rmm::device_buffer concatenate_masks(host_span views, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/contiguous_split.hpp b/cpp/include/cudf/detail/contiguous_split.hpp index d9a35470b7d..de00b61cdca 100644 --- a/cpp/include/cudf/detail/contiguous_split.hpp +++ b/cpp/include/cudf/detail/contiguous_split.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -33,7 +34,7 @@ namespace detail { std::vector contiguous_split(cudf::table_view const& input, std::vector const& splits, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::pack @@ -42,7 +43,7 @@ std::vector contiguous_split(cudf::table_view const& input, **/ packed_columns pack(cudf::table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); // opaque implementation of `metadata_builder` since it needs to use // `serialized_column`, which is only defined in pack.cpp diff --git a/cpp/include/cudf/detail/copy.hpp b/cpp/include/cudf/detail/copy.hpp index 115822163c3..f7430eb090d 100644 --- a/cpp/include/cudf/detail/copy.hpp +++ b/cpp/include/cudf/detail/copy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ #include #include +#include #include @@ -123,7 +124,7 @@ std::vector split(table_view const& input, /** * @copydoc cudf::shift(column_view const&,size_type,scalar const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -131,7 +132,7 @@ std::unique_ptr shift(column_view const& input, size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Performs segmented shifts for specified values. @@ -171,11 +172,11 @@ std::unique_ptr segmented_shift(column_view const& segmented_values, size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::allocate_like(column_view const&, size_type, mask_allocation_policy, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -183,11 +184,11 @@ std::unique_ptr allocate_like(column_view const& input, size_type size, mask_allocation_policy mask_alloc, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::copy_if_else( column_view const&, column_view const&, - * column_view const&, rmm::mr::device_memory_resource*) + * column_view const&, rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -195,11 +196,11 @@ std::unique_ptr copy_if_else(column_view const& lhs, column_view const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::copy_if_else( scalar const&, column_view const&, - * column_view const&, rmm::mr::device_memory_resource*) + * column_view const&, rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -207,11 +208,11 @@ std::unique_ptr copy_if_else(scalar const& lhs, column_view const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::copy_if_else( column_view const&, scalar const&, - * column_view const&, rmm::mr::device_memory_resource*) + * column_view const&, rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -219,11 +220,11 @@ std::unique_ptr copy_if_else(column_view const& lhs, scalar const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::copy_if_else( scalar const&, scalar const&, - * column_view const&, rmm::mr::device_memory_resource*) + * column_view const&, rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -231,7 +232,7 @@ std::unique_ptr copy_if_else(scalar const& lhs, scalar const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::sample @@ -243,7 +244,7 @@ std::unique_ptr
sample(table_view const& input, sample_with_replacement replacement, int64_t const seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::get_element @@ -253,7 +254,7 @@ std::unique_ptr
sample(table_view const& input, std::unique_ptr get_element(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::has_nonempty_nulls @@ -276,7 +277,7 @@ bool may_have_nonempty_nulls(column_view const& input, rmm::cuda_stream_view str */ std::unique_ptr purge_nonempty_nulls(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/copy_if.cuh b/cpp/include/cudf/detail/copy_if.cuh index 3af050a5da6..c98057d077a 100644 --- a/cpp/include/cudf/detail/copy_if.cuh +++ b/cpp/include/cudf/detail/copy_if.cuh @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -239,7 +240,7 @@ struct scatter_gather_functor { Filter filter, cudf::size_type per_thread, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output_column = cudf::detail::allocate_like( input, output_size, cudf::mask_allocation_policy::RETAIN, stream, mr); @@ -286,7 +287,7 @@ struct scatter_gather_functor { Filter filter, cudf::size_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { rmm::device_uvector indices(output_size, stream); @@ -325,7 +326,7 @@ template std::unique_ptr
copy_if(table_view const& input, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/include/cudf/detail/copy_if_else.cuh b/cpp/include/cudf/detail/copy_if_else.cuh index 6162fa5ecf1..ac5cb0ad141 100644 --- a/cpp/include/cudf/detail/copy_if_else.cuh +++ b/cpp/include/cudf/detail/copy_if_else.cuh @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -152,7 +153,7 @@ std::unique_ptr copy_if_else(bool nullable, FilterFn filter, cudf::data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // This is the type of the thrust::optional element in the passed iterators using Element = typename thrust::iterator_traits::value_type::value_type; diff --git a/cpp/include/cudf/detail/copy_range.cuh b/cpp/include/cudf/detail/copy_range.cuh index 9f8b0f8b619..1b3b2056c6c 100644 --- a/cpp/include/cudf/detail/copy_range.cuh +++ b/cpp/include/cudf/detail/copy_range.cuh @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -203,7 +204,7 @@ std::unique_ptr copy_range(column_view const& source, size_type source_end, size_type target_begin, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/datetime.hpp b/cpp/include/cudf/detail/datetime.hpp index c5160958165..a93c06d4371 100644 --- a/cpp/include/cudf/detail/datetime.hpp +++ b/cpp/include/cudf/detail/datetime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,156 +19,158 @@ #include #include +#include + #include namespace cudf { namespace datetime { namespace detail { /** - * @copydoc cudf::extract_year(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_year(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_year(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::extract_month(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_month(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_month(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::extract_day(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_day(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_day(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::extract_weekday(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_weekday(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_weekday(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::extract_hour(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_hour(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_hour(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::extract_minute(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_minute(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_minute(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::extract_second(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::extract_second(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_second(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::extract_millisecond_fraction(cudf::column_view const&, - * rmm::mr::device_memory_resource *) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_millisecond_fraction(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::extract_microsecond_fraction(cudf::column_view const&, - * rmm::mr::device_memory_resource *) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_microsecond_fraction(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::extract_nanosecond_fraction(cudf::column_view const&, - * rmm::mr::device_memory_resource *) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_nanosecond_fraction(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::last_day_of_month(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::last_day_of_month(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr last_day_of_month(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::day_of_year(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::day_of_year(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr day_of_year(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::add_calendrical_months(cudf::column_view const&, cudf::column_view const&, - * rmm::mr::device_memory_resource *) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr add_calendrical_months(cudf::column_view const& timestamps, cudf::column_view const& months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::add_calendrical_months(cudf::column_view const&, cudf::scalar const&, - * rmm::mr::device_memory_resource *) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr add_calendrical_months(cudf::column_view const& timestamps, cudf::scalar const& months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::is_leap_year(cudf::column_view const&, rmm::mr::device_memory_resource *) + * @copydoc cudf::is_leap_year(cudf::column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr is_leap_year(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr extract_quarter(cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace datetime diff --git a/cpp/include/cudf/detail/distinct_hash_join.cuh b/cpp/include/cudf/detail/distinct_hash_join.cuh index e874151ed36..93d52d5dda3 100644 --- a/cpp/include/cudf/detail/distinct_hash_join.cuh +++ b/cpp/include/cudf/detail/distinct_hash_join.cuh @@ -21,6 +21,7 @@ #include #include +#include #include @@ -148,12 +149,12 @@ struct distinct_hash_join { */ std::pair>, std::unique_ptr>> - inner_join(rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const; + inner_join(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::distinct_hash_join::left_join */ std::unique_ptr> left_join( - rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const; + rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const; }; } // namespace cudf::detail diff --git a/cpp/include/cudf/detail/fill.hpp b/cpp/include/cudf/detail/fill.hpp index caaccfb4851..6996cda6974 100644 --- a/cpp/include/cudf/detail/fill.hpp +++ b/cpp/include/cudf/detail/fill.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -48,7 +49,7 @@ std::unique_ptr fill(column_view const& input, size_type end, scalar const& value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/gather.cuh b/cpp/include/cudf/detail/gather.cuh index 6492aa23e80..c9d350ce983 100644 --- a/cpp/include/cudf/detail/gather.cuh +++ b/cpp/include/cudf/detail/gather.cuh @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -174,7 +175,7 @@ struct column_gatherer { MapIterator gather_map_end, bool nullify_out_of_bounds, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { column_gatherer_impl gatherer{}; @@ -214,7 +215,7 @@ struct column_gatherer_impl { MapItType gather_map_end, bool nullify_out_of_bounds, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (true == nullify_out_of_bounds) { return cudf::strings::detail::gather( @@ -334,7 +335,7 @@ struct column_gatherer_impl { MapItRoot gather_map_end, bool nullify_out_of_bounds, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { lists_column_view list(column); auto gather_map_size = std::distance(gather_map_begin, gather_map_end); @@ -397,7 +398,7 @@ struct column_gatherer_impl { MapItType gather_map_end, bool nullify_out_of_bounds, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { dictionary_column_view dictionary(source_column); auto output_count = std::distance(gather_map_begin, gather_map_end); @@ -448,7 +449,7 @@ struct column_gatherer_impl { MapItRoot gather_map_end, bool nullify_out_of_bounds, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const gather_map_size = std::distance(gather_map_begin, gather_map_end); if (gather_map_size == 0) { return empty_like(column); } @@ -554,7 +555,7 @@ void gather_bitmask(table_view const& source, std::vector>& target, gather_bitmask_op op, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (target.empty()) { return; } @@ -652,7 +653,7 @@ std::unique_ptr
gather(table_view const& source_table, MapIterator gather_map_end, out_of_bounds_policy bounds_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector> destination_columns; diff --git a/cpp/include/cudf/detail/gather.hpp b/cpp/include/cudf/detail/gather.hpp index 034eb6c1282..36824f56895 100644 --- a/cpp/include/cudf/detail/gather.hpp +++ b/cpp/include/cudf/detail/gather.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include @@ -66,12 +67,12 @@ std::unique_ptr
gather(table_view const& source_table, out_of_bounds_policy bounds_policy, negative_index_policy neg_indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::detail::gather(table_view const&,column_view const&,table_view * const&,cudf::out_of_bounds_policy,cudf::detail::negative_index_policy,rmm::cuda_stream_view, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @throws cudf::logic_error if `gather_map` span size is larger than max of `size_type`. */ @@ -80,7 +81,7 @@ std::unique_ptr
gather(table_view const& source_table, out_of_bounds_policy bounds_policy, negative_index_policy neg_indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/groupby.hpp b/cpp/include/cudf/detail/groupby.hpp index 0afa69be1a3..5a8c9b0a27f 100644 --- a/cpp/include/cudf/detail/groupby.hpp +++ b/cpp/include/cudf/detail/groupby.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -45,7 +46,7 @@ std::pair, std::vector> groupby( host_span requests, null_policy include_null_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace hash } // namespace detail diff --git a/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp b/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp index e081a626c75..389c7952875 100644 --- a/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp +++ b/cpp/include/cudf/detail/groupby/group_replace_nulls.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace groupby { namespace detail { @@ -40,7 +41,7 @@ std::unique_ptr group_replace_nulls(cudf::column_view const& grouped_val device_span group_labels, cudf::replace_policy replace_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace groupby diff --git a/cpp/include/cudf/detail/groupby/sort_helper.hpp b/cpp/include/cudf/detail/groupby/sort_helper.hpp index 7b386eb5f03..567efedb9b2 100644 --- a/cpp/include/cudf/detail/groupby/sort_helper.hpp +++ b/cpp/include/cudf/detail/groupby/sort_helper.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace groupby { @@ -87,7 +88,7 @@ struct sort_groupby_helper { */ std::unique_ptr sorted_values(column_view const& values, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Groups a column of values according to `keys` @@ -101,7 +102,7 @@ struct sort_groupby_helper { */ std::unique_ptr grouped_values(column_view const& values, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Get a table of sorted unique keys @@ -109,7 +110,7 @@ struct sort_groupby_helper { * @return a new table in which each row is a unique row in the sorted key table. */ std::unique_ptr
unique_keys(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Get a table of sorted keys @@ -117,7 +118,7 @@ struct sort_groupby_helper { * @return a new table containing the sorted keys. */ std::unique_ptr
sorted_keys(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Get the number of groups in `keys` diff --git a/cpp/include/cudf/detail/hash_reduce_by_row.cuh b/cpp/include/cudf/detail/hash_reduce_by_row.cuh index 1df6848c575..dfe79646167 100644 --- a/cpp/include/cudf/detail/hash_reduce_by_row.cuh +++ b/cpp/include/cudf/detail/hash_reduce_by_row.cuh @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -124,7 +125,7 @@ rmm::device_uvector hash_reduce_by_row( ReduceFuncBuilder func_builder, OutputType init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const map_dview = map.get_device_view(); auto const row_hasher = cudf::experimental::row::hash::row_hasher(preprocessed_input); diff --git a/cpp/include/cudf/detail/interop.hpp b/cpp/include/cudf/detail/interop.hpp index 296b68d22a9..5b2b9b5e69d 100644 --- a/cpp/include/cudf/detail/interop.hpp +++ b/cpp/include/cudf/detail/interop.hpp @@ -23,6 +23,8 @@ #pragma nv_diag_suppress 611 #pragma nv_diag_suppress 2810 #endif +#include + #include #ifdef __CUDACC__ #pragma nv_diag_default 611 @@ -47,7 +49,7 @@ namespace detail { */ std::unique_ptr
from_dlpack(DLManagedTensor const* managed_tensor, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::to_dlpack @@ -56,7 +58,7 @@ std::unique_ptr
from_dlpack(DLManagedTensor const* managed_tensor, */ DLManagedTensor* to_dlpack(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); // Creating arrow as per given type_id and buffer arguments template @@ -127,19 +129,19 @@ std::shared_ptr to_arrow(cudf::scalar const& input, arrow::MemoryPool* ar_mr); /** * @copydoc cudf::from_arrow(arrow::Table const& input_table, rmm::cuda_stream_view stream, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr
from_arrow(arrow::Table const& input_table, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::from_arrow(arrow::Scalar const& input, rmm::cuda_stream_view stream, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr from_arrow(arrow::Scalar const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Return a maximum precision for a given type. diff --git a/cpp/include/cudf/detail/join.hpp b/cpp/include/cudf/detail/join.hpp index 27d14874bce..aabfff746ea 100644 --- a/cpp/include/cudf/detail/join.hpp +++ b/cpp/include/cudf/detail/join.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -105,7 +106,7 @@ struct hash_join { inner_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const; + rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::left_join @@ -115,7 +116,7 @@ struct hash_join { left_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const; + rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::full_join @@ -125,7 +126,7 @@ struct hash_join { full_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const; + rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::hash_join::inner_join_size @@ -144,7 +145,7 @@ struct hash_join { */ std::size_t full_join_size(cudf::table_view const& probe, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const; + rmm::device_async_resource_ref mr) const; private: /** @@ -169,7 +170,7 @@ struct hash_join { join_kind join, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const; + rmm::device_async_resource_ref mr) const; /** * @copydoc cudf::detail::hash_join::probe_join_indices @@ -184,7 +185,7 @@ struct hash_join { join_kind join, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const; + rmm::device_async_resource_ref mr) const; }; } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/label_bins.hpp b/cpp/include/cudf/detail/label_bins.hpp index 50eeba58cdd..9f6dcce448d 100644 --- a/cpp/include/cudf/detail/label_bins.hpp +++ b/cpp/include/cudf/detail/label_bins.hpp @@ -25,6 +25,7 @@ #include #include #include +#include namespace cudf { @@ -40,7 +41,7 @@ namespace detail { /** * @copydoc cudf::label_bins(column_view const& input, column_view const& left_edges, inclusive * left_inclusive, column_view const& right_edges, inclusive right_inclusive, rmm::cuda_stream_view, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param stream Stream view on which to allocate resources and queue execution. */ @@ -50,7 +51,7 @@ std::unique_ptr label_bins(column_view const& input, column_view const& right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** @} */ // end of group } // namespace detail diff --git a/cpp/include/cudf/detail/merge.hpp b/cpp/include/cudf/detail/merge.hpp index 2167a484214..837eda0d7b5 100644 --- a/cpp/include/cudf/detail/merge.hpp +++ b/cpp/include/cudf/detail/merge.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #pragma once #include +#include #include @@ -45,7 +46,7 @@ using index_vector = rmm::device_uvector; * std::vector const& key_cols, * std::vector const& column_order, * std::vector const& null_precedence, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param stream CUDA stream used for device memory operations and kernel launches */ @@ -54,7 +55,7 @@ std::unique_ptr merge(std::vector const& tables_to_merg std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/null_mask.cuh b/cpp/include/cudf/detail/null_mask.cuh index db373f47a01..e62675cbc8c 100644 --- a/cpp/include/cudf/detail/null_mask.cuh +++ b/cpp/include/cudf/detail/null_mask.cuh @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,7 @@ CUDF_KERNEL void offset_bitmask_binop(Binop op, /** * @copydoc bitmask_binop(Binop op, host_span, host_span - * const, size_type, rmm::mr::device_memory_resource *) + * const, size_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ @@ -120,7 +121,7 @@ std::pair bitmask_binop(Binop op, host_span masks_begin_bits, size_type mask_size_bits, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto dest_mask = rmm::device_buffer{bitmask_allocation_size_bytes(mask_size_bits), stream, mr}; auto null_count = @@ -163,7 +164,7 @@ size_type inplace_bitmask_binop(Binop op, CUDF_EXPECTS(std::all_of(masks.begin(), masks.end(), [](auto p) { return p != nullptr; }), "Mask pointer cannot be null"); - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource(); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource(); rmm::device_scalar d_counter{0, stream, mr}; rmm::device_uvector d_masks(masks.size(), stream, mr); rmm::device_uvector d_begin_bits(masks_begin_bits.size(), stream, mr); @@ -282,7 +283,7 @@ rmm::device_uvector segmented_count_bits(bitmask_type const* bitmask, OffsetIterator last_bit_indices_begin, count_bits_policy count_bits, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_ranges = static_cast(std::distance(first_bit_indices_begin, first_bit_indices_end)); @@ -541,7 +542,7 @@ std::pair segmented_null_mask_reduction( null_policy null_handling, std::optional valid_initial_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const segments_begin = thrust::make_zip_iterator(first_bit_indices_begin, last_bit_indices_begin); diff --git a/cpp/include/cudf/detail/null_mask.hpp b/cpp/include/cudf/detail/null_mask.hpp index 74e2ccd2ea1..04d8d663acb 100644 --- a/cpp/include/cudf/detail/null_mask.hpp +++ b/cpp/include/cudf/detail/null_mask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -28,14 +29,14 @@ namespace cudf { namespace detail { /** - * @copydoc cudf::create_null_mask(size_type, mask_state, rmm::mr::device_memory_resource*) + * @copydoc cudf::create_null_mask(size_type, mask_state, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ rmm::device_buffer create_null_mask(size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::set_null_mask(bitmask_type*, size_type, size_type, bool) @@ -194,7 +195,7 @@ std::vector segmented_null_count(bitmask_type const* bitmask, /** * @copydoc cudf::copy_bitmask(bitmask_type const*, size_type, size_type, - *rmm::mr::device_memory_resource*) + *rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -202,20 +203,20 @@ rmm::device_buffer copy_bitmask(bitmask_type const* mask, size_type begin_bit, size_type end_bit, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::copy_bitmask(column_view const& view, rmm::mr::device_memory_resource*) + * @copydoc cudf::copy_bitmask(column_view const& view, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ rmm::device_buffer copy_bitmask(column_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc bitmask_and(host_span, host_span const, - * size_type, rmm::mr::device_memory_resource *) + * size_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ @@ -223,7 +224,7 @@ std::pair bitmask_and(host_span masks_begin_bits, size_type mask_size_bits, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::bitmask_and @@ -232,7 +233,7 @@ std::pair bitmask_and(host_span bitmask_and(table_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::bitmask_or @@ -241,7 +242,7 @@ std::pair bitmask_and(table_view const& view, */ std::pair bitmask_or(table_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Performs a bitwise AND of the specified bitmasks, @@ -274,7 +275,7 @@ cudf::size_type inplace_bitmask_and(device_span dest_mask, void set_all_valid_null_masks(column_view const& input, column& output, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/detail/quantiles.hpp b/cpp/include/cudf/detail/quantiles.hpp index ac37d923d85..6c188d2ca68 100644 --- a/cpp/include/cudf/detail/quantiles.hpp +++ b/cpp/include/cudf/detail/quantiles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -35,7 +36,7 @@ std::unique_ptr quantile(column_view const& input, column_view const& ordered_indices, bool exact, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::quantiles() @@ -49,18 +50,18 @@ std::unique_ptr
quantiles(table_view const& input, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::percentile_approx(tdigest_column_view const&, column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr percentile_approx(tdigest::tdigest_column_view const& input, column_view const& percentiles, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/repeat.hpp b/cpp/include/cudf/detail/repeat.hpp index 883d5d158fb..abb9e45a95c 100644 --- a/cpp/include/cudf/detail/repeat.hpp +++ b/cpp/include/cudf/detail/repeat.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -28,7 +29,7 @@ namespace detail { /** * @copydoc cudf::repeat(table_view const&, column_view const&, bool, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -36,18 +37,18 @@ std::unique_ptr
repeat(table_view const& input_table, column_view const& count, bool check_count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::repeat(table_view const&, size_type, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr
repeat(table_view const& input_table, size_type count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/replace.hpp b/cpp/include/cudf/detail/replace.hpp index da83f7b285d..46203bdf2f0 100644 --- a/cpp/include/cudf/detail/replace.hpp +++ b/cpp/include/cudf/detail/replace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -27,58 +28,58 @@ namespace cudf { namespace detail { /** * @copydoc cudf::replace_nulls(column_view const&, column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr replace_nulls(column_view const& input, cudf::column_view const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::replace_nulls(column_view const&, scalar const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr replace_nulls(column_view const& input, scalar const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::replace_nulls(column_view const&, replace_policy const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr replace_nulls(column_view const& input, replace_policy const& replace_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::replace_nans(column_view const&, column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr replace_nans(column_view const& input, column_view const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::replace_nans(column_view const&, scalar const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr replace_nans(column_view const& input, scalar const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::find_and_replace_all @@ -89,7 +90,7 @@ std::unique_ptr find_and_replace_all(column_view const& input_col, column_view const& values_to_replace, column_view const& replacement_values, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::normalize_nans_and_zeros @@ -98,7 +99,7 @@ std::unique_ptr find_and_replace_all(column_view const& input_col, */ std::unique_ptr normalize_nans_and_zeros(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/reshape.hpp b/cpp/include/cudf/detail/reshape.hpp index 5ab53690a23..7a1c3d6c4f0 100644 --- a/cpp/include/cudf/detail/reshape.hpp +++ b/cpp/include/cudf/detail/reshape.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -33,7 +34,7 @@ namespace detail { std::unique_ptr
tile(table_view const& input, size_type count, rmm::cuda_stream_view, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::interleave_columns @@ -42,7 +43,7 @@ std::unique_ptr
tile(table_view const& input, */ std::unique_ptr interleave_columns(table_view const& input, rmm::cuda_stream_view, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/rolling.hpp b/cpp/include/cudf/detail/rolling.hpp index da90217c254..ea6f38c421c 100644 --- a/cpp/include/cudf/detail/rolling.hpp +++ b/cpp/include/cudf/detail/rolling.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -35,7 +36,7 @@ namespace detail { * column_view const& following_window, * size_type min_periods, * rolling_aggregation const& agg, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -45,7 +46,7 @@ std::unique_ptr rolling_window(column_view const& input, size_type min_periods, rolling_aggregation const& agg, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/round.hpp b/cpp/include/cudf/detail/round.hpp index cdfc7caef37..1a9c5c82c65 100644 --- a/cpp/include/cudf/detail/round.hpp +++ b/cpp/include/cudf/detail/round.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { //! Inner interfaces and implementations @@ -27,7 +28,7 @@ namespace detail { /** * @copydoc cudf::round(column_view const&, int32_t, rounding_method, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -35,7 +36,7 @@ std::unique_ptr round(column_view const& input, int32_t decimal_places, rounding_method method, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/scan.hpp b/cpp/include/cudf/detail/scan.hpp index f4b2d51d0cb..54c25d0157c 100644 --- a/cpp/include/cudf/detail/scan.hpp +++ b/cpp/include/cudf/detail/scan.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -50,7 +51,7 @@ std::unique_ptr scan_exclusive(column_view const& input, scan_aggregation const& agg, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes the inclusive scan of a column. @@ -76,7 +77,7 @@ std::unique_ptr scan_inclusive(column_view const& input, scan_aggregation const& agg, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Generate row ranks for a column. @@ -88,7 +89,7 @@ std::unique_ptr scan_inclusive(column_view const& input, */ std::unique_ptr inclusive_rank_scan(column_view const& order_by, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Generate row dense ranks for a column. @@ -100,7 +101,7 @@ std::unique_ptr inclusive_rank_scan(column_view const& order_by, */ std::unique_ptr inclusive_dense_rank_scan(column_view const& order_by, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Generate row ONE_NORMALIZED percent ranks for a column. @@ -113,7 +114,7 @@ std::unique_ptr inclusive_dense_rank_scan(column_view const& order_by, * @return rank values. */ std::unique_ptr inclusive_one_normalized_percent_rank_scan( - column_view const& order_by, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + column_view const& order_by, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/scatter.cuh b/cpp/include/cudf/detail/scatter.cuh index dbf7bfa9527..7eb661f7833 100644 --- a/cpp/include/cudf/detail/scatter.cuh +++ b/cpp/include/cudf/detail/scatter.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -145,7 +146,7 @@ struct column_scatterer_impl(target, stream, mr); auto result_view = result->mutable_view(); @@ -170,7 +171,7 @@ struct column_scatterer_impl { MapIterator scatter_map_end, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto d_column = column_device_view::create(source, stream); auto const begin = d_column->begin(); @@ -187,7 +188,7 @@ struct column_scatterer_impl { MapIterator scatter_map_end, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return cudf::lists::detail::scatter( source, scatter_map_begin, scatter_map_end, target, stream, mr); @@ -202,7 +203,7 @@ struct column_scatterer_impl { MapIterator scatter_map_end, column_view const& target_in, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { if (target_in.is_empty()) // empty begets empty return make_empty_column(type_id::DICTIONARY32); @@ -261,7 +262,7 @@ struct column_scatterer { MapIterator scatter_map_end, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { column_scatterer_impl scatterer{}; return scatterer(source, scatter_map_begin, scatter_map_end, target, stream, mr); @@ -276,7 +277,7 @@ struct column_scatterer_impl { MapItRoot scatter_map_end, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(source.num_children() == target.num_children(), "Scatter source and target are not of the same type."); @@ -391,7 +392,7 @@ std::unique_ptr
scatter(table_view const& source, MapIterator scatter_map_end, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/include/cudf/detail/scatter.hpp b/cpp/include/cudf/detail/scatter.hpp index 94c795f31b2..95ed6af8c3c 100644 --- a/cpp/include/cudf/detail/scatter.hpp +++ b/cpp/include/cudf/detail/scatter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -63,11 +64,11 @@ std::unique_ptr
scatter(table_view const& source, column_view const& scatter_map, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::detail::scatter(table_view const&,column_view const&,table_view - * const&,bool,rmm::cuda_stream_view,rmm::mr::device_memory_resource*) + * const&,bool,rmm::cuda_stream_view,rmm::device_async_resource_ref) * * @throws cudf::logic_error if `scatter_map` span size is larger than max of `size_type`. */ @@ -75,7 +76,7 @@ std::unique_ptr
scatter(table_view const& source, device_span const scatter_map, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Scatters a row of scalar values into a copy of the target table @@ -110,13 +111,13 @@ std::unique_ptr
scatter(std::vector> column_view const& indices, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::boolean_mask_scatter( table_view const& source, table_view const& target, * column_view const& boolean_mask, - * rmm::mr::device_memory_resource *mr) + * rmm::device_async_resource_ref mr) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -124,14 +125,14 @@ std::unique_ptr
boolean_mask_scatter(table_view const& source, table_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::boolean_mask_scatter( * std::vector> const& source, * table_view const& target, * column_view const& boolean_mask, - * rmm::mr::device_memory_resource *mr) + * rmm::device_async_resource_ref mr) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -140,7 +141,7 @@ std::unique_ptr
boolean_mask_scatter( table_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/search.hpp b/cpp/include/cudf/detail/search.hpp index 4277baf3edd..e60b18f4c8d 100644 --- a/cpp/include/cudf/detail/search.hpp +++ b/cpp/include/cudf/detail/search.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf::detail { /** @@ -35,7 +36,7 @@ std::unique_ptr lower_bound(table_view const& haystack, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::upper_bound @@ -47,24 +48,24 @@ std::unique_ptr upper_bound(table_view const& haystack, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc cudf::contains(column_view const&, scalar const&, rmm::mr::device_memory_resource*) + * @copydoc cudf::contains(column_view const&, scalar const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ bool contains(column_view const& haystack, scalar const& needle, rmm::cuda_stream_view stream); /** - * @copydoc cudf::contains(column_view const&, column_view const&, rmm::mr::device_memory_resource*) + * @copydoc cudf::contains(column_view const&, column_view const&, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr contains(column_view const& haystack, column_view const& needles, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Check if rows in the given `needles` table exist in the `haystack` table. @@ -96,6 +97,6 @@ rmm::device_uvector contains(table_view const& haystack, null_equality compare_nulls, nan_equality compare_nans, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::detail diff --git a/cpp/include/cudf/detail/sequence.hpp b/cpp/include/cudf/detail/sequence.hpp index 6f2a43b54de..a18a9d3b200 100644 --- a/cpp/include/cudf/detail/sequence.hpp +++ b/cpp/include/cudf/detail/sequence.hpp @@ -21,12 +21,13 @@ #include #include +#include namespace cudf { namespace detail { /** * @copydoc cudf::sequence(size_type size, scalar const& init, scalar const& step, - * rmm::mr::device_memory_resource* mr = + * rmm::device_async_resource_ref mr = *rmm::mr::get_current_device_resource()) * * @param stream CUDA stream used for device memory operations and kernel launches. @@ -35,11 +36,11 @@ std::unique_ptr sequence(size_type size, scalar const& init, scalar const& step, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::sequence(size_type size, scalar const& init, - rmm::mr::device_memory_resource* mr = + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) * * @param stream CUDA stream used for device memory operations and kernel launches. @@ -47,13 +48,13 @@ std::unique_ptr sequence(size_type size, std::unique_ptr sequence(size_type size, scalar const& init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::calendrical_month_sequence(size_type size, * scalar const& init, * size_type months, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -61,7 +62,7 @@ std::unique_ptr calendrical_month_sequence(size_type size, scalar const& init, size_type months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/sizes_to_offsets_iterator.cuh b/cpp/include/cudf/detail/sizes_to_offsets_iterator.cuh index 08917bfce24..63e4fca8915 100644 --- a/cpp/include/cudf/detail/sizes_to_offsets_iterator.cuh +++ b/cpp/include/cudf/detail/sizes_to_offsets_iterator.cuh @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -300,7 +301,7 @@ std::pair, size_type> make_offsets_child_column( InputIterator begin, InputIterator end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto count = static_cast(std::distance(begin, end)); auto offsets_column = make_numeric_column( diff --git a/cpp/include/cudf/detail/sorting.hpp b/cpp/include/cudf/detail/sorting.hpp index 97cc054da57..4ddba38a7e9 100644 --- a/cpp/include/cudf/detail/sorting.hpp +++ b/cpp/include/cudf/detail/sorting.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -37,7 +38,7 @@ std::unique_ptr sorted_order(table_view const& input, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::stable_sorted_order @@ -48,7 +49,7 @@ std::unique_ptr stable_sorted_order(table_view const& input, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::sort_by_key @@ -60,7 +61,7 @@ std::unique_ptr
sort_by_key(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::rank @@ -74,7 +75,7 @@ std::unique_ptr rank(column_view const& input, null_order null_precedence, bool percentage, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::stable_sort_by_key @@ -86,7 +87,7 @@ std::unique_ptr
stable_sort_by_key(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::segmented_sorted_order @@ -98,7 +99,7 @@ std::unique_ptr segmented_sorted_order(table_view const& keys, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::stable_segmented_sorted_order @@ -111,7 +112,7 @@ std::unique_ptr stable_segmented_sorted_order( std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::segmented_sort_by_key @@ -124,7 +125,7 @@ std::unique_ptr
segmented_sort_by_key(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::stable_segmented_sort_by_key @@ -137,7 +138,7 @@ std::unique_ptr
stable_segmented_sort_by_key(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::sort @@ -148,7 +149,7 @@ std::unique_ptr
sort(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::stable_sort @@ -159,7 +160,7 @@ std::unique_ptr
stable_sort(table_view const& values, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/stream_compaction.hpp b/cpp/include/cudf/detail/stream_compaction.hpp index 7f366c06a1c..e2974789ea1 100644 --- a/cpp/include/cudf/detail/stream_compaction.hpp +++ b/cpp/include/cudf/detail/stream_compaction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,12 +23,13 @@ #include #include +#include namespace cudf { namespace detail { /** * @copydoc cudf::drop_nulls(table_view const&, std::vector const&, - * cudf::size_type, rmm::mr::device_memory_resource*) + * cudf::size_type, rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -36,11 +37,11 @@ std::unique_ptr
drop_nulls(table_view const& input, std::vector const& keys, cudf::size_type keep_threshold, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::drop_nans(table_view const&, std::vector const&, - * cudf::size_type, rmm::mr::device_memory_resource*) + * cudf::size_type, rmm::device_async_resource_ref) * * @param[in] stream CUDA stream used for device memory operations and kernel launches. */ @@ -48,7 +49,7 @@ std::unique_ptr
drop_nans(table_view const& input, std::vector const& keys, cudf::size_type keep_threshold, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::apply_boolean_mask @@ -58,7 +59,7 @@ std::unique_ptr
drop_nans(table_view const& input, std::unique_ptr
apply_boolean_mask(table_view const& input, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::unique @@ -70,7 +71,7 @@ std::unique_ptr
unique(table_view const& input, duplicate_keep_option keep, null_equality nulls_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::distinct @@ -83,7 +84,7 @@ std::unique_ptr
distinct(table_view const& input, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::stable_distinct @@ -96,7 +97,7 @@ std::unique_ptr
stable_distinct(table_view const& input, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::distinct_indices @@ -108,7 +109,7 @@ rmm::device_uvector distinct_indices(table_view const& input, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::unique_count(column_view const&, null_policy, nan_policy) diff --git a/cpp/include/cudf/detail/structs/utilities.hpp b/cpp/include/cudf/detail/structs/utilities.hpp index c0a79142cef..e736514ac29 100644 --- a/cpp/include/cudf/detail/structs/utilities.hpp +++ b/cpp/include/cudf/detail/structs/utilities.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf::structs::detail { @@ -175,7 +176,7 @@ class flattened_table { std::vector const& null_precedence, column_nullability nullability, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Superimpose nulls from a given null mask into the input column, using bitwise AND. @@ -197,7 +198,7 @@ class flattened_table { size_type null_count, std::unique_ptr&& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Push down nulls from the given input column into its children columns, using bitwise AND. @@ -222,7 +223,7 @@ class flattened_table { * to be kept alive. */ [[nodiscard]] std::pair push_down_nulls( - column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + column_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); /** * @brief Push down nulls from columns of the input table into their children columns, using @@ -249,7 +250,7 @@ class flattened_table { * to be kept alive. */ [[nodiscard]] std::pair push_down_nulls( - table_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + table_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); /** * @brief Checks if a column or any of its children is a struct column with structs that are null. diff --git a/cpp/include/cudf/detail/tdigest/tdigest.hpp b/cpp/include/cudf/detail/tdigest/tdigest.hpp index b529d4a2c53..bfd12c18fff 100644 --- a/cpp/include/cudf/detail/tdigest/tdigest.hpp +++ b/cpp/include/cudf/detail/tdigest/tdigest.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace tdigest { @@ -70,7 +71,7 @@ std::unique_ptr group_tdigest(column_view const& values, size_type num_groups, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Merges tdigests within the same group to generate a new tdigest. @@ -113,7 +114,7 @@ std::unique_ptr group_merge_tdigest(column_view const& values, size_type num_groups, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create a tdigest column from its constituent components. @@ -139,7 +140,7 @@ std::unique_ptr make_tdigest_column(size_type num_rows, std::unique_ptr&& min_values, std::unique_ptr&& max_values, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create an empty tdigest column. @@ -152,7 +153,7 @@ std::unique_ptr make_tdigest_column(size_type num_rows, * @returns An empty tdigest column. */ std::unique_ptr make_empty_tdigest_column(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create an empty tdigest scalar. @@ -165,7 +166,7 @@ std::unique_ptr make_empty_tdigest_column(rmm::cuda_stream_view stream, * @returns An empty tdigest scalar. */ std::unique_ptr make_empty_tdigest_scalar(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Generate a tdigest scalar from a set of numeric input values. @@ -199,7 +200,7 @@ std::unique_ptr make_empty_tdigest_scalar(rmm::cuda_stream_view stream, std::unique_ptr reduce_tdigest(column_view const& values, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Merges multiple tdigest columns to generate a new tdigest scalar. @@ -233,7 +234,7 @@ std::unique_ptr reduce_tdigest(column_view const& values, std::unique_ptr reduce_merge_tdigest(column_view const& input, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace tdigest diff --git a/cpp/include/cudf/detail/timezone.hpp b/cpp/include/cudf/detail/timezone.hpp index f7f97c0a7c2..037164aa297 100644 --- a/cpp/include/cudf/detail/timezone.hpp +++ b/cpp/include/cudf/detail/timezone.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,13 @@ #include #include +#include namespace cudf::detail { /** * @copydoc cudf::make_timezone_transition_table(std::optional, std::string_view, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -31,6 +32,6 @@ std::unique_ptr
make_timezone_transition_table( std::optional tzif_dir, std::string_view timezone_name, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); } // namespace cudf::detail diff --git a/cpp/include/cudf/detail/transform.hpp b/cpp/include/cudf/detail/transform.hpp index 965fea84860..47e13fa2e5e 100644 --- a/cpp/include/cudf/detail/transform.hpp +++ b/cpp/include/cudf/detail/transform.hpp @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -34,7 +35,7 @@ std::unique_ptr transform(column_view const& input, data_type output_type, bool is_ptx, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::compute_column @@ -44,7 +45,7 @@ std::unique_ptr transform(column_view const& input, std::unique_ptr compute_column(table_view const& table, ast::expression const& expr, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::nans_to_nulls @@ -52,7 +53,7 @@ std::unique_ptr compute_column(table_view const& table, * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, size_type> nans_to_nulls( - column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + column_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::bools_to_mask @@ -60,7 +61,7 @@ std::pair, size_type> nans_to_nulls( * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, cudf::size_type> bools_to_mask( - column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + column_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::encode @@ -68,7 +69,7 @@ std::pair, cudf::size_type> bools_to_mask( * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, std::unique_ptr> encode( - cudf::table_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + cudf::table_view const& input, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); /** * @copydoc cudf::one_hot_encode @@ -78,7 +79,7 @@ std::pair, std::unique_ptr> encode( std::pair, table_view> one_hot_encode(column_view const& input, column_view const& categories, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::mask_to_bools @@ -89,7 +90,7 @@ std::unique_ptr mask_to_bools(bitmask_type const* null_mask, size_type begin_bit, size_type end_bit, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::row_bit_count @@ -98,7 +99,7 @@ std::unique_ptr mask_to_bools(bitmask_type const* null_mask, */ std::unique_ptr row_bit_count(table_view const& t, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::segmented_row_bit_count @@ -108,7 +109,7 @@ std::unique_ptr row_bit_count(table_view const& t, std::unique_ptr segmented_row_bit_count(table_view const& t, size_type segment_length, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/transpose.hpp b/cpp/include/cudf/detail/transpose.hpp index d0be51860b2..1f8effc8103 100644 --- a/cpp/include/cudf/detail/transpose.hpp +++ b/cpp/include/cudf/detail/transpose.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -30,7 +31,7 @@ namespace detail { */ std::pair, table_view> transpose(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/unary.hpp b/cpp/include/cudf/detail/unary.hpp index 12f864de572..5245cfdf079 100644 --- a/cpp/include/cudf/detail/unary.hpp +++ b/cpp/include/cudf/detail/unary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -50,7 +51,7 @@ std::unique_ptr true_if(InputIterator begin, size_type size, Predicate p, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output = make_numeric_column(data_type(type_id::BOOL8), size, mask_state::UNALLOCATED, stream, mr); @@ -68,14 +69,14 @@ std::unique_ptr true_if(InputIterator begin, std::unique_ptr unary_operation(cudf::column_view const& input, cudf::unary_operator op, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::is_valid */ std::unique_ptr is_valid(cudf::column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::cast @@ -83,21 +84,21 @@ std::unique_ptr is_valid(cudf::column_view const& input, std::unique_ptr cast(column_view const& input, data_type type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::is_nan */ std::unique_ptr is_nan(cudf::column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::is_not_nan */ std::unique_ptr is_not_nan(cudf::column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/include/cudf/detail/utilities/vector_factories.hpp b/cpp/include/cudf/detail/utilities/vector_factories.hpp index 90ad98741ad..293a4096c57 100644 --- a/cpp/include/cudf/detail/utilities/vector_factories.hpp +++ b/cpp/include/cudf/detail/utilities/vector_factories.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -50,7 +51,7 @@ namespace detail { template rmm::device_uvector make_zeroed_device_uvector_async(std::size_t size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { rmm::device_uvector ret(size, stream, mr); CUDF_CUDA_TRY(cudaMemsetAsync(ret.data(), 0, size * sizeof(T), stream.value())); @@ -71,7 +72,7 @@ rmm::device_uvector make_zeroed_device_uvector_async(std::size_t size, template rmm::device_uvector make_zeroed_device_uvector_sync(std::size_t size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { rmm::device_uvector ret(size, stream, mr); CUDF_CUDA_TRY(cudaMemsetAsync(ret.data(), 0, size * sizeof(T), stream.value())); @@ -94,7 +95,7 @@ rmm::device_uvector make_zeroed_device_uvector_sync(std::size_t size, template rmm::device_uvector make_device_uvector_async(host_span source_data, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { rmm::device_uvector ret(source_data.size(), stream, mr); CUDF_CUDA_TRY(cudaMemcpyAsync(ret.data(), @@ -123,7 +124,7 @@ template < std::enable_if_t< std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_async( - Container const& c, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + Container const& c, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { return make_device_uvector_async(host_span{c}, stream, mr); } @@ -143,7 +144,7 @@ rmm::device_uvector make_device_uvector_async( template rmm::device_uvector make_device_uvector_async(device_span source_data, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { rmm::device_uvector ret(source_data.size(), stream, mr); CUDF_CUDA_TRY(cudaMemcpyAsync(ret.data(), @@ -172,7 +173,7 @@ template < std::enable_if_t< std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_async( - Container const& c, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + Container const& c, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { return make_device_uvector_async( device_span{c}, stream, mr); @@ -193,7 +194,7 @@ rmm::device_uvector make_device_uvector_async( template rmm::device_uvector make_device_uvector_sync(host_span source_data, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto ret = make_device_uvector_async(source_data, stream, mr); stream.synchronize(); @@ -218,7 +219,7 @@ template < std::enable_if_t< std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_sync( - Container const& c, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + Container const& c, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { return make_device_uvector_sync(host_span{c}, stream, mr); } @@ -238,7 +239,7 @@ rmm::device_uvector make_device_uvector_sync( template rmm::device_uvector make_device_uvector_sync(device_span source_data, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto ret = make_device_uvector_async(source_data, stream, mr); stream.synchronize(); @@ -263,7 +264,7 @@ template < std::enable_if_t< std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_sync( - Container const& c, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + Container const& c, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { return make_device_uvector_sync(device_span{c}, stream, mr); } diff --git a/cpp/include/cudf/detail/valid_if.cuh b/cpp/include/cudf/detail/valid_if.cuh index d0073177445..66163d6059a 100644 --- a/cpp/include/cudf/detail/valid_if.cuh +++ b/cpp/include/cudf/detail/valid_if.cuh @@ -25,6 +25,7 @@ #include #include +#include #include @@ -90,7 +91,7 @@ std::pair valid_if(InputIterator begin, InputIterator end, Predicate p, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(begin <= end, "Invalid range."); diff --git a/cpp/include/cudf/dictionary/detail/concatenate.hpp b/cpp/include/cudf/dictionary/detail/concatenate.hpp index d74429484ce..55f3825b3ec 100644 --- a/cpp/include/cudf/dictionary/detail/concatenate.hpp +++ b/cpp/include/cudf/dictionary/detail/concatenate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -39,7 +40,7 @@ namespace detail { */ std::unique_ptr concatenate(host_span columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/detail/encode.hpp b/cpp/include/cudf/dictionary/detail/encode.hpp index 2aad7dd80ed..3b5a3bbab56 100644 --- a/cpp/include/cudf/dictionary/detail/encode.hpp +++ b/cpp/include/cudf/dictionary/detail/encode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -54,7 +55,7 @@ namespace detail { std::unique_ptr encode(column_view const& column, data_type indices_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create a column by gathering the keys from the provided @@ -73,7 +74,7 @@ std::unique_ptr encode(column_view const& column, */ std::unique_ptr decode(dictionary_column_view const& dictionary_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Return minimal integer type for the given number of elements. diff --git a/cpp/include/cudf/dictionary/detail/merge.hpp b/cpp/include/cudf/dictionary/detail/merge.hpp index cad495d0097..c4229690ff5 100644 --- a/cpp/include/cudf/dictionary/detail/merge.hpp +++ b/cpp/include/cudf/dictionary/detail/merge.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -44,7 +45,7 @@ std::unique_ptr merge(dictionary_column_view const& lcol, dictionary_column_view const& rcol, cudf::detail::index_vector const& row_order, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/detail/replace.hpp b/cpp/include/cudf/dictionary/detail/replace.hpp index 0778baa84d6..81a91d57169 100644 --- a/cpp/include/cudf/dictionary/detail/replace.hpp +++ b/cpp/include/cudf/dictionary/detail/replace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -42,7 +43,7 @@ namespace detail { std::unique_ptr replace_nulls(dictionary_column_view const& input, dictionary_column_view const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create a new dictionary column by replacing nulls with a @@ -59,7 +60,7 @@ std::unique_ptr replace_nulls(dictionary_column_view const& input, std::unique_ptr replace_nulls(dictionary_column_view const& input, scalar const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/detail/search.hpp b/cpp/include/cudf/dictionary/detail/search.hpp index 62059306b9a..2563b96b214 100644 --- a/cpp/include/cudf/dictionary/detail/search.hpp +++ b/cpp/include/cudf/dictionary/detail/search.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -27,14 +28,14 @@ namespace detail { /** * @copydoc cudf::dictionary::get_index(dictionary_column_view const&,scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr get_index(dictionary_column_view const& dictionary, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Get the index for a key if it were added to the given dictionary. @@ -58,7 +59,7 @@ std::unique_ptr get_index(dictionary_column_view const& dictionary, std::unique_ptr get_insert_index(dictionary_column_view const& dictionary, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/detail/update_keys.hpp b/cpp/include/cudf/dictionary/detail/update_keys.hpp index 6fd743ad526..e8486a80afc 100644 --- a/cpp/include/cudf/dictionary/detail/update_keys.hpp +++ b/cpp/include/cudf/dictionary/detail/update_keys.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -35,7 +36,7 @@ namespace detail { std::unique_ptr add_keys(dictionary_column_view const& dictionary_column, column_view const& new_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::dictionary::remove_keys(dictionary_column_view const&,column_view @@ -46,7 +47,7 @@ std::unique_ptr add_keys(dictionary_column_view const& dictionary_column std::unique_ptr remove_keys(dictionary_column_view const& dictionary_column, column_view const& keys_to_remove, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::dictionary::remove_unused_keys(dictionary_column_view @@ -56,7 +57,7 @@ std::unique_ptr remove_keys(dictionary_column_view const& dictionary_col */ std::unique_ptr remove_unused_keys(dictionary_column_view const& dictionary_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::dictionary::set_keys(dictionary_column_view @@ -67,7 +68,7 @@ std::unique_ptr remove_unused_keys(dictionary_column_view const& diction std::unique_ptr set_keys(dictionary_column_view const& dictionary_column, column_view const& keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc @@ -78,7 +79,7 @@ std::unique_ptr set_keys(dictionary_column_view const& dictionary_column std::vector> match_dictionaries( cudf::host_span input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create new dictionaries that have keys merged from dictionary columns @@ -100,9 +101,7 @@ std::vector> match_dictionaries( * @return New dictionary columns and updated cudf::table_views. */ std::pair>, std::vector> match_dictionaries( - std::vector tables, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + std::vector tables, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); } // namespace detail } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/dictionary_factories.hpp b/cpp/include/cudf/dictionary/dictionary_factories.hpp index 821981ad148..7cdfa3bf9e5 100644 --- a/cpp/include/cudf/dictionary/dictionary_factories.hpp +++ b/cpp/include/cudf/dictionary/dictionary_factories.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { /** @@ -65,8 +66,8 @@ namespace cudf { std::unique_ptr make_dictionary_column( column_view const& keys_column, column_view const& indices_column, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a dictionary column by taking ownership of the provided keys @@ -117,8 +118,8 @@ std::unique_ptr make_dictionary_column(std::unique_ptr keys_colu std::unique_ptr make_dictionary_column( std::unique_ptr keys_column, std::unique_ptr indices_column, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/dictionary/encode.hpp b/cpp/include/cudf/dictionary/encode.hpp index 959b785bf87..768e2be2b0d 100644 --- a/cpp/include/cudf/dictionary/encode.hpp +++ b/cpp/include/cudf/dictionary/encode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -59,9 +60,9 @@ namespace dictionary { */ std::unique_ptr encode( column_view const& column, - data_type indices_type = data_type{type_id::UINT32}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + data_type indices_type = data_type{type_id::UINT32}, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a column by gathering the keys from the provided @@ -80,8 +81,8 @@ std::unique_ptr encode( */ std::unique_ptr decode( dictionary_column_view const& dictionary_column, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/search.hpp b/cpp/include/cudf/dictionary/search.hpp index 1b72cf42acd..1dff6dc1d5d 100644 --- a/cpp/include/cudf/dictionary/search.hpp +++ b/cpp/include/cudf/dictionary/search.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -44,8 +45,8 @@ namespace dictionary { std::unique_ptr get_index( dictionary_column_view const& dictionary, scalar const& key, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace dictionary diff --git a/cpp/include/cudf/dictionary/update_keys.hpp b/cpp/include/cudf/dictionary/update_keys.hpp index 40504c22edd..ce7057359a1 100644 --- a/cpp/include/cudf/dictionary/update_keys.hpp +++ b/cpp/include/cudf/dictionary/update_keys.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -59,8 +60,8 @@ namespace dictionary { std::unique_ptr add_keys( dictionary_column_view const& dictionary_column, column_view const& new_keys, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a new dictionary column by removing the specified keys @@ -91,8 +92,8 @@ std::unique_ptr add_keys( std::unique_ptr remove_keys( dictionary_column_view const& dictionary_column, column_view const& keys_to_remove, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a new dictionary column by removing any keys @@ -113,8 +114,8 @@ std::unique_ptr remove_keys( */ std::unique_ptr remove_unused_keys( dictionary_column_view const& dictionary_column, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a new dictionary column by applying only the specified keys @@ -147,8 +148,8 @@ std::unique_ptr remove_unused_keys( std::unique_ptr set_keys( dictionary_column_view const& dictionary_column, column_view const& keys, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create new dictionaries that have keys merged from the input dictionaries. @@ -163,8 +164,8 @@ std::unique_ptr set_keys( */ std::vector> match_dictionaries( cudf::host_span input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace dictionary diff --git a/cpp/include/cudf/filling.hpp b/cpp/include/cudf/filling.hpp index 1268f488919..90139e8634a 100644 --- a/cpp/include/cudf/filling.hpp +++ b/cpp/include/cudf/filling.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -91,8 +92,8 @@ std::unique_ptr fill( size_type begin, size_type end, scalar const& value, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Repeat rows of a Table. @@ -125,8 +126,8 @@ std::unique_ptr fill( std::unique_ptr
repeat( table_view const& input_table, column_view const& count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Repeat rows of a Table. @@ -150,8 +151,8 @@ std::unique_ptr
repeat( std::unique_ptr
repeat( table_view const& input_table, size_type count, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Fills a column with a sequence of value specified by an initial value and a step. @@ -181,8 +182,8 @@ std::unique_ptr sequence( size_type size, scalar const& init, scalar const& step, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Fills a column with a sequence of value specified by an initial value and a step of 1. @@ -208,8 +209,8 @@ std::unique_ptr sequence( std::unique_ptr sequence( size_type size, scalar const& init, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Generate a sequence of timestamps beginning at `init` and incrementing by `months` for @@ -239,8 +240,8 @@ std::unique_ptr calendrical_month_sequence( size_type size, scalar const& init, size_type months, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/groupby.hpp b/cpp/include/cudf/groupby.hpp index 1c31e8777a8..831ef68ed15 100644 --- a/cpp/include/cudf/groupby.hpp +++ b/cpp/include/cudf/groupby.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -184,17 +185,17 @@ class groupby { */ std::pair, std::vector> aggregate( host_span requests, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** - * @copydoc aggregate(host_span, rmm::mr::device_memory_resource*) + * @copydoc aggregate(host_span, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, std::vector> aggregate( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs grouped scans on the specified values. * @@ -248,7 +249,7 @@ class groupby { */ std::pair, std::vector> scan( host_span requests, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs grouped shifts for specified values. @@ -304,7 +305,7 @@ class groupby { table_view const& values, host_span offsets, std::vector> const& fill_values, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief The grouped data corresponding to a groupby operation on a set of values. @@ -332,8 +333,8 @@ class groupby { * returned groups * @return A `groups` object representing grouped keys and values */ - groups get_groups(cudf::table_view values = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + groups get_groups(cudf::table_view values = {}, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs grouped replace nulls on @p value @@ -373,7 +374,7 @@ class groupby { std::pair, std::unique_ptr
> replace_nulls( table_view const& values, host_span replace_policies, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); private: table_view _keys; ///< Keys that determine grouping @@ -404,18 +405,18 @@ class groupby { std::pair, std::vector> dispatch_aggregation( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); // Sort-based groupby std::pair, std::vector> sort_aggregate( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::pair, std::vector> sort_scan( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); }; /** @} */ } // namespace groupby diff --git a/cpp/include/cudf/hashing.hpp b/cpp/include/cudf/hashing.hpp index 83962b50a10..3c2f6dfe0d5 100644 --- a/cpp/include/cudf/hashing.hpp +++ b/cpp/include/cudf/hashing.hpp @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { @@ -58,9 +59,9 @@ namespace hashing { */ std::unique_ptr murmurhash3_x86_32( table_view const& input, - uint32_t seed = DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + uint32_t seed = DEFAULT_HASH_SEED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the MurmurHash3 64-bit hash value of each row in the given table @@ -77,9 +78,9 @@ std::unique_ptr murmurhash3_x86_32( */ std::unique_ptr
murmurhash3_x64_128( table_view const& input, - uint64_t seed = DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + uint64_t seed = DEFAULT_HASH_SEED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the MD5 hash value of each row in the given table @@ -92,8 +93,8 @@ std::unique_ptr
murmurhash3_x64_128( */ std::unique_ptr md5( table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the SHA-1 hash value of each row in the given table @@ -106,8 +107,8 @@ std::unique_ptr md5( */ std::unique_ptr sha1( table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the SHA-224 hash value of each row in the given table @@ -120,8 +121,8 @@ std::unique_ptr sha1( */ std::unique_ptr sha224( table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the SHA-256 hash value of each row in the given table @@ -134,8 +135,8 @@ std::unique_ptr sha224( */ std::unique_ptr sha256( table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the SHA-384 hash value of each row in the given table @@ -148,8 +149,8 @@ std::unique_ptr sha256( */ std::unique_ptr sha384( table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the SHA-512 hash value of each row in the given table @@ -162,8 +163,8 @@ std::unique_ptr sha384( */ std::unique_ptr sha512( table_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the XXHash_64 hash value of each row in the given table @@ -179,9 +180,9 @@ std::unique_ptr sha512( */ std::unique_ptr xxhash_64( table_view const& input, - uint64_t seed = DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + uint64_t seed = DEFAULT_HASH_SEED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); } // namespace hashing diff --git a/cpp/include/cudf/hashing/detail/hashing.hpp b/cpp/include/cudf/hashing/detail/hashing.hpp index 88a43a64638..77266ceb48f 100644 --- a/cpp/include/cudf/hashing/detail/hashing.hpp +++ b/cpp/include/cudf/hashing/detail/hashing.hpp @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -30,41 +31,41 @@ namespace detail { std::unique_ptr murmurhash3_x86_32(table_view const& input, uint32_t seed, rmm::cuda_stream_view, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr
murmurhash3_x64_128(table_view const& input, uint64_t seed, rmm::cuda_stream_view, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr md5(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr sha1(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr sha224(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr sha256(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr sha384(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr sha512(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr xxhash_64(table_view const& input, uint64_t seed, rmm::cuda_stream_view, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /* Copyright 2005-2014 Daniel James. * diff --git a/cpp/include/cudf/interop.hpp b/cpp/include/cudf/interop.hpp index 871f48e3aac..dc4d66a8f6e 100644 --- a/cpp/include/cudf/interop.hpp +++ b/cpp/include/cudf/interop.hpp @@ -23,6 +23,8 @@ #pragma nv_diag_suppress 611 #pragma nv_diag_suppress 2810 #endif +#include + #include #ifdef __CUDACC__ #pragma nv_diag_default 611 @@ -70,7 +72,7 @@ namespace cudf { */ std::unique_ptr
from_dlpack( DLManagedTensor const* managed_tensor, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Convert a cudf table into a DLPack DLTensor @@ -92,7 +94,7 @@ std::unique_ptr
from_dlpack( */ DLManagedTensor* to_dlpack( table_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group @@ -224,8 +226,8 @@ unique_schema_t to_arrow_schema(cudf::table_view const& input, */ unique_device_array_t to_arrow_device( cudf::table&& table, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create `ArrowDeviceArray` from cudf column and metadata @@ -253,8 +255,8 @@ unique_device_array_t to_arrow_device( */ unique_device_array_t to_arrow_device( cudf::column&& col, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create `cudf::table` from given arrow Table input @@ -267,8 +269,8 @@ unique_device_array_t to_arrow_device( std::unique_ptr
from_arrow( arrow::Table const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create `cudf::scalar` from given arrow Scalar input @@ -281,8 +283,8 @@ std::unique_ptr
from_arrow( std::unique_ptr from_arrow( arrow::Scalar const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/io/avro.hpp b/cpp/include/cudf/io/avro.hpp index 89207302850..8bc74eb574c 100644 --- a/cpp/include/cudf/io/avro.hpp +++ b/cpp/include/cudf/io/avro.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -216,7 +217,7 @@ class avro_reader_options_builder { */ table_with_metadata read_avro( avro_reader_options const& options, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace io diff --git a/cpp/include/cudf/io/csv.hpp b/cpp/include/cudf/io/csv.hpp index 435583e805d..fdceda40e92 100644 --- a/cpp/include/cudf/io/csv.hpp +++ b/cpp/include/cudf/io/csv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -1315,8 +1316,8 @@ class csv_reader_options_builder { */ table_with_metadata read_csv( csv_reader_options options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group /** @@ -1721,8 +1722,8 @@ class csv_writer_options_builder { * @param mr Device memory resource to use for device memory allocation */ void write_csv(csv_writer_options const& options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace io diff --git a/cpp/include/cudf/io/detail/avro.hpp b/cpp/include/cudf/io/detail/avro.hpp index fede8e62d9f..fe9f935d2cc 100644 --- a/cpp/include/cudf/io/detail/avro.hpp +++ b/cpp/include/cudf/io/detail/avro.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace io { @@ -39,7 +40,7 @@ namespace avro { table_with_metadata read_avro(std::unique_ptr&& source, avro_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace avro } // namespace detail diff --git a/cpp/include/cudf/io/detail/csv.hpp b/cpp/include/cudf/io/detail/csv.hpp index 40ddcf385b0..50c1a7c163d 100644 --- a/cpp/include/cudf/io/detail/csv.hpp +++ b/cpp/include/cudf/io/detail/csv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace io { @@ -38,7 +39,7 @@ namespace csv { table_with_metadata read_csv(std::unique_ptr&& source, csv_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Write an entire dataset to CSV format. @@ -55,7 +56,7 @@ void write_csv(data_sink* sink, host_span column_names, csv_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace csv } // namespace detail diff --git a/cpp/include/cudf/io/detail/json.hpp b/cpp/include/cudf/io/detail/json.hpp index 3f7f7e9bb32..cf8e23c2d93 100644 --- a/cpp/include/cudf/io/detail/json.hpp +++ b/cpp/include/cudf/io/detail/json.hpp @@ -19,6 +19,7 @@ #include #include +#include namespace cudf::io::json::detail { @@ -35,7 +36,7 @@ namespace cudf::io::json::detail { table_with_metadata read_json(host_span> sources, json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Write an entire dataset to JSON format. @@ -50,7 +51,7 @@ void write_json(data_sink* sink, table_view const& table, json_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Normalize single quotes to double quotes using FST @@ -61,7 +62,7 @@ void write_json(data_sink* sink, */ rmm::device_uvector normalize_single_quotes(rmm::device_uvector&& inbuf, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Normalize unquoted whitespace (space and tab characters) using FST @@ -72,5 +73,5 @@ rmm::device_uvector normalize_single_quotes(rmm::device_uvector&& in */ rmm::device_uvector normalize_whitespace(rmm::device_uvector&& inbuf, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::io::json::detail diff --git a/cpp/include/cudf/io/detail/orc.hpp b/cpp/include/cudf/io/detail/orc.hpp index c63c952e148..9aeb9ae4267 100644 --- a/cpp/include/cudf/io/detail/orc.hpp +++ b/cpp/include/cudf/io/detail/orc.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -57,7 +58,7 @@ class reader { explicit reader(std::vector>&& sources, orc_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Destructor explicitly declared to avoid inlining in header diff --git a/cpp/include/cudf/io/detail/parquet.hpp b/cpp/include/cudf/io/detail/parquet.hpp index df870f6f1e4..55338d422ad 100644 --- a/cpp/include/cudf/io/detail/parquet.hpp +++ b/cpp/include/cudf/io/detail/parquet.hpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -65,7 +66,7 @@ class reader { explicit reader(std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Destructor explicitly-declared to avoid inlined in header @@ -145,7 +146,7 @@ class chunked_reader : private reader { std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Destructor explicitly-declared to avoid inlined in header. diff --git a/cpp/include/cudf/io/detail/tokenize_json.hpp b/cpp/include/cudf/io/detail/tokenize_json.hpp index b2ea29a85c3..d08c4e7c65a 100644 --- a/cpp/include/cudf/io/detail/tokenize_json.hpp +++ b/cpp/include/cudf/io/detail/tokenize_json.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf::io::json { @@ -133,7 +134,7 @@ std::pair, rmm::device_uvector> ge device_span json_in, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/include/cudf/io/json.hpp b/cpp/include/cudf/io/json.hpp index 1f2628deea7..d8330b78f0e 100644 --- a/cpp/include/cudf/io/json.hpp +++ b/cpp/include/cudf/io/json.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -612,8 +613,8 @@ class json_reader_options_builder { */ table_with_metadata read_json( json_reader_options options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group @@ -959,8 +960,8 @@ class json_writer_options_builder { * @param mr Device memory resource to use for device memory allocation */ void write_json(json_writer_options const& options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace io diff --git a/cpp/include/cudf/io/orc.hpp b/cpp/include/cudf/io/orc.hpp index 5cc9ea81f29..bceb258cb38 100644 --- a/cpp/include/cudf/io/orc.hpp +++ b/cpp/include/cudf/io/orc.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -402,8 +403,8 @@ class orc_reader_options_builder { */ table_with_metadata read_orc( orc_reader_options const& options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group /** diff --git a/cpp/include/cudf/io/parquet.hpp b/cpp/include/cudf/io/parquet.hpp index dc035db8d39..f58bc48a37d 100644 --- a/cpp/include/cudf/io/parquet.hpp +++ b/cpp/include/cudf/io/parquet.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -409,8 +410,8 @@ class parquet_reader_options_builder { */ table_with_metadata read_parquet( parquet_reader_options const& options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief The chunked parquet reader class to read Parquet file iteratively in to a series of @@ -446,8 +447,8 @@ class chunked_parquet_reader { chunked_parquet_reader( std::size_t chunk_read_limit, parquet_reader_options const& options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Constructor for chunked reader. @@ -472,8 +473,8 @@ class chunked_parquet_reader { std::size_t chunk_read_limit, std::size_t pass_read_limit, parquet_reader_options const& options, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Destructor, destroying the internal reader instance. diff --git a/cpp/include/cudf/io/text/detail/tile_state.hpp b/cpp/include/cudf/io/text/detail/tile_state.hpp index d42624aa9b7..aa9185b4983 100644 --- a/cpp/include/cudf/io/text/detail/tile_state.hpp +++ b/cpp/include/cudf/io/text/detail/tile_state.hpp @@ -16,6 +16,8 @@ #pragma once +#include + #include #include @@ -81,7 +83,7 @@ struct scan_tile_state { scan_tile_state(cudf::size_type num_tiles, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : tile_status(rmm::device_uvector>( num_tiles, stream, mr)), tile_state_partial(rmm::device_uvector(num_tiles, stream, mr)), diff --git a/cpp/include/cudf/io/text/detail/trie.hpp b/cpp/include/cudf/io/text/detail/trie.hpp index 7bb2e4e2ece..e0b9c7635e3 100644 --- a/cpp/include/cudf/io/text/detail/trie.hpp +++ b/cpp/include/cudf/io/text/detail/trie.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -165,7 +166,7 @@ struct trie { */ static trie create(std::string const& pattern, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return create(std::vector{pattern}, stream, mr); @@ -181,7 +182,7 @@ struct trie { */ static trie create(std::vector const& patterns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector tokens; std::vector transitions; diff --git a/cpp/include/cudf/io/text/multibyte_split.hpp b/cpp/include/cudf/io/text/multibyte_split.hpp index a7edc9be0e4..7abae7c754b 100644 --- a/cpp/include/cudf/io/text/multibyte_split.hpp +++ b/cpp/include/cudf/io/text/multibyte_split.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -85,18 +86,18 @@ struct parse_options { std::unique_ptr multibyte_split( data_chunk_source const& source, std::string const& delimiter, - parse_options options = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + parse_options options = {}, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); std::unique_ptr multibyte_split( data_chunk_source const& source, std::string const& delimiter, std::optional byte_range, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); std::unique_ptr multibyte_split(data_chunk_source const& source, std::string const& delimiter, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace text } // namespace io diff --git a/cpp/include/cudf/join.hpp b/cpp/include/cudf/join.hpp index e343ad9ee32..825f758adbd 100644 --- a/cpp/include/cudf/join.hpp +++ b/cpp/include/cudf/join.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -95,8 +96,8 @@ std::pair>, std::unique_ptr>> inner_join(cudf::table_view const& left_keys, cudf::table_view const& right_keys, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to a @@ -135,8 +136,8 @@ std::pair>, std::unique_ptr>> left_join(cudf::table_view const& left_keys, cudf::table_view const& right_keys, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to a @@ -174,8 +175,8 @@ std::pair>, std::unique_ptr>> full_join(cudf::table_view const& left_keys, cudf::table_view const& right_keys, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a vector of row indices corresponding to a left semi-join @@ -202,8 +203,8 @@ full_join(cudf::table_view const& left_keys, std::unique_ptr> left_semi_join( cudf::table_view const& left_keys, cudf::table_view const& right_keys, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a vector of row indices corresponding to a left anti join @@ -233,8 +234,8 @@ std::unique_ptr> left_semi_join( std::unique_ptr> left_anti_join( cudf::table_view const& left_keys, cudf::table_view const& right_keys, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a cross join on two tables (`left`, `right`) @@ -261,7 +262,7 @@ std::unique_ptr> left_anti_join( std::unique_ptr cross_join( cudf::table_view const& left, cudf::table_view const& right, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief The enum class to specify if any of the input join tables (`build` table and any later @@ -340,7 +341,7 @@ class hash_join { inner_join(cudf::table_view const& probe, std::optional output_size = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const; + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) const; /** * Returns the row indices that can be used to construct the result of performing @@ -365,7 +366,7 @@ class hash_join { left_join(cudf::table_view const& probe, std::optional output_size = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const; + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) const; /** * Returns the row indices that can be used to construct the result of performing @@ -390,7 +391,7 @@ class hash_join { full_join(cudf::table_view const& probe, std::optional output_size = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const; + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) const; /** * Returns the exact number of matches (rows) when performing an inner join with the specified @@ -441,8 +442,8 @@ class hash_join { */ std::size_t full_join_size( cudf::table_view const& probe, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const; + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) const; private: const std::unique_ptr _impl; @@ -497,8 +498,8 @@ class distinct_hash_join { */ std::pair>, std::unique_ptr>> - inner_join(rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const; + inner_join(rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) const; /** * @brief Returns the build table indices that can be used to construct the result of performing @@ -515,8 +516,8 @@ class distinct_hash_join { * join between two tables with `build` and `probe` as the join keys. */ std::unique_ptr> left_join( - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const; + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) const; private: using impl_type = typename cudf::detail::distinct_hash_join; ///< Implementation type @@ -561,12 +562,11 @@ class distinct_hash_join { */ std::pair>, std::unique_ptr>> -conditional_inner_join( - table_view const& left, - table_view const& right, - ast::expression const& binary_predicate, - std::optional output_size = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); +conditional_inner_join(table_view const& left, + table_view const& right, + ast::expression const& binary_predicate, + std::optional output_size = {}, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to all pairs @@ -611,7 +611,7 @@ conditional_left_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to all pairs @@ -653,7 +653,7 @@ std::pair>, conditional_full_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns an index vector corresponding to all rows in the left table @@ -692,7 +692,7 @@ std::unique_ptr> conditional_left_semi_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns an index vector corresponding to all rows in the left table @@ -731,7 +731,7 @@ std::unique_ptr> conditional_left_anti_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to all pairs of @@ -789,7 +789,7 @@ mixed_inner_join( ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, std::optional>> output_size_data = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to all pairs of @@ -849,7 +849,7 @@ mixed_left_join( ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, std::optional>> output_size_data = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a pair of row index vectors corresponding to all pairs of @@ -909,7 +909,7 @@ mixed_full_join( ast::expression const& binary_predicate, null_equality compare_nulls = null_equality::EQUAL, std::optional>> output_size_data = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns an index vector corresponding to all rows in the left tables @@ -955,8 +955,8 @@ std::unique_ptr> mixed_left_semi_join( table_view const& left_conditional, table_view const& right_conditional, ast::expression const& binary_predicate, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns an index vector corresponding to all rows in the left tables @@ -1003,8 +1003,8 @@ std::unique_ptr> mixed_left_anti_join( table_view const& left_conditional, table_view const& right_conditional, ast::expression const& binary_predicate, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the exact number of matches (rows) when performing a @@ -1043,8 +1043,8 @@ std::pair>> mixed_in table_view const& left_conditional, table_view const& right_conditional, ast::expression const& binary_predicate, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the exact number of matches (rows) when performing a @@ -1083,8 +1083,8 @@ std::pair>> mixed_le table_view const& left_conditional, table_view const& right_conditional, ast::expression const& binary_predicate, - null_equality compare_nulls = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality compare_nulls = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the exact number of matches (rows) when performing a @@ -1107,7 +1107,7 @@ std::size_t conditional_inner_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the exact number of matches (rows) when performing a @@ -1130,7 +1130,7 @@ std::size_t conditional_left_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the exact number of matches (rows) when performing a @@ -1153,7 +1153,7 @@ std::size_t conditional_left_semi_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the exact number of matches (rows) when performing a @@ -1176,6 +1176,6 @@ std::size_t conditional_left_anti_join_size( table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/json/json.hpp b/cpp/include/cudf/json/json.hpp index 944e0c26dd6..385e8e54bdc 100644 --- a/cpp/include/cudf/json/json.hpp +++ b/cpp/include/cudf/json/json.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include @@ -167,9 +168,9 @@ class get_json_object_options { std::unique_ptr get_json_object( cudf::strings_column_view const& col, cudf::string_scalar const& json_path, - get_json_object_options options = get_json_object_options{}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + get_json_object_options options = get_json_object_options{}, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace cudf diff --git a/cpp/include/cudf/labeling/label_bins.hpp b/cpp/include/cudf/labeling/label_bins.hpp index d8ea262dfe1..9091e31a9ea 100644 --- a/cpp/include/cudf/labeling/label_bins.hpp +++ b/cpp/include/cudf/labeling/label_bins.hpp @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { @@ -74,8 +75,8 @@ std::unique_ptr label_bins( inclusive left_inclusive, column_view const& right_edges, inclusive right_inclusive, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/lists/combine.hpp b/cpp/include/cudf/lists/combine.hpp index 0d9c1c157eb..853562acfff 100644 --- a/cpp/include/cudf/lists/combine.hpp +++ b/cpp/include/cudf/lists/combine.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { @@ -66,7 +67,7 @@ std::unique_ptr concatenate_rows( table_view const& input, concatenate_null_policy null_policy = concatenate_null_policy::IGNORE, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Concatenating multiple lists on the same row of a lists column into a single list. @@ -97,7 +98,7 @@ std::unique_ptr concatenate_list_elements( column_view const& input, concatenate_null_policy null_policy = concatenate_null_policy::IGNORE, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace lists diff --git a/cpp/include/cudf/lists/contains.hpp b/cpp/include/cudf/lists/contains.hpp index 7cf67ec9205..060882555aa 100644 --- a/cpp/include/cudf/lists/contains.hpp +++ b/cpp/include/cudf/lists/contains.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -49,8 +50,8 @@ namespace lists { std::unique_ptr contains( cudf::lists_column_view const& lists, cudf::scalar const& search_key, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a column of `bool` values indicating whether the list rows of the first @@ -73,8 +74,8 @@ std::unique_ptr contains( std::unique_ptr contains( cudf::lists_column_view const& lists, cudf::column_view const& search_keys, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a column of `bool` values indicating whether each row in the `lists` column @@ -95,8 +96,8 @@ std::unique_ptr contains( */ std::unique_ptr contains_nulls( cudf::lists_column_view const& lists, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Option to choose whether `index_of()` returns the first or last match @@ -138,9 +139,9 @@ enum class duplicate_find_option : int32_t { std::unique_ptr index_of( cudf::lists_column_view const& lists, cudf::scalar const& search_key, - duplicate_find_option find_option = duplicate_find_option::FIND_FIRST, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + duplicate_find_option find_option = duplicate_find_option::FIND_FIRST, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a column of values indicating the position of a search key @@ -175,9 +176,9 @@ std::unique_ptr index_of( std::unique_ptr index_of( cudf::lists_column_view const& lists, cudf::column_view const& search_keys, - duplicate_find_option find_option = duplicate_find_option::FIND_FIRST, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + duplicate_find_option find_option = duplicate_find_option::FIND_FIRST, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace lists diff --git a/cpp/include/cudf/lists/count_elements.hpp b/cpp/include/cudf/lists/count_elements.hpp index e4bd0dca9ae..2b9f5aa5607 100644 --- a/cpp/include/cudf/lists/count_elements.hpp +++ b/cpp/include/cudf/lists/count_elements.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -51,8 +52,8 @@ namespace lists { */ std::unique_ptr count_elements( lists_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of lists_elements group diff --git a/cpp/include/cudf/lists/detail/combine.hpp b/cpp/include/cudf/lists/detail/combine.hpp index 4bc45e48a9f..bd4c01bbb4b 100644 --- a/cpp/include/cudf/lists/detail/combine.hpp +++ b/cpp/include/cudf/lists/detail/combine.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + namespace cudf { namespace lists { namespace detail { @@ -30,7 +32,7 @@ namespace detail { std::unique_ptr concatenate_rows(table_view const& input, concatenate_null_policy null_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::concatenate_list_elements @@ -40,7 +42,7 @@ std::unique_ptr concatenate_rows(table_view const& input, std::unique_ptr concatenate_list_elements(column_view const& input, concatenate_null_policy null_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/concatenate.hpp b/cpp/include/cudf/lists/detail/concatenate.hpp index a1f149d4ccf..d67958ef260 100644 --- a/cpp/include/cudf/lists/detail/concatenate.hpp +++ b/cpp/include/cudf/lists/detail/concatenate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -45,7 +46,7 @@ namespace detail { */ std::unique_ptr concatenate(host_span columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/contains.hpp b/cpp/include/cudf/lists/detail/contains.hpp index 58ec18cb9ef..638cc7afb81 100644 --- a/cpp/include/cudf/lists/detail/contains.hpp +++ b/cpp/include/cudf/lists/detail/contains.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ #include #include +#include + namespace cudf { namespace lists { namespace detail { @@ -26,49 +28,49 @@ namespace detail { * @copydoc cudf::lists::index_of(cudf::lists_column_view const&, * cudf::scalar const&, * duplicate_find_option, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr index_of(cudf::lists_column_view const& lists, cudf::scalar const& search_key, cudf::lists::duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::index_of(cudf::lists_column_view const&, * cudf::column_view const&, * duplicate_find_option, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr index_of(cudf::lists_column_view const& lists, cudf::column_view const& search_keys, cudf::lists::duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::contains(cudf::lists_column_view const&, * cudf::scalar const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr contains(cudf::lists_column_view const& lists, cudf::scalar const& search_key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::contains(cudf::lists_column_view const&, * cudf::column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr contains(cudf::lists_column_view const& lists, cudf::column_view const& search_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists } // namespace cudf diff --git a/cpp/include/cudf/lists/detail/copying.hpp b/cpp/include/cudf/lists/detail/copying.hpp index 3760294f079..18a70bba5e9 100644 --- a/cpp/include/cudf/lists/detail/copying.hpp +++ b/cpp/include/cudf/lists/detail/copying.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -46,7 +47,7 @@ std::unique_ptr copy_slice(lists_column_view const& lists, size_type start, size_type end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/extract.hpp b/cpp/include/cudf/lists/detail/extract.hpp index 013f9b491dd..6f983d44bc9 100644 --- a/cpp/include/cudf/lists/detail/extract.hpp +++ b/cpp/include/cudf/lists/detail/extract.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,29 +18,31 @@ #include #include +#include + namespace cudf { namespace lists { namespace detail { /** * @copydoc cudf::lists::extract_list_element(lists_column_view, size_type, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_list_element(lists_column_view lists_column, size_type const index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::extract_list_element(lists_column_view, column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr extract_list_element(lists_column_view lists_column, column_view const& indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/gather.cuh b/cpp/include/cudf/lists/detail/gather.cuh index 03428bc347f..0cd77556f33 100644 --- a/cpp/include/cudf/lists/detail/gather.cuh +++ b/cpp/include/cudf/lists/detail/gather.cuh @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,7 @@ struct gather_data { * MapItType gather_map, * size_type gather_map_size, * rmm::cuda_stream_view stream, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param prev_base_offsets The buffer backing the base offsets used in the gather map. We can * free this buffer before allocating the new one to keep peak memory @@ -71,7 +72,7 @@ gather_data make_gather_data(cudf::lists_column_view const& source_column, size_type gather_map_size, rmm::device_uvector&& prev_base_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // size of the gather map is the # of output rows size_type output_count = gather_map_size; @@ -252,7 +253,7 @@ gather_data make_gather_data(cudf::lists_column_view const& source_column, MapItType gather_map, size_type gather_map_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return make_gather_data( source_column, @@ -278,7 +279,7 @@ gather_data make_gather_data(cudf::lists_column_view const& source_column, std::unique_ptr gather_list_nested(lists_column_view const& list, gather_data& gd, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Gather a leaf column from a hierarchy of list columns. @@ -295,13 +296,13 @@ std::unique_ptr gather_list_nested(lists_column_view const& list, std::unique_ptr gather_list_leaf(column_view const& column, gather_data const& gd, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::segmented_gather(lists_column_view const& source_column, * lists_column_view const& gather_map_list, * out_of_bounds_policy bounds_policy, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param stream CUDA stream on which to execute kernels */ @@ -309,7 +310,7 @@ std::unique_ptr segmented_gather(lists_column_view const& source_column, lists_column_view const& gather_map_list, out_of_bounds_policy bounds_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/interleave_columns.hpp b/cpp/include/cudf/lists/detail/interleave_columns.hpp index a5cf67c95b9..3aff93840a9 100644 --- a/cpp/include/cudf/lists/detail/interleave_columns.hpp +++ b/cpp/include/cudf/lists/detail/interleave_columns.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -47,7 +48,7 @@ namespace detail { std::unique_ptr interleave_columns(table_view const& input, bool has_null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/lists_column_factories.hpp b/cpp/include/cudf/lists/detail/lists_column_factories.hpp index 7b821a00b0d..192aee8d811 100644 --- a/cpp/include/cudf/lists/detail/lists_column_factories.hpp +++ b/cpp/include/cudf/lists/detail/lists_column_factories.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -38,7 +39,7 @@ namespace detail { std::unique_ptr make_lists_column_from_scalar(list_scalar const& value, size_type size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create an empty lists column. @@ -51,7 +52,7 @@ std::unique_ptr make_lists_column_from_scalar(list_scalar const& v */ std::unique_ptr make_empty_lists_column(data_type child_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create a lists column with all null rows. @@ -64,7 +65,7 @@ std::unique_ptr make_empty_lists_column(data_type child_type, std::unique_ptr make_all_nulls_lists_column(size_type size, data_type child_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/reverse.hpp b/cpp/include/cudf/lists/detail/reverse.hpp index 6e3b952a3b0..d099a0708b9 100644 --- a/cpp/include/cudf/lists/detail/reverse.hpp +++ b/cpp/include/cudf/lists/detail/reverse.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ #include +#include + namespace cudf::lists::detail { /** @@ -25,6 +27,6 @@ namespace cudf::lists::detail { */ std::unique_ptr reverse(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::lists::detail diff --git a/cpp/include/cudf/lists/detail/scatter.cuh b/cpp/include/cudf/lists/detail/scatter.cuh index 5fc52ff1c04..d0d5b1ad823 100644 --- a/cpp/include/cudf/lists/detail/scatter.cuh +++ b/cpp/include/cudf/lists/detail/scatter.cuh @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -53,7 +54,7 @@ rmm::device_uvector list_vector_from_column( IndexIterator index_begin, IndexIterator index_end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto n_rows = thrust::distance(index_begin, index_end); @@ -98,7 +99,7 @@ std::unique_ptr scatter_impl(rmm::device_uvector cons column_view const& source, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(column_types_equal(source, target), "Mismatched column types."); @@ -177,7 +178,7 @@ std::unique_ptr scatter(column_view const& source, MapIterator scatter_map_end, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_rows = target.size(); if (num_rows == 0) { return cudf::empty_like(target); } @@ -233,7 +234,7 @@ std::unique_ptr scatter(scalar const& slr, MapIterator scatter_map_end, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_rows = target.size(); if (num_rows == 0) { return cudf::empty_like(target); } diff --git a/cpp/include/cudf/lists/detail/scatter_helper.cuh b/cpp/include/cudf/lists/detail/scatter_helper.cuh index 605f76871b5..fc44e0bc290 100644 --- a/cpp/include/cudf/lists/detail/scatter_helper.cuh +++ b/cpp/include/cudf/lists/detail/scatter_helper.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include @@ -136,7 +137,7 @@ std::unique_ptr build_lists_child_column_recursive( cudf::lists_column_view const& source_lists_column_view, cudf::lists_column_view const& target_lists_column_view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/set_operations.hpp b/cpp/include/cudf/lists/detail/set_operations.hpp index 51fc58bee07..8746b1ba62a 100644 --- a/cpp/include/cudf/lists/detail/set_operations.hpp +++ b/cpp/include/cudf/lists/detail/set_operations.hpp @@ -22,6 +22,7 @@ #include #include +#include namespace cudf::lists::detail { @@ -35,7 +36,7 @@ std::unique_ptr have_overlap(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::list::intersect_distinct @@ -47,7 +48,7 @@ std::unique_ptr intersect_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::list::union_distinct @@ -59,7 +60,7 @@ std::unique_ptr union_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::list::difference_distinct @@ -71,7 +72,7 @@ std::unique_ptr difference_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** @} */ // end of group } // namespace cudf::lists::detail diff --git a/cpp/include/cudf/lists/detail/sorting.hpp b/cpp/include/cudf/lists/detail/sorting.hpp index c378ca8cf06..e428ea84ce6 100644 --- a/cpp/include/cudf/lists/detail/sorting.hpp +++ b/cpp/include/cudf/lists/detail/sorting.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -32,7 +33,7 @@ std::unique_ptr sort_lists(lists_column_view const& input, order column_order, null_order null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::lists::stable_sort_lists @@ -43,7 +44,7 @@ std::unique_ptr stable_sort_lists(lists_column_view const& input, order column_order, null_order null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace lists diff --git a/cpp/include/cudf/lists/detail/stream_compaction.hpp b/cpp/include/cudf/lists/detail/stream_compaction.hpp index 7ab9cf9a343..f5e5b29bc8f 100644 --- a/cpp/include/cudf/lists/detail/stream_compaction.hpp +++ b/cpp/include/cudf/lists/detail/stream_compaction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,19 +19,20 @@ #include #include +#include namespace cudf::lists::detail { /** * @copydoc cudf::lists::apply_boolean_mask(lists_column_view const&, lists_column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ std::unique_ptr apply_boolean_mask(lists_column_view const& input, lists_column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::list::distinct @@ -42,6 +43,6 @@ std::unique_ptr distinct(lists_column_view const& input, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::lists::detail diff --git a/cpp/include/cudf/lists/explode.hpp b/cpp/include/cudf/lists/explode.hpp index adf46805855..81d82dcfa09 100644 --- a/cpp/include/cudf/lists/explode.hpp +++ b/cpp/include/cudf/lists/explode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -72,7 +73,7 @@ namespace cudf { std::unique_ptr
explode( table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Explodes a list column's elements and includes a position column. @@ -116,7 +117,7 @@ std::unique_ptr
explode( std::unique_ptr
explode_position( table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Explodes a list column's elements retaining any null entries or empty lists inside. @@ -158,7 +159,7 @@ std::unique_ptr
explode_position( std::unique_ptr
explode_outer( table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Explodes a list column's elements retaining any null entries or empty lists and includes a @@ -202,7 +203,7 @@ std::unique_ptr
explode_outer( std::unique_ptr
explode_outer_position( table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group diff --git a/cpp/include/cudf/lists/extract.hpp b/cpp/include/cudf/lists/extract.hpp index 14c0f59e17d..096d276fcfb 100644 --- a/cpp/include/cudf/lists/extract.hpp +++ b/cpp/include/cudf/lists/extract.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -66,8 +67,8 @@ namespace lists { std::unique_ptr extract_list_element( lists_column_view const& lists_column, size_type index, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a column where each row is a single element from the corresponding sublist @@ -107,8 +108,8 @@ std::unique_ptr extract_list_element( std::unique_ptr extract_list_element( lists_column_view const& lists_column, column_view const& indices, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace lists diff --git a/cpp/include/cudf/lists/filling.hpp b/cpp/include/cudf/lists/filling.hpp index 3730e16482d..1d840c76bf8 100644 --- a/cpp/include/cudf/lists/filling.hpp +++ b/cpp/include/cudf/lists/filling.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -66,8 +67,8 @@ namespace cudf::lists { std::unique_ptr sequences( column_view const& starts, column_view const& sizes, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a lists column in which each row contains a sequence of values specified by a tuple @@ -108,8 +109,8 @@ std::unique_ptr sequences( column_view const& starts, column_view const& steps, column_view const& sizes, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf::lists diff --git a/cpp/include/cudf/lists/gather.hpp b/cpp/include/cudf/lists/gather.hpp index 5e6ab6816e6..a0d79c05098 100644 --- a/cpp/include/cudf/lists/gather.hpp +++ b/cpp/include/cudf/lists/gather.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -73,9 +74,9 @@ namespace lists { std::unique_ptr segmented_gather( lists_column_view const& source_column, lists_column_view const& gather_map_list, - out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + out_of_bounds_policy bounds_policy = out_of_bounds_policy::DONT_CHECK, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace lists diff --git a/cpp/include/cudf/lists/reverse.hpp b/cpp/include/cudf/lists/reverse.hpp index 864cd796f72..34c40c5a3ba 100644 --- a/cpp/include/cudf/lists/reverse.hpp +++ b/cpp/include/cudf/lists/reverse.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include @@ -48,8 +49,8 @@ namespace cudf::lists { */ std::unique_ptr reverse( lists_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group diff --git a/cpp/include/cudf/lists/set_operations.hpp b/cpp/include/cudf/lists/set_operations.hpp index 6fb8989f0bb..b8abfd62461 100644 --- a/cpp/include/cudf/lists/set_operations.hpp +++ b/cpp/include/cudf/lists/set_operations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf::lists { /** @@ -59,10 +60,10 @@ namespace cudf::lists { std::unique_ptr have_overlap( lists_column_view const& lhs, lists_column_view const& rhs, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a lists column of distinct elements common to two input lists columns. @@ -96,10 +97,10 @@ std::unique_ptr have_overlap( std::unique_ptr intersect_distinct( lists_column_view const& lhs, lists_column_view const& rhs, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a lists column of distinct elements found in either of two input lists columns. @@ -133,10 +134,10 @@ std::unique_ptr intersect_distinct( std::unique_ptr union_distinct( lists_column_view const& lhs, lists_column_view const& rhs, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a lists column of distinct elements found only in the left input column. @@ -170,10 +171,10 @@ std::unique_ptr union_distinct( std::unique_ptr difference_distinct( lists_column_view const& lhs, lists_column_view const& rhs, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf::lists diff --git a/cpp/include/cudf/lists/sorting.hpp b/cpp/include/cudf/lists/sorting.hpp index 39a52c75a98..78cea191bc5 100644 --- a/cpp/include/cudf/lists/sorting.hpp +++ b/cpp/include/cudf/lists/sorting.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace lists { @@ -55,8 +56,8 @@ std::unique_ptr sort_lists( lists_column_view const& source_column, order column_order, null_order null_precedence, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Segmented sort of the elements within a list in each row of a list column using stable @@ -68,8 +69,8 @@ std::unique_ptr stable_sort_lists( lists_column_view const& source_column, order column_order, null_order null_precedence, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace lists diff --git a/cpp/include/cudf/lists/stream_compaction.hpp b/cpp/include/cudf/lists/stream_compaction.hpp index 3ac4f6861ec..31f09d37560 100644 --- a/cpp/include/cudf/lists/stream_compaction.hpp +++ b/cpp/include/cudf/lists/stream_compaction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf::lists { @@ -61,8 +62,8 @@ namespace cudf::lists { std::unique_ptr apply_boolean_mask( lists_column_view const& input, lists_column_view const& boolean_mask, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a new list column without duplicate elements in each list. @@ -86,10 +87,10 @@ std::unique_ptr apply_boolean_mask( */ std::unique_ptr distinct( lists_column_view const& input, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group diff --git a/cpp/include/cudf/merge.hpp b/cpp/include/cudf/merge.hpp index 8886ec24bfe..29aa3ffe934 100644 --- a/cpp/include/cudf/merge.hpp +++ b/cpp/include/cudf/merge.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -105,7 +106,7 @@ std::unique_ptr merge( std::vector const& key_cols, std::vector const& column_order, std::vector const& null_precedence = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/null_mask.hpp b/cpp/include/cudf/null_mask.hpp index 524296e60ca..9e375df140b 100644 --- a/cpp/include/cudf/null_mask.hpp +++ b/cpp/include/cudf/null_mask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -89,8 +90,8 @@ size_type num_bitmask_words(size_type number_of_bits); rmm::device_buffer create_null_mask( size_type size, mask_state state, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Sets a pre-allocated bitmask buffer to a given state in the range @@ -132,8 +133,8 @@ rmm::device_buffer copy_bitmask( bitmask_type const* mask, size_type begin_bit, size_type end_bit, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Copies `view`'s bitmask from the bits @@ -149,8 +150,8 @@ rmm::device_buffer copy_bitmask( */ rmm::device_buffer copy_bitmask( column_view const& view, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs bitwise AND of the bitmasks of columns of a table. Returns @@ -166,8 +167,8 @@ rmm::device_buffer copy_bitmask( */ std::pair bitmask_and( table_view const& view, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs bitwise OR of the bitmasks of columns of a table. Returns @@ -183,8 +184,8 @@ std::pair bitmask_and( */ std::pair bitmask_or( table_view const& view, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Given a validity bitmask, counts the number of null elements (unset bits) diff --git a/cpp/include/cudf/partitioning.hpp b/cpp/include/cudf/partitioning.hpp index 7033aa500a2..9ed56297908 100644 --- a/cpp/include/cudf/partitioning.hpp +++ b/cpp/include/cudf/partitioning.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -78,7 +79,7 @@ std::pair, std::vector> partition( table_view const& t, column_view const& partition_map, size_type num_partitions, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Partitions rows from the input table into multiple output tables. @@ -104,10 +105,10 @@ std::pair, std::vector> hash_partition( table_view const& input, std::vector const& columns_to_hash, int num_partitions, - hash_id hash_function = hash_id::HASH_MURMUR3, - uint32_t seed = DEFAULT_HASH_SEED, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + hash_id hash_function = hash_id::HASH_MURMUR3, + uint32_t seed = DEFAULT_HASH_SEED, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Round-robin partition. @@ -249,8 +250,8 @@ std::pair, std::vector> hash_partition( std::pair, std::vector> round_robin_partition( table_view const& input, cudf::size_type num_partitions, - cudf::size_type start_partition = 0, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type start_partition = 0, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/quantiles.hpp b/cpp/include/cudf/quantiles.hpp index 1f3c26fa077..a1c98ee4e9d 100644 --- a/cpp/include/cudf/quantiles.hpp +++ b/cpp/include/cudf/quantiles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { /** @@ -56,10 +57,10 @@ namespace cudf { std::unique_ptr quantile( column_view const& input, std::vector const& q, - interpolation interp = interpolation::LINEAR, - column_view const& ordered_indices = {}, - bool exact = true, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + interpolation interp = interpolation::LINEAR, + column_view const& ordered_indices = {}, + bool exact = true, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the rows of the input corresponding to the requested quantiles. @@ -98,7 +99,7 @@ std::unique_ptr
quantiles( cudf::sorted is_input_sorted = sorted::NO, std::vector const& column_order = {}, std::vector const& null_precedence = {}, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Calculate approximate percentiles on an input tdigest column. @@ -125,7 +126,7 @@ std::unique_ptr
quantiles( std::unique_ptr percentile_approx( tdigest::tdigest_column_view const& input, column_view const& percentiles, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/reduction.hpp b/cpp/include/cudf/reduction.hpp index 52aebeb55e5..5adf89d1706 100644 --- a/cpp/include/cudf/reduction.hpp +++ b/cpp/include/cudf/reduction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -81,7 +82,7 @@ std::unique_ptr reduce( column_view const& col, reduce_aggregation const& agg, data_type output_dtype, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the reduction of the values in all rows of a column with an initial value @@ -103,7 +104,7 @@ std::unique_ptr reduce( reduce_aggregation const& agg, data_type output_dtype, std::optional> init, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Compute reduction of each segment in the input column @@ -153,7 +154,7 @@ std::unique_ptr segmented_reduce( segmented_reduce_aggregation const& agg, data_type output_dtype, null_policy null_handling, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Compute reduction of each segment in the input column with an initial value. Only SUM, @@ -178,7 +179,7 @@ std::unique_ptr segmented_reduce( data_type output_dtype, null_policy null_handling, std::optional> init, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the scan of a column. @@ -201,8 +202,8 @@ std::unique_ptr scan( column_view const& input, scan_aggregation const& agg, scan_type inclusive, - null_policy null_handling = null_policy::EXCLUDE, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_policy null_handling = null_policy::EXCLUDE, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Determines the minimum and maximum values of a column. @@ -215,7 +216,7 @@ std::unique_ptr scan( */ std::pair, std::unique_ptr> minmax( column_view const& col, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group diff --git a/cpp/include/cudf/reduction/detail/histogram.hpp b/cpp/include/cudf/reduction/detail/histogram.hpp index 97c711fda4e..f23c5a14e33 100644 --- a/cpp/include/cudf/reduction/detail/histogram.hpp +++ b/cpp/include/cudf/reduction/detail/histogram.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -42,7 +43,7 @@ namespace cudf::reduction::detail { compute_row_frequencies(table_view const& input, std::optional const& partial_counts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Create an empty histogram column. diff --git a/cpp/include/cudf/reduction/detail/reduction.cuh b/cpp/include/cudf/reduction/detail/reduction.cuh index 9807d4cb4ea..7d1754d86f2 100644 --- a/cpp/include/cudf/reduction/detail/reduction.cuh +++ b/cpp/include/cudf/reduction/detail/reduction.cuh @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -62,7 +63,7 @@ std::unique_ptr reduce(InputIterator d_in, op::simple_op op, std::optional init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const binary_op = cudf::detail::cast_functor(op.get_binary_op()); auto const initial_value = init.value_or(op.template get_identity()); @@ -105,7 +106,7 @@ std::unique_ptr reduce(InputIterator d_in, op::simple_op op, std::optional init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FAIL( "This function should never be called. fixed_point reduce should always go through the reduce " @@ -122,7 +123,7 @@ std::unique_ptr reduce(InputIterator d_in, op::simple_op op, std::optional init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const binary_op = cudf::detail::cast_functor(op.get_binary_op()); auto const initial_value = init.value_or(op.template get_identity()); @@ -188,7 +189,7 @@ std::unique_ptr reduce(InputIterator d_in, cudf::size_type valid_count, cudf::size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const binary_op = cudf::detail::cast_functor(op.get_binary_op()); auto const initial_value = op.template get_identity(); diff --git a/cpp/include/cudf/reduction/detail/reduction.hpp b/cpp/include/cudf/reduction/detail/reduction.hpp index 4cbfb82ae6b..78f90a1e2c9 100644 --- a/cpp/include/cudf/reduction/detail/reduction.hpp +++ b/cpp/include/cudf/reduction/detail/reduction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,15 @@ #include #include +#include + #include namespace cudf::reduction::detail { /** * @copydoc cudf::reduce(column_view const&, reduce_aggregation const&, data_type, - * std::optional>, rmm::mr::device_memory_resource*) + * std::optional>, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -35,6 +37,6 @@ std::unique_ptr reduce(column_view const& col, data_type output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::reduction::detail diff --git a/cpp/include/cudf/reduction/detail/reduction_functions.hpp b/cpp/include/cudf/reduction/detail/reduction_functions.hpp index 704332c8e1d..31d465619b9 100644 --- a/cpp/include/cudf/reduction/detail/reduction_functions.hpp +++ b/cpp/include/cudf/reduction/detail/reduction_functions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -47,7 +48,7 @@ std::unique_ptr sum(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes minimum of elements in input column @@ -67,7 +68,7 @@ std::unique_ptr min(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes maximum of elements in input column @@ -87,7 +88,7 @@ std::unique_ptr max(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes any of elements in input column is true when typecasted to bool @@ -108,7 +109,7 @@ std::unique_ptr any(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes all of elements in input column is true when typecasted to bool @@ -129,7 +130,7 @@ std::unique_ptr all(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Compute frequency for each unique element in the input column. @@ -144,7 +145,7 @@ std::unique_ptr all(column_view const& col, */ std::unique_ptr histogram(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Merge multiple histograms together. @@ -156,7 +157,7 @@ std::unique_ptr histogram(column_view const& input, */ std::unique_ptr merge_histogram(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes product of elements in input column @@ -177,7 +178,7 @@ std::unique_ptr product(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes sum of squares of elements in input column @@ -196,7 +197,7 @@ std::unique_ptr product(column_view const& col, std::unique_ptr sum_of_squares(column_view const& col, data_type const output_dtype, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes mean of elements in input column @@ -215,7 +216,7 @@ std::unique_ptr sum_of_squares(column_view const& col, std::unique_ptr mean(column_view const& col, data_type const output_dtype, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes variance of elements in input column @@ -237,7 +238,7 @@ std::unique_ptr variance(column_view const& col, data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes standard deviation of elements in input column @@ -259,7 +260,7 @@ std::unique_ptr standard_deviation(column_view const& col, data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Returns nth element in input column @@ -289,7 +290,7 @@ std::unique_ptr nth_element(column_view const& col, size_type n, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Collect input column into a (list) scalar @@ -303,7 +304,7 @@ std::unique_ptr nth_element(column_view const& col, std::unique_ptr collect_list(column_view const& col, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Merge a bunch of list scalars into single list scalar @@ -315,7 +316,7 @@ std::unique_ptr collect_list(column_view const& col, */ std::unique_ptr merge_lists(lists_column_view const& col, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Collect input column into a (list) scalar without duplicated elements @@ -333,7 +334,7 @@ std::unique_ptr collect_set(column_view const& col, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Merge a bunch of list scalars into single list scalar then drop duplicated elements @@ -349,7 +350,7 @@ std::unique_ptr merge_sets(lists_column_view const& col, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace reduction diff --git a/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp b/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp index 3902a7200a9..770ac6580ef 100644 --- a/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp +++ b/cpp/include/cudf/reduction/detail/segmented_reduction_functions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -57,7 +58,7 @@ std::unique_ptr segmented_sum(column_view const& col, null_policy null_handling, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes product of each segment in the input column @@ -87,7 +88,7 @@ std::unique_ptr segmented_product(column_view const& col, null_policy null_handling, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Compute minimum of each segment in the input column @@ -116,7 +117,7 @@ std::unique_ptr segmented_min(column_view const& col, null_policy null_handling, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Compute maximum of each segment in the input column @@ -145,7 +146,7 @@ std::unique_ptr segmented_max(column_view const& col, null_policy null_handling, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Compute if any of the values in the segment are true when typecasted to bool @@ -175,7 +176,7 @@ std::unique_ptr segmented_any(column_view const& col, null_policy null_handling, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Compute if all of the values in the segment are true when typecasted to bool @@ -205,7 +206,7 @@ std::unique_ptr segmented_all(column_view const& col, null_policy null_handling, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes mean of elements of segments in the input column @@ -233,7 +234,7 @@ std::unique_ptr segmented_mean(column_view const& col, data_type const output_dtype, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes sum of squares of elements of segments in the input column @@ -261,7 +262,7 @@ std::unique_ptr segmented_sum_of_squares(column_view const& col, data_type const output_dtype, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes the standard deviation of elements of segments in the input column @@ -292,7 +293,7 @@ std::unique_ptr segmented_standard_deviation(column_view const& col, null_policy null_handling, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes the variance of elements of segments in the input column @@ -323,7 +324,7 @@ std::unique_ptr segmented_variance(column_view const& col, null_policy null_handling, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Counts the number of unique values within each segment of a column @@ -351,7 +352,7 @@ std::unique_ptr segmented_nunique(column_view const& col, device_span offsets, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace reduction diff --git a/cpp/include/cudf/replace.hpp b/cpp/include/cudf/replace.hpp index 3405dc8b796..ae20e72f023 100644 --- a/cpp/include/cudf/replace.hpp +++ b/cpp/include/cudf/replace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -55,8 +56,8 @@ enum class replace_policy : bool { PRECEDING, FOLLOWING }; std::unique_ptr replace_nulls( column_view const& input, column_view const& replacement, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces all null values in a column with a scalar. @@ -74,8 +75,8 @@ std::unique_ptr replace_nulls( std::unique_ptr replace_nulls( column_view const& input, scalar const& replacement, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces all null values in a column with the first non-null value that precedes/follows. @@ -93,8 +94,8 @@ std::unique_ptr replace_nulls( std::unique_ptr replace_nulls( column_view const& input, replace_policy const& replace_policy, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces all NaN values in a column with corresponding values from another column @@ -121,8 +122,8 @@ std::unique_ptr replace_nulls( std::unique_ptr replace_nans( column_view const& input, column_view const& replacement, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces all NaN values in a column with a scalar @@ -148,8 +149,8 @@ std::unique_ptr replace_nans( std::unique_ptr replace_nans( column_view const& input, scalar const& replacement, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Return a copy of `input_col` replacing any `values_to_replace[i]` @@ -167,8 +168,8 @@ std::unique_ptr find_and_replace_all( column_view const& input_col, column_view const& values_to_replace, column_view const& replacement_values, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces values less than `lo` in `input` with `lo_replace`, @@ -222,8 +223,8 @@ std::unique_ptr clamp( scalar const& lo_replace, scalar const& hi, scalar const& hi_replace, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces values less than `lo` in `input` with `lo`, @@ -268,8 +269,8 @@ std::unique_ptr clamp( column_view const& input, scalar const& lo, scalar const& hi, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Copies from a column of floating-point elements and replaces `-NaN` and `-0.0` with `+NaN` @@ -288,8 +289,8 @@ std::unique_ptr clamp( */ std::unique_ptr normalize_nans_and_zeros( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Modifies a column of floating-point elements to replace all `-NaN` and `-0.0` with `+NaN` diff --git a/cpp/include/cudf/reshape.hpp b/cpp/include/cudf/reshape.hpp index 42cfb890a31..26316be7fd4 100644 --- a/cpp/include/cudf/reshape.hpp +++ b/cpp/include/cudf/reshape.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -52,7 +53,7 @@ namespace cudf { */ std::unique_ptr interleave_columns( table_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Repeats the rows from `input` table `count` times to form a new table. @@ -75,7 +76,7 @@ std::unique_ptr interleave_columns( std::unique_ptr
tile( table_view const& input, size_type count, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Configures whether byte casting flips endianness @@ -100,7 +101,7 @@ enum class flip_endianness : bool { NO, YES }; std::unique_ptr byte_cast( column_view const& input_column, flip_endianness endian_configuration, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group diff --git a/cpp/include/cudf/rolling.hpp b/cpp/include/cudf/rolling.hpp index ec93c709163..2cd34f48265 100644 --- a/cpp/include/cudf/rolling.hpp +++ b/cpp/include/cudf/rolling.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -66,7 +67,7 @@ std::unique_ptr rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief @copybrief rolling_window @@ -76,7 +77,7 @@ std::unique_ptr rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& agg, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param default_outputs A column of per-row default values to be returned instead * of nulls. Used for LEAD()/LAG(), if the row offset crosses @@ -89,7 +90,7 @@ std::unique_ptr rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Abstraction for window boundary sizes @@ -237,7 +238,7 @@ std::unique_ptr grouped_rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief @copybrief grouped_rolling_window @@ -248,7 +249,7 @@ std::unique_ptr grouped_rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr grouped_rolling_window( table_view const& group_keys, @@ -257,7 +258,7 @@ std::unique_ptr grouped_rolling_window( window_bounds following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief @copybrief grouped_rolling_window @@ -268,7 +269,7 @@ std::unique_ptr grouped_rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * @param default_outputs A column of per-row default values to be returned instead * of nulls. Used for LEAD()/LAG(), if the row offset crosses @@ -282,7 +283,7 @@ std::unique_ptr grouped_rolling_window( size_type following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief @copybrief grouped_rolling_window @@ -294,7 +295,7 @@ std::unique_ptr grouped_rolling_window( * size_type following_window, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr grouped_rolling_window( table_view const& group_keys, @@ -304,7 +305,7 @@ std::unique_ptr grouped_rolling_window( window_bounds following_window, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Applies a grouping-aware, timestamp-based rolling window function to the values in a @@ -399,7 +400,7 @@ std::unique_ptr grouped_time_range_rolling_window( size_type following_window_in_days, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Applies a grouping-aware, timestamp-based rolling window function to the values in a @@ -414,7 +415,7 @@ std::unique_ptr grouped_time_range_rolling_window( * size_type following_window_in_days, * size_type min_periods, * rolling_aggregation const& aggr, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) * * The `preceding_window_in_days` and `following_window_in_days` are specified as a `window_bounds` * and supports "unbounded" windows, if set to `window_bounds::unbounded()`. @@ -428,7 +429,7 @@ std::unique_ptr grouped_time_range_rolling_window( window_bounds following_window_in_days, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Applies a grouping-aware, value range-based rolling window function to the values in a @@ -548,7 +549,7 @@ std::unique_ptr grouped_range_rolling_window( range_window_bounds const& following, size_type min_periods, rolling_aggregation const& aggr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Applies a variable-size rolling window function to the values in a column. @@ -591,7 +592,7 @@ std::unique_ptr rolling_window( column_view const& following_window, size_type min_periods, rolling_aggregation const& agg, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/round.hpp b/cpp/include/cudf/round.hpp index ee088628b94..85935f8f05c 100644 --- a/cpp/include/cudf/round.hpp +++ b/cpp/include/cudf/round.hpp @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { @@ -72,9 +73,9 @@ enum class rounding_method : int32_t { HALF_UP, HALF_EVEN }; */ std::unique_ptr round( column_view const& input, - int32_t decimal_places = 0, - rounding_method method = rounding_method::HALF_UP, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + int32_t decimal_places = 0, + rounding_method method = rounding_method::HALF_UP, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/scalar/scalar.hpp b/cpp/include/cudf/scalar/scalar.hpp index 08bffab5067..da1d0d743a7 100644 --- a/cpp/include/cudf/scalar/scalar.hpp +++ b/cpp/include/cudf/scalar/scalar.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include #include +#include /** * @file @@ -112,8 +113,8 @@ class scalar { * @param mr Device memory resource to use for device memory allocation. */ scalar(scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new scalar object. @@ -127,9 +128,9 @@ class scalar { * @param mr Device memory resource to use for device memory allocation. */ scalar(data_type type, - bool is_valid = false, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = false, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); }; namespace detail { @@ -164,8 +165,8 @@ class fixed_width_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ fixed_width_scalar(fixed_width_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Set the value of the scalar. @@ -214,9 +215,9 @@ class fixed_width_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ fixed_width_scalar(T value, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new fixed width scalar object from existing device memory. @@ -227,9 +228,9 @@ class fixed_width_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ fixed_width_scalar(rmm::device_scalar&& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); }; } // namespace detail @@ -264,8 +265,8 @@ class numeric_scalar : public detail::fixed_width_scalar { * @param mr Device memory resource to use for device memory allocation. */ numeric_scalar(numeric_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new numeric scalar object. @@ -276,9 +277,9 @@ class numeric_scalar : public detail::fixed_width_scalar { * @param mr Device memory resource to use for device memory allocation. */ numeric_scalar(T value, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new numeric scalar object from existing device memory. @@ -289,9 +290,9 @@ class numeric_scalar : public detail::fixed_width_scalar { * @param mr Device memory resource to use for device memory allocation. */ numeric_scalar(rmm::device_scalar&& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); }; /** @@ -327,8 +328,8 @@ class fixed_point_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ fixed_point_scalar(fixed_point_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new fixed_point scalar object from already shifted value and scale. @@ -341,9 +342,9 @@ class fixed_point_scalar : public scalar { */ fixed_point_scalar(rep_type value, numeric::scale_type scale, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new fixed_point scalar object from a value and default 0-scale. @@ -354,9 +355,9 @@ class fixed_point_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ fixed_point_scalar(rep_type value, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new fixed_point scalar object from a fixed_point number. @@ -367,9 +368,9 @@ class fixed_point_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ fixed_point_scalar(T value, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new fixed_point scalar object from existing device memory. @@ -382,9 +383,9 @@ class fixed_point_scalar : public scalar { */ fixed_point_scalar(rmm::device_scalar&& data, numeric::scale_type scale, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Get the value of the scalar. @@ -451,8 +452,8 @@ class string_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ string_scalar(string_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new string scalar object. @@ -465,9 +466,9 @@ class string_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ string_scalar(std::string const& string, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new string scalar object from string_view. @@ -480,9 +481,9 @@ class string_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ string_scalar(value_type const& source, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new string scalar object from string_view in device memory. @@ -495,9 +496,9 @@ class string_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ string_scalar(rmm::device_scalar& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new string scalar object by moving an existing string data buffer. @@ -511,9 +512,9 @@ class string_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ string_scalar(rmm::device_buffer&& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Explicit conversion operator to get the value of the scalar in a host std::string. @@ -584,8 +585,8 @@ class chrono_scalar : public detail::fixed_width_scalar { * @param mr Device memory resource to use for device memory allocation. */ chrono_scalar(chrono_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new chrono scalar object. @@ -596,9 +597,9 @@ class chrono_scalar : public detail::fixed_width_scalar { * @param mr Device memory resource to use for device memory allocation. */ chrono_scalar(T value, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new chrono scalar object from existing device memory. @@ -609,9 +610,9 @@ class chrono_scalar : public detail::fixed_width_scalar { * @param mr Device memory resource to use for device memory allocation. */ chrono_scalar(rmm::device_scalar&& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); }; /** @@ -643,8 +644,8 @@ class timestamp_scalar : public chrono_scalar { * @param mr Device memory resource to use for device memory allocation. */ timestamp_scalar(timestamp_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new timestamp scalar object from a duration that is @@ -659,8 +660,8 @@ class timestamp_scalar : public chrono_scalar { template timestamp_scalar(Duration2 const& value, bool is_valid, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the duration in number of ticks since the UNIX epoch. @@ -699,8 +700,8 @@ class duration_scalar : public chrono_scalar { * @param mr Device memory resource to use for device memory allocation. */ duration_scalar(duration_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new duration scalar object from tick counts. @@ -712,8 +713,8 @@ class duration_scalar : public chrono_scalar { */ duration_scalar(rep_type value, bool is_valid, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the duration in number of ticks. @@ -748,8 +749,8 @@ class list_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ list_scalar(list_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new list scalar object from column_view. @@ -762,9 +763,9 @@ class list_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ list_scalar(cudf::column_view const& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new list scalar object from existing column. @@ -775,9 +776,9 @@ class list_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ list_scalar(cudf::column&& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a non-owning, immutable view to underlying device data. @@ -813,8 +814,8 @@ class struct_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ struct_scalar(struct_scalar const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new struct scalar object from table_view. @@ -827,9 +828,9 @@ class struct_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ struct_scalar(table_view const& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new struct scalar object from a host_span of column_views. @@ -842,9 +843,9 @@ class struct_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ struct_scalar(host_span data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new struct scalar object from an existing table in device memory. @@ -858,9 +859,9 @@ class struct_scalar : public scalar { * @param mr Device memory resource to use for device memory allocation. */ struct_scalar(table&& data, - bool is_valid = true, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + bool is_valid = true, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a non-owning, immutable view to underlying device data. @@ -888,7 +889,7 @@ class struct_scalar : public scalar { static table init_data(table&& data, bool is_valid, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); }; /** @} */ // end of group diff --git a/cpp/include/cudf/scalar/scalar_factories.hpp b/cpp/include/cudf/scalar/scalar_factories.hpp index 78b6c4fd0e9..7dd4674a2fd 100644 --- a/cpp/include/cudf/scalar/scalar_factories.hpp +++ b/cpp/include/cudf/scalar/scalar_factories.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { /** @@ -43,8 +44,8 @@ namespace cudf { */ std::unique_ptr make_numeric_scalar( data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct scalar with uninitialized storage to hold a value of the @@ -60,8 +61,8 @@ std::unique_ptr make_numeric_scalar( */ std::unique_ptr make_timestamp_scalar( data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct scalar with uninitialized storage to hold a value of the @@ -77,8 +78,8 @@ std::unique_ptr make_timestamp_scalar( */ std::unique_ptr make_duration_scalar( data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct scalar with uninitialized storage to hold a value of the @@ -94,8 +95,8 @@ std::unique_ptr make_duration_scalar( */ std::unique_ptr make_fixed_width_scalar( data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct STRING type scalar given a `std::string`. @@ -111,8 +112,8 @@ std::unique_ptr make_fixed_width_scalar( */ std::unique_ptr make_string_scalar( std::string const& string, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Constructs default constructed scalar of type `type` @@ -126,8 +127,8 @@ std::unique_ptr make_string_scalar( */ std::unique_ptr make_default_constructed_scalar( data_type type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates an empty (invalid) scalar of the same type as the `input` column_view. @@ -141,8 +142,8 @@ std::unique_ptr make_default_constructed_scalar( */ std::unique_ptr make_empty_scalar_like( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct scalar using the given value of fixed width type @@ -156,8 +157,8 @@ std::unique_ptr make_empty_scalar_like( template std::unique_ptr make_fixed_width_scalar( T value, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { return std::make_unique>(value, true, stream, mr); } @@ -176,8 +177,8 @@ template std::unique_ptr make_fixed_point_scalar( typename T::rep value, numeric::scale_type scale, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { return std::make_unique>(value, scale, true, stream, mr); } @@ -192,8 +193,8 @@ std::unique_ptr make_fixed_point_scalar( */ std::unique_ptr make_list_scalar( column_view elements, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a struct scalar using the given table_view. @@ -207,8 +208,8 @@ std::unique_ptr make_list_scalar( */ std::unique_ptr make_struct_scalar( table_view const& data, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a struct scalar using the given span of column views. @@ -222,8 +223,8 @@ std::unique_ptr make_struct_scalar( */ std::unique_ptr make_struct_scalar( host_span data, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/search.hpp b/cpp/include/cudf/search.hpp index 49acce6a63b..2e50ba2d687 100644 --- a/cpp/include/cudf/search.hpp +++ b/cpp/include/cudf/search.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -72,8 +73,8 @@ std::unique_ptr lower_bound( table_view const& needles, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Find largest indices in a sorted table where values should be inserted to maintain order. @@ -114,8 +115,8 @@ std::unique_ptr upper_bound( table_view const& needles, std::vector const& column_order, std::vector const& null_precedence, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Check if the given `needle` value exists in the `haystack` column. @@ -163,8 +164,8 @@ bool contains(column_view const& haystack, std::unique_ptr contains( column_view const& haystack, column_view const& needles, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/sorting.hpp b/cpp/include/cudf/sorting.hpp index 42bcb5da8e3..79a00cbce42 100644 --- a/cpp/include/cudf/sorting.hpp +++ b/cpp/include/cudf/sorting.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -54,7 +55,7 @@ std::unique_ptr sorted_order( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the row indices that would produce `input` in a stable @@ -69,7 +70,7 @@ std::unique_ptr stable_sorted_order( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Checks whether the rows of a `table` are sorted in a lexicographical @@ -113,7 +114,7 @@ std::unique_ptr
sort( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a stable lexicographic sort of the rows of a table @@ -125,7 +126,7 @@ std::unique_ptr
stable_sort( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a key-value sort. @@ -155,7 +156,7 @@ std::unique_ptr
sort_by_key( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a key-value stable sort. @@ -168,7 +169,7 @@ std::unique_ptr
stable_sort_by_key( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Computes the ranks of input column in sorted order. @@ -207,8 +208,8 @@ std::unique_ptr rank( null_policy null_handling, null_order null_precedence, bool percentage, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns sorted order after sorting each segment in the table. @@ -259,7 +260,7 @@ std::unique_ptr segmented_sorted_order( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns sorted order after stably sorting each segment in the table. @@ -272,7 +273,7 @@ std::unique_ptr stable_segmented_sorted_order( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a lexicographic segmented sort of a table @@ -328,7 +329,7 @@ std::unique_ptr
segmented_sort_by_key( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Performs a stably lexicographic segmented sort of a table @@ -342,7 +343,7 @@ std::unique_ptr
stable_segmented_sort_by_key( std::vector const& column_order = {}, std::vector const& null_precedence = {}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/stream_compaction.hpp b/cpp/include/cudf/stream_compaction.hpp index 3e7bdf13707..c386b3a22b4 100644 --- a/cpp/include/cudf/stream_compaction.hpp +++ b/cpp/include/cudf/stream_compaction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -73,7 +74,7 @@ std::unique_ptr
drop_nulls( table_view const& input, std::vector const& keys, cudf::size_type keep_threshold, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Filters a table to remove null elements. @@ -104,7 +105,7 @@ std::unique_ptr
drop_nulls( std::unique_ptr
drop_nulls( table_view const& input, std::vector const& keys, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Filters a table to remove NANs with threshold count. @@ -147,7 +148,7 @@ std::unique_ptr
drop_nans( table_view const& input, std::vector const& keys, cudf::size_type keep_threshold, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Filters a table to remove NANs. @@ -179,7 +180,7 @@ std::unique_ptr
drop_nans( std::unique_ptr
drop_nans( table_view const& input, std::vector const& keys, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Filters `input` using `boolean_mask` of boolean values as a mask. @@ -205,7 +206,7 @@ std::unique_ptr
drop_nans( std::unique_ptr
apply_boolean_mask( table_view const& input, column_view const& boolean_mask, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Choices for drop_duplicates API for retainment of duplicate rows @@ -248,8 +249,8 @@ std::unique_ptr
unique( table_view const& input, std::vector const& keys, duplicate_keep_option keep, - null_equality nulls_equal = null_equality::EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + null_equality nulls_equal = null_equality::EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a new table without duplicate rows. @@ -273,10 +274,10 @@ std::unique_ptr
unique( std::unique_ptr
distinct( table_view const& input, std::vector const& keys, - duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a column of indices of all distinct rows in the input table. @@ -294,11 +295,11 @@ std::unique_ptr
distinct( */ std::unique_ptr distinct_indices( table_view const& input, - duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Create a new table without duplicate rows, preserving input order. @@ -325,10 +326,10 @@ std::unique_ptr distinct_indices( std::unique_ptr
stable_distinct( table_view const& input, std::vector const& keys, - duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, - null_equality nulls_equal = null_equality::EQUAL, - nan_equality nans_equal = nan_equality::ALL_EQUAL, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY, + null_equality nulls_equal = null_equality::EQUAL, + nan_equality nans_equal = nan_equality::ALL_EQUAL, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Count the number of consecutive groups of equivalent rows in a column. diff --git a/cpp/include/cudf/strings/attributes.hpp b/cpp/include/cudf/strings/attributes.hpp index 85086e44a26..26f906b3102 100644 --- a/cpp/include/cudf/strings/attributes.hpp +++ b/cpp/include/cudf/strings/attributes.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { @@ -47,7 +48,7 @@ namespace strings { */ std::unique_ptr count_characters( strings_column_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column containing byte lengths @@ -65,7 +66,7 @@ std::unique_ptr count_characters( */ std::unique_ptr count_bytes( strings_column_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a numeric column with code point values (integers) for each @@ -85,7 +86,7 @@ std::unique_ptr count_bytes( */ std::unique_ptr code_points( strings_column_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of strings_apis group diff --git a/cpp/include/cudf/strings/capitalize.hpp b/cpp/include/cudf/strings/capitalize.hpp index 57375e9ac6a..f8cbdc09748 100644 --- a/cpp/include/cudf/strings/capitalize.hpp +++ b/cpp/include/cudf/strings/capitalize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -60,9 +61,9 @@ namespace strings { */ std::unique_ptr capitalize( strings_column_view const& input, - string_scalar const& delimiters = string_scalar("", true, cudf::get_default_stream()), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiters = string_scalar("", true, cudf::get_default_stream()), + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Modifies first character of each word to upper-case and lower-cases the rest. @@ -95,7 +96,7 @@ std::unique_ptr title( strings_column_view const& input, string_character_types sequence_type = string_character_types::ALPHA, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Checks if the strings in the input column are title formatted. @@ -123,8 +124,8 @@ std::unique_ptr title( */ std::unique_ptr is_title( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/case.hpp b/cpp/include/cudf/strings/case.hpp index 94191686a92..5403fa8db7e 100644 --- a/cpp/include/cudf/strings/case.hpp +++ b/cpp/include/cudf/strings/case.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -44,8 +45,8 @@ namespace strings { */ std::unique_ptr to_lower( strings_column_view const& strings, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Converts a column of strings to upper case. @@ -63,8 +64,8 @@ std::unique_ptr to_lower( */ std::unique_ptr to_upper( strings_column_view const& strings, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of strings converting lower case characters to @@ -83,8 +84,8 @@ std::unique_ptr to_upper( */ std::unique_ptr swapcase( strings_column_view const& strings, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/char_types/char_types.hpp b/cpp/include/cudf/strings/char_types/char_types.hpp index c6db5dab08a..da7a238a400 100644 --- a/cpp/include/cudf/strings/char_types/char_types.hpp +++ b/cpp/include/cudf/strings/char_types/char_types.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -67,7 +68,7 @@ std::unique_ptr all_characters_of_type( string_character_types types, string_character_types verify_types = string_character_types::ALL_TYPES, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Filter specific character types from a column of strings. @@ -114,7 +115,7 @@ std::unique_ptr filter_characters_of_type( string_scalar const& replacement = string_scalar(""), string_character_types types_to_keep = string_character_types::ALL_TYPES, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/combine.hpp b/cpp/include/cudf/strings/combine.hpp index 568e8ac50ec..8cc735831b8 100644 --- a/cpp/include/cudf/strings/combine.hpp +++ b/cpp/include/cudf/strings/combine.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -77,10 +78,10 @@ enum class output_if_empty_list { */ std::unique_ptr join_strings( strings_column_view const& input, - string_scalar const& separator = string_scalar(""), - string_scalar const& narep = string_scalar("", false), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& separator = string_scalar(""), + string_scalar const& narep = string_scalar("", false), + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Concatenates a list of strings columns using separators for each row @@ -148,7 +149,7 @@ std::unique_ptr concatenate( string_scalar const& col_narep = string_scalar("", false), separator_on_nulls separate_nulls = separator_on_nulls::YES, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Row-wise concatenates the given list of strings columns and @@ -199,11 +200,11 @@ std::unique_ptr concatenate( */ std::unique_ptr concatenate( table_view const& strings_columns, - string_scalar const& separator = string_scalar(""), - string_scalar const& narep = string_scalar("", false), - separator_on_nulls separate_nulls = separator_on_nulls::YES, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& separator = string_scalar(""), + string_scalar const& narep = string_scalar("", false), + separator_on_nulls separate_nulls = separator_on_nulls::YES, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Given a lists column of strings (each row is a list of strings), concatenates the strings @@ -270,7 +271,7 @@ std::unique_ptr join_list_elements( separator_on_nulls separate_nulls = separator_on_nulls::YES, output_if_empty_list empty_list_policy = output_if_empty_list::EMPTY_STRING, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Given a lists column of strings (each row is a list of strings), concatenates the strings @@ -329,7 +330,7 @@ std::unique_ptr join_list_elements( separator_on_nulls separate_nulls = separator_on_nulls::YES, output_if_empty_list empty_list_policy = output_if_empty_list::EMPTY_STRING, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/contains.hpp b/cpp/include/cudf/strings/contains.hpp index 341c146df92..f79a0f19e9c 100644 --- a/cpp/include/cudf/strings/contains.hpp +++ b/cpp/include/cudf/strings/contains.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -59,8 +60,8 @@ struct regex_program; std::unique_ptr contains_re( strings_column_view const& input, regex_program const& prog, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying rows which @@ -87,8 +88,8 @@ std::unique_ptr contains_re( std::unique_ptr matches_re( strings_column_view const& input, regex_program const& prog, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the number of times the given regex_program's pattern @@ -115,8 +116,8 @@ std::unique_ptr matches_re( std::unique_ptr count_re( strings_column_view const& input, regex_program const& prog, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying rows which @@ -163,7 +164,7 @@ std::unique_ptr like( string_scalar const& pattern, string_scalar const& escape_character = string_scalar(""), rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying rows which @@ -204,7 +205,7 @@ std::unique_ptr like( strings_column_view const& patterns, string_scalar const& escape_character = string_scalar(""), rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_booleans.hpp b/cpp/include/cudf/strings/convert/convert_booleans.hpp index 9e9f25e800a..9c922361914 100644 --- a/cpp/include/cudf/strings/convert/convert_booleans.hpp +++ b/cpp/include/cudf/strings/convert/convert_booleans.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -44,8 +45,8 @@ namespace strings { std::unique_ptr to_booleans( strings_column_view const& input, string_scalar const& true_string, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting the boolean values from the @@ -66,8 +67,8 @@ std::unique_ptr from_booleans( column_view const& booleans, string_scalar const& true_string, string_scalar const& false_string, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_datetime.hpp b/cpp/include/cudf/strings/convert/convert_datetime.hpp index 81cce14b53b..b89384d718b 100644 --- a/cpp/include/cudf/strings/convert/convert_datetime.hpp +++ b/cpp/include/cudf/strings/convert/convert_datetime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -88,8 +89,8 @@ std::unique_ptr to_timestamps( strings_column_view const& input, data_type timestamp_type, std::string_view format, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Verifies the given strings column can be parsed to timestamps using the provided format @@ -135,8 +136,8 @@ std::unique_ptr to_timestamps( std::unique_ptr is_timestamp( strings_column_view const& input, std::string_view format, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting a timestamp column into @@ -246,11 +247,11 @@ std::unique_ptr is_timestamp( */ std::unique_ptr from_timestamps( column_view const& timestamps, - std::string_view format = "%Y-%m-%dT%H:%M:%SZ", - strings_column_view const& names = strings_column_view(column_view{ + std::string_view format = "%Y-%m-%dT%H:%M:%SZ", + strings_column_view const& names = strings_column_view(column_view{ data_type{type_id::STRING}, 0, nullptr, nullptr, 0}), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_durations.hpp b/cpp/include/cudf/strings/convert/convert_durations.hpp index a1f4e4ead1d..2db719a4f1f 100644 --- a/cpp/include/cudf/strings/convert/convert_durations.hpp +++ b/cpp/include/cudf/strings/convert/convert_durations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -76,8 +77,8 @@ std::unique_ptr to_durations( strings_column_view const& input, data_type duration_type, std::string_view format, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting a duration column into @@ -126,9 +127,9 @@ std::unique_ptr to_durations( */ std::unique_ptr from_durations( column_view const& durations, - std::string_view format = "%D days %H:%M:%S", - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + std::string_view format = "%D days %H:%M:%S", + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_fixed_point.hpp b/cpp/include/cudf/strings/convert/convert_fixed_point.hpp index 8f37715967a..9911bea1948 100644 --- a/cpp/include/cudf/strings/convert/convert_fixed_point.hpp +++ b/cpp/include/cudf/strings/convert/convert_fixed_point.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -62,8 +63,8 @@ namespace strings { std::unique_ptr to_fixed_point( strings_column_view const& input, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting the fixed-point values @@ -92,8 +93,8 @@ std::unique_ptr to_fixed_point( */ std::unique_ptr from_fixed_point( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying strings in which all @@ -123,9 +124,9 @@ std::unique_ptr from_fixed_point( */ std::unique_ptr is_fixed_point( strings_column_view const& input, - data_type decimal_type = data_type{type_id::DECIMAL64}, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + data_type decimal_type = data_type{type_id::DECIMAL64}, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_floats.hpp b/cpp/include/cudf/strings/convert/convert_floats.hpp index a35cb68ef4e..feb5b528686 100644 --- a/cpp/include/cudf/strings/convert/convert_floats.hpp +++ b/cpp/include/cudf/strings/convert/convert_floats.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -48,8 +49,8 @@ namespace strings { std::unique_ptr to_floats( strings_column_view const& strings, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting the float values from the @@ -71,8 +72,8 @@ std::unique_ptr to_floats( */ std::unique_ptr from_floats( column_view const& floats, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying strings in which all @@ -97,8 +98,8 @@ std::unique_ptr from_floats( */ std::unique_ptr is_float( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_integers.hpp b/cpp/include/cudf/strings/convert/convert_integers.hpp index 74ec5d315a2..82696811fdc 100644 --- a/cpp/include/cudf/strings/convert/convert_integers.hpp +++ b/cpp/include/cudf/strings/convert/convert_integers.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -55,8 +56,8 @@ namespace strings { std::unique_ptr to_integers( strings_column_view const& input, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting the integer values from the @@ -76,8 +77,8 @@ std::unique_ptr to_integers( */ std::unique_ptr from_integers( column_view const& integers, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying strings in which all @@ -105,8 +106,8 @@ std::unique_ptr from_integers( */ std::unique_ptr is_integer( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying strings in which all @@ -139,8 +140,8 @@ std::unique_ptr is_integer( std::unique_ptr is_integer( strings_column_view const& input, data_type int_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new integer numeric column parsing hexadecimal values from the @@ -169,8 +170,8 @@ std::unique_ptr is_integer( std::unique_ptr hex_to_integers( strings_column_view const& input, data_type output_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying strings in which all @@ -196,8 +197,8 @@ std::unique_ptr hex_to_integers( */ std::unique_ptr is_hex( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column converting integer columns to hexadecimal @@ -229,8 +230,8 @@ std::unique_ptr is_hex( */ std::unique_ptr integers_to_hex( column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_ipv4.hpp b/cpp/include/cudf/strings/convert/convert_ipv4.hpp index 25ad7b86748..64f8a412ce9 100644 --- a/cpp/include/cudf/strings/convert/convert_ipv4.hpp +++ b/cpp/include/cudf/strings/convert/convert_ipv4.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -55,8 +56,8 @@ namespace strings { */ std::unique_ptr ipv4_to_integers( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Converts integers into IPv4 addresses as strings. @@ -80,8 +81,8 @@ std::unique_ptr ipv4_to_integers( */ std::unique_ptr integers_to_ipv4( column_view const& integers, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a boolean column identifying strings in which all @@ -107,8 +108,8 @@ std::unique_ptr integers_to_ipv4( */ std::unique_ptr is_ipv4( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_lists.hpp b/cpp/include/cudf/strings/convert/convert_lists.hpp index dedf4e95138..a88bbe99492 100644 --- a/cpp/include/cudf/strings/convert/convert_lists.hpp +++ b/cpp/include/cudf/strings/convert/convert_lists.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -63,7 +64,7 @@ std::unique_ptr format_list_column( strings_column_view const& separators = strings_column_view(column_view{ data_type{type_id::STRING}, 0, nullptr, nullptr, 0}), rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/convert/convert_urls.hpp b/cpp/include/cudf/strings/convert/convert_urls.hpp index 902835081af..30988d2ff0a 100644 --- a/cpp/include/cudf/strings/convert/convert_urls.hpp +++ b/cpp/include/cudf/strings/convert/convert_urls.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -46,8 +47,8 @@ namespace strings { */ std::unique_ptr url_encode( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Encodes each string using URL encoding. @@ -69,8 +70,8 @@ std::unique_ptr url_encode( */ std::unique_ptr url_decode( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/detail/combine.hpp b/cpp/include/cudf/strings/detail/combine.hpp index 3b8ed0f4e0d..25214055787 100644 --- a/cpp/include/cudf/strings/detail/combine.hpp +++ b/cpp/include/cudf/strings/detail/combine.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -30,7 +31,7 @@ namespace detail { /** * @copydoc concatenate(table_view const&,string_scalar const&,string_scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -39,11 +40,11 @@ std::unique_ptr concatenate(table_view const& strings_columns, string_scalar const& narep, separator_on_nulls separate_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc join_strings(table_view const&,string_scalar const&,string_scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -51,11 +52,11 @@ std::unique_ptr join_strings(strings_column_view const& strings, string_scalar const& separator, string_scalar const& narep, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc join_list_elements(table_view const&,string_scalar const&,string_scalar - * const&,separator_on_nulls,output_if_empty_list,rmm::mr::device_memory_resource*) + * const&,separator_on_nulls,output_if_empty_list,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -65,7 +66,7 @@ std::unique_ptr join_list_elements(lists_column_view const& lists_string separator_on_nulls separate_nulls, output_if_empty_list empty_list_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/concatenate.hpp b/cpp/include/cudf/strings/detail/concatenate.hpp index 511e240886a..b5dd5b9516a 100644 --- a/cpp/include/cudf/strings/detail/concatenate.hpp +++ b/cpp/include/cudf/strings/detail/concatenate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -44,7 +45,7 @@ namespace detail { */ std::unique_ptr concatenate(host_span columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/converters.hpp b/cpp/include/cudf/strings/detail/converters.hpp index 3337815342c..d212239264b 100644 --- a/cpp/include/cudf/strings/detail/converters.hpp +++ b/cpp/include/cudf/strings/detail/converters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,63 +20,64 @@ #include #include +#include namespace cudf { namespace strings { namespace detail { /** - * @copydoc to_integers(strings_column_view const&,data_type,rmm::mr::device_memory_resource*) + * @copydoc to_integers(strings_column_view const&,data_type,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr to_integers(strings_column_view const& strings, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc from_integers(strings_column_view const&,rmm::mr::device_memory_resource*) + * @copydoc from_integers(strings_column_view const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr from_integers(column_view const& integers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc to_floats(strings_column_view const&,data_type,rmm::mr::device_memory_resource*) + * @copydoc to_floats(strings_column_view const&,data_type,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr to_floats(strings_column_view const& strings, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc from_floats(strings_column_view const&,rmm::mr::device_memory_resource*) + * @copydoc from_floats(strings_column_view const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr from_floats(column_view const& floats, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc to_booleans(strings_column_view const&,string_scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr to_booleans(strings_column_view const& strings, string_scalar const& true_string, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc from_booleans(strings_column_view const&,string_scalar const&,string_scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -84,11 +85,11 @@ std::unique_ptr from_booleans(column_view const& booleans, string_scalar const& true_string, string_scalar const& false_string, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc to_timestamps(strings_column_view const&,data_type,std::string_view, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -96,11 +97,11 @@ std::unique_ptr to_timestamps(strings_column_view const& strings, data_type timestamp_type, std::string_view format, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc from_timestamps(strings_column_view const&,std::string_view, - * strings_column_view const&,rmm::mr::device_memory_resource*) + * strings_column_view const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -108,11 +109,11 @@ std::unique_ptr from_timestamps(column_view const& timestamps, std::string_view format, strings_column_view const& names, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc to_durations(strings_column_view const&,data_type,std::string_view, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -120,37 +121,37 @@ std::unique_ptr to_durations(strings_column_view const& strings, data_type duration_type, std::string_view format, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc from_durations(strings_column_view const&,std::string_view. - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr from_durations(column_view const& durations, std::string_view format, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc to_fixed_point(strings_column_view const&,data_type,rmm::mr::device_memory_resource*) + * @copydoc to_fixed_point(strings_column_view const&,data_type,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr to_fixed_point(strings_column_view const& strings, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** - * @copydoc from_fixed_point(strings_column_view const&,rmm::mr::device_memory_resource*) + * @copydoc from_fixed_point(strings_column_view const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ std::unique_ptr from_fixed_point(column_view const& integers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/copy_if_else.cuh b/cpp/include/cudf/strings/detail/copy_if_else.cuh index 08ba99e90d8..4db7651330b 100644 --- a/cpp/include/cudf/strings/detail/copy_if_else.cuh +++ b/cpp/include/cudf/strings/detail/copy_if_else.cuh @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,7 @@ std::unique_ptr copy_if_else(StringIterLeft lhs_begin, StringIterRight rhs_begin, Filter filter_fn, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto strings_count = std::distance(lhs_begin, lhs_end); if (strings_count == 0) { return make_empty_column(type_id::STRING); } diff --git a/cpp/include/cudf/strings/detail/copy_range.hpp b/cpp/include/cudf/strings/detail/copy_range.hpp index e18f1fdc5ad..192c5b833c6 100644 --- a/cpp/include/cudf/strings/detail/copy_range.hpp +++ b/cpp/include/cudf/strings/detail/copy_range.hpp @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -53,7 +54,7 @@ std::unique_ptr copy_range(strings_column_view const& source, size_type source_end, size_type target_begin, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/copying.hpp b/cpp/include/cudf/strings/detail/copying.hpp index 7e82ad4c679..240cac17188 100644 --- a/cpp/include/cudf/strings/detail/copying.hpp +++ b/cpp/include/cudf/strings/detail/copying.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -53,7 +54,7 @@ std::unique_ptr copy_slice(strings_column_view const& strings, size_type start, size_type end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Returns a new strings column created by shifting the rows by a specified offset. @@ -80,7 +81,7 @@ std::unique_ptr shift(strings_column_view const& input, size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/fill.hpp b/cpp/include/cudf/strings/detail/fill.hpp index 43e3f6198f3..c5d005fbf75 100644 --- a/cpp/include/cudf/strings/detail/fill.hpp +++ b/cpp/include/cudf/strings/detail/fill.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -47,7 +48,7 @@ std::unique_ptr fill(strings_column_view const& strings, size_type end, string_scalar const& value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/gather.cuh b/cpp/include/cudf/strings/detail/gather.cuh index 06d959acffb..94bce6bddd5 100644 --- a/cpp/include/cudf/strings/detail/gather.cuh +++ b/cpp/include/cudf/strings/detail/gather.cuh @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -227,7 +228,7 @@ rmm::device_uvector gather_chars(StringIterator strings_begin, cudf::detail::input_offsetalator const offsets, size_type chars_bytes, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const output_count = std::distance(map_begin, map_end); if (output_count == 0) return rmm::device_uvector(0, stream, mr); @@ -290,7 +291,7 @@ std::unique_ptr gather(strings_column_view const& strings, MapIterator begin, MapIterator end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const output_count = std::distance(begin, end); if (output_count == 0) return make_empty_column(type_id::STRING); @@ -354,7 +355,7 @@ std::unique_ptr gather(strings_column_view const& strings, MapIterator end, bool nullify_out_of_bounds, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (nullify_out_of_bounds) return gather(strings, begin, end, stream, mr); return gather(strings, begin, end, stream, mr); diff --git a/cpp/include/cudf/strings/detail/merge.cuh b/cpp/include/cudf/strings/detail/merge.cuh index f05e957783f..457c2b7f740 100644 --- a/cpp/include/cudf/strings/detail/merge.cuh +++ b/cpp/include/cudf/strings/detail/merge.cuh @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -56,7 +57,7 @@ std::unique_ptr merge(strings_column_view const& lhs, row_order_iterator begin, row_order_iterator end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using cudf::detail::side; size_type strings_count = static_cast(std::distance(begin, end)); diff --git a/cpp/include/cudf/strings/detail/replace.hpp b/cpp/include/cudf/strings/detail/replace.hpp index 0f050f057fa..aad89beb47e 100644 --- a/cpp/include/cudf/strings/detail/replace.hpp +++ b/cpp/include/cudf/strings/detail/replace.hpp @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -28,24 +29,24 @@ namespace detail { /** * @copydoc cudf::strings::replace(strings_column_view const&, string_scalar const&, - * string_scalar const&, int32_t, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + * string_scalar const&, int32_t, rmm::cuda_stream_view, rmm::device_async_resource_ref) */ std::unique_ptr replace(strings_column_view const& strings, string_scalar const& target, string_scalar const& repl, int32_t maxrepl, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::strings::replace(strings_column_view const&, strings_column_view const&, - * strings_column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + * strings_column_view const&, rmm::cuda_stream_view, rmm::device_async_resource_ref) */ std::unique_ptr replace(strings_column_view const& strings, strings_column_view const& targets, strings_column_view const& repls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Replaces any null string entries with the given string. @@ -68,18 +69,18 @@ std::unique_ptr replace(strings_column_view const& strings, std::unique_ptr replace_nulls(strings_column_view const& strings, string_scalar const& repl, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::strings::replace_slice(strings_column_view const&, string_scalar const&, - * size_type, size_type, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + * size_type, size_type, rmm::cuda_stream_view, rmm::device_async_resource_ref) */ std::unique_ptr replace_slice(strings_column_view const& strings, string_scalar const& repl, size_type start, size_type stop, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Return a copy of `input` replacing any `values_to_replace[i]` @@ -97,7 +98,7 @@ std::unique_ptr find_and_replace_all( cudf::strings_column_view const& values_to_replace, cudf::strings_column_view const& replacement_values, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/scan.hpp b/cpp/include/cudf/strings/detail/scan.hpp index 611e32e28cd..f32afa64a72 100644 --- a/cpp/include/cudf/strings/detail/scan.hpp +++ b/cpp/include/cudf/strings/detail/scan.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -40,7 +41,7 @@ template std::unique_ptr scan_inclusive(column_view const& input, bitmask_type const* mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace strings diff --git a/cpp/include/cudf/strings/detail/scatter.cuh b/cpp/include/cudf/strings/detail/scatter.cuh index 8b8c11dcd5c..87f0e7ae47c 100644 --- a/cpp/include/cudf/strings/detail/scatter.cuh +++ b/cpp/include/cudf/strings/detail/scatter.cuh @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -63,7 +64,7 @@ std::unique_ptr scatter(SourceIterator begin, MapIterator scatter_map, strings_column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (target.is_empty()) return make_empty_column(type_id::STRING); diff --git a/cpp/include/cudf/strings/detail/strings_children.cuh b/cpp/include/cudf/strings/detail/strings_children.cuh index 49c4be88ca5..7136df325f4 100644 --- a/cpp/include/cudf/strings/detail/strings_children.cuh +++ b/cpp/include/cudf/strings/detail/strings_children.cuh @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -56,7 +57,7 @@ auto make_strings_children(SizeAndExecuteFunction size_and_exec_fn, size_type exec_size, size_type strings_count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto offsets_column = make_numeric_column( data_type{type_to_id()}, strings_count + 1, mask_state::UNALLOCATED, stream, mr); @@ -116,7 +117,7 @@ template auto make_strings_children(SizeAndExecuteFunction size_and_exec_fn, size_type strings_count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return make_strings_children(size_and_exec_fn, strings_count, strings_count, stream, mr); } @@ -142,7 +143,7 @@ std::pair, int64_t> make_offsets_child_column( InputIterator begin, InputIterator end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto constexpr size_type_max = static_cast(std::numeric_limits::max()); auto const lcount = static_cast(std::distance(begin, end)); diff --git a/cpp/include/cudf/strings/detail/strings_column_factories.cuh b/cpp/include/cudf/strings/detail/strings_column_factories.cuh index 8e19f08a5cc..079b6a73e0b 100644 --- a/cpp/include/cudf/strings/detail/strings_column_factories.cuh +++ b/cpp/include/cudf/strings/detail/strings_column_factories.cuh @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -73,7 +74,7 @@ template std::unique_ptr make_strings_column(IndexPairIterator begin, IndexPairIterator end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); size_type strings_count = thrust::distance(begin, end); @@ -163,7 +164,7 @@ std::unique_ptr make_strings_column(CharIterator chars_begin, size_type null_count, rmm::device_buffer&& null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); size_type strings_count = thrust::distance(offsets_begin, offsets_end) - 1; diff --git a/cpp/include/cudf/strings/detail/utilities.hpp b/cpp/include/cudf/strings/detail/utilities.hpp index cf9a13e9742..4467a9d0023 100644 --- a/cpp/include/cudf/strings/detail/utilities.hpp +++ b/cpp/include/cudf/strings/detail/utilities.hpp @@ -22,6 +22,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -43,7 +44,7 @@ namespace detail { std::unique_ptr create_offsets_child_column(int64_t chars_bytes, size_type count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Creates a string_view vector from a strings column. @@ -56,7 +57,7 @@ std::unique_ptr create_offsets_child_column(int64_t chars_bytes, rmm::device_uvector create_string_vector_from_column( cudf::strings_column_view const strings, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Return the threshold size for a strings column to use int64 offsets diff --git a/cpp/include/cudf/strings/extract.hpp b/cpp/include/cudf/strings/extract.hpp index a4db1ac46da..4138e1e59d5 100644 --- a/cpp/include/cudf/strings/extract.hpp +++ b/cpp/include/cudf/strings/extract.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -62,8 +63,8 @@ struct regex_program; std::unique_ptr
extract( strings_column_view const& input, regex_program const& prog, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a lists column of strings where each string column row corresponds to the @@ -98,8 +99,8 @@ std::unique_ptr
extract( std::unique_ptr extract_all_record( strings_column_view const& input, regex_program const& prog, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/find.hpp b/cpp/include/cudf/strings/find.hpp index c1aa8b294b3..c116dbc2fe1 100644 --- a/cpp/include/cudf/strings/find.hpp +++ b/cpp/include/cudf/strings/find.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -55,10 +56,10 @@ namespace strings { std::unique_ptr find( strings_column_view const& input, string_scalar const& target, - size_type start = 0, - size_type stop = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type start = 0, + size_type stop = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of character position values where the target @@ -86,10 +87,10 @@ std::unique_ptr find( std::unique_ptr rfind( strings_column_view const& input, string_scalar const& target, - size_type start = 0, - size_type stop = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type start = 0, + size_type stop = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of character position values where the target @@ -114,9 +115,9 @@ std::unique_ptr rfind( std::unique_ptr find( strings_column_view const& input, strings_column_view const& target, - size_type start = 0, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type start = 0, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of boolean values for each string where true indicates @@ -136,8 +137,8 @@ std::unique_ptr find( std::unique_ptr contains( strings_column_view const& input, string_scalar const& target, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of boolean values for each string where true indicates @@ -161,8 +162,8 @@ std::unique_ptr contains( std::unique_ptr contains( strings_column_view const& input, strings_column_view const& targets, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of boolean values for each string where true indicates @@ -183,8 +184,8 @@ std::unique_ptr contains( std::unique_ptr starts_with( strings_column_view const& input, string_scalar const& target, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of boolean values for each string where true indicates @@ -209,8 +210,8 @@ std::unique_ptr starts_with( std::unique_ptr starts_with( strings_column_view const& input, strings_column_view const& targets, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of boolean values for each string where true indicates @@ -231,8 +232,8 @@ std::unique_ptr starts_with( std::unique_ptr ends_with( strings_column_view const& input, string_scalar const& target, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a column of boolean values for each string where true indicates @@ -257,8 +258,8 @@ std::unique_ptr ends_with( std::unique_ptr ends_with( strings_column_view const& input, strings_column_view const& targets, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings } // namespace cudf diff --git a/cpp/include/cudf/strings/find_multiple.hpp b/cpp/include/cudf/strings/find_multiple.hpp index 06b851c5012..c2e82aa6f1a 100644 --- a/cpp/include/cudf/strings/find_multiple.hpp +++ b/cpp/include/cudf/strings/find_multiple.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -57,8 +58,8 @@ namespace strings { std::unique_ptr find_multiple( strings_column_view const& input, strings_column_view const& targets, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/findall.hpp b/cpp/include/cudf/strings/findall.hpp index 379b9624dc6..abc1d28ee4c 100644 --- a/cpp/include/cudf/strings/findall.hpp +++ b/cpp/include/cudf/strings/findall.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -64,8 +65,8 @@ struct regex_program; std::unique_ptr findall( strings_column_view const& input, regex_program const& prog, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/padding.hpp b/cpp/include/cudf/strings/padding.hpp index f0cb351eeda..f1382d6ea29 100644 --- a/cpp/include/cudf/strings/padding.hpp +++ b/cpp/include/cudf/strings/padding.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -58,10 +59,10 @@ namespace strings { std::unique_ptr pad( strings_column_view const& input, size_type width, - side_type side = side_type::RIGHT, - std::string_view fill_char = " ", - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + side_type side = side_type::RIGHT, + std::string_view fill_char = " ", + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Add '0' as padding to the left of each string. @@ -90,8 +91,8 @@ std::unique_ptr pad( std::unique_ptr zfill( strings_column_view const& input, size_type width, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/repeat_strings.hpp b/cpp/include/cudf/strings/repeat_strings.hpp index 7dc9c33f579..cbf1edc8331 100644 --- a/cpp/include/cudf/strings/repeat_strings.hpp +++ b/cpp/include/cudf/strings/repeat_strings.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -59,8 +60,8 @@ namespace strings { std::unique_ptr repeat_string( string_scalar const& input, size_type repeat_times, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Repeat each string in the given strings column a given number of times @@ -90,8 +91,8 @@ std::unique_ptr repeat_string( std::unique_ptr repeat_strings( strings_column_view const& input, size_type repeat_times, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Repeat each string in the given strings column by the numbers of times given in another @@ -127,8 +128,8 @@ std::unique_ptr repeat_strings( std::unique_ptr repeat_strings( strings_column_view const& input, column_view const& repeat_times, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/replace.hpp b/cpp/include/cudf/strings/replace.hpp index 2476a41e886..9525db44b69 100644 --- a/cpp/include/cudf/strings/replace.hpp +++ b/cpp/include/cudf/strings/replace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -67,9 +68,9 @@ std::unique_ptr replace( strings_column_view const& input, string_scalar const& target, string_scalar const& repl, - cudf::size_type maxrepl = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type maxrepl = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief This function replaces each string in the column with the provided @@ -107,11 +108,11 @@ std::unique_ptr replace( */ std::unique_ptr replace_slice( strings_column_view const& input, - string_scalar const& repl = string_scalar(""), - size_type start = 0, - size_type stop = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& repl = string_scalar(""), + size_type start = 0, + size_type stop = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Replaces substrings matching a list of targets with the corresponding @@ -156,8 +157,8 @@ std::unique_ptr replace( strings_column_view const& input, strings_column_view const& targets, strings_column_view const& repls, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/replace_re.hpp b/cpp/include/cudf/strings/replace_re.hpp index 77db2882253..f61f9585144 100644 --- a/cpp/include/cudf/strings/replace_re.hpp +++ b/cpp/include/cudf/strings/replace_re.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -59,7 +60,7 @@ std::unique_ptr replace_re( string_scalar const& replacement = string_scalar(""), std::optional max_replace_count = std::nullopt, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief For each string, replaces any character sequence matching the given patterns @@ -81,9 +82,9 @@ std::unique_ptr replace_re( strings_column_view const& input, std::vector const& patterns, strings_column_view const& replacements, - regex_flags const flags = regex_flags::DEFAULT, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + regex_flags const flags = regex_flags::DEFAULT, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief For each string, replaces any character sequence matching the given regex @@ -107,8 +108,8 @@ std::unique_ptr replace_with_backrefs( strings_column_view const& input, regex_program const& prog, std::string_view replacement, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); } // namespace strings } // namespace cudf diff --git a/cpp/include/cudf/strings/reverse.hpp b/cpp/include/cudf/strings/reverse.hpp index 4fc8fbf67c2..86656693c8b 100644 --- a/cpp/include/cudf/strings/reverse.hpp +++ b/cpp/include/cudf/strings/reverse.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -47,8 +48,8 @@ namespace strings { */ std::unique_ptr reverse( strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/slice.hpp b/cpp/include/cudf/strings/slice.hpp index f106663be9b..e2be6abd344 100644 --- a/cpp/include/cudf/strings/slice.hpp +++ b/cpp/include/cudf/strings/slice.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -64,7 +65,7 @@ std::unique_ptr slice_strings( numeric_scalar const& stop = numeric_scalar(0, false), numeric_scalar const& step = numeric_scalar(1), rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a new strings column that contains substrings of the @@ -108,8 +109,8 @@ std::unique_ptr slice_strings( strings_column_view const& input, column_view const& starts, column_view const& stops, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/split/partition.hpp b/cpp/include/cudf/strings/split/partition.hpp index 25eedf1e86b..0a837034ba1 100644 --- a/cpp/include/cudf/strings/split/partition.hpp +++ b/cpp/include/cudf/strings/split/partition.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -60,9 +61,9 @@ namespace strings { */ std::unique_ptr
partition( strings_column_view const& input, - string_scalar const& delimiter = string_scalar(""), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiter = string_scalar(""), + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a set of 3 columns by splitting each string using the @@ -94,9 +95,9 @@ std::unique_ptr
partition( */ std::unique_ptr
rpartition( strings_column_view const& input, - string_scalar const& delimiter = string_scalar(""), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiter = string_scalar(""), + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/split/split.hpp b/cpp/include/cudf/strings/split/split.hpp index a34a59577a0..d5c44406ca7 100644 --- a/cpp/include/cudf/strings/split/split.hpp +++ b/cpp/include/cudf/strings/split/split.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -54,10 +55,10 @@ namespace strings { */ std::unique_ptr
split( strings_column_view const& strings_column, - string_scalar const& delimiter = string_scalar(""), - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiter = string_scalar(""), + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a list of columns by splitting each string using the @@ -84,10 +85,10 @@ std::unique_ptr
split( */ std::unique_ptr
rsplit( strings_column_view const& strings_column, - string_scalar const& delimiter = string_scalar(""), - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiter = string_scalar(""), + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Splits individual strings elements into a list of strings. @@ -158,10 +159,10 @@ std::unique_ptr
rsplit( */ std::unique_ptr split_record( strings_column_view const& strings, - string_scalar const& delimiter = string_scalar(""), - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiter = string_scalar(""), + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Splits individual strings elements into a list of strings starting @@ -237,10 +238,10 @@ std::unique_ptr split_record( */ std::unique_ptr rsplit_record( strings_column_view const& strings, - string_scalar const& delimiter = string_scalar(""), - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + string_scalar const& delimiter = string_scalar(""), + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/split/split_re.hpp b/cpp/include/cudf/strings/split/split_re.hpp index f1736cb7e0c..81595fa7ed4 100644 --- a/cpp/include/cudf/strings/split/split_re.hpp +++ b/cpp/include/cudf/strings/split/split_re.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -82,9 +83,9 @@ struct regex_program; std::unique_ptr
split_re( strings_column_view const& input, regex_program const& prog, - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Splits strings elements into a table of strings columns using a @@ -138,9 +139,9 @@ std::unique_ptr
split_re( std::unique_ptr
rsplit_re( strings_column_view const& input, regex_program const& prog, - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Splits strings elements into a list column of strings @@ -196,9 +197,9 @@ std::unique_ptr
rsplit_re( std::unique_ptr split_record_re( strings_column_view const& input, regex_program const& prog, - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Splits strings elements into a list column of strings using the given @@ -256,9 +257,9 @@ std::unique_ptr split_record_re( std::unique_ptr rsplit_record_re( strings_column_view const& input, regex_program const& prog, - size_type maxsplit = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + size_type maxsplit = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/strip.hpp b/cpp/include/cudf/strings/strip.hpp index 556d6805ac3..6fb9bbc45e6 100644 --- a/cpp/include/cudf/strings/strip.hpp +++ b/cpp/include/cudf/strings/strip.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -63,10 +64,10 @@ namespace strings { */ std::unique_ptr strip( strings_column_view const& input, - side_type side = side_type::BOTH, - string_scalar const& to_strip = string_scalar(""), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + side_type side = side_type::BOTH, + string_scalar const& to_strip = string_scalar(""), + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/translate.hpp b/cpp/include/cudf/strings/translate.hpp index 4bd09352b09..9cd6b7d5974 100644 --- a/cpp/include/cudf/strings/translate.hpp +++ b/cpp/include/cudf/strings/translate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -56,8 +57,8 @@ namespace strings { std::unique_ptr translate( strings_column_view const& input, std::vector> const& chars_table, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Removes or keeps the specified character ranges in cudf::strings::filter_characters @@ -101,10 +102,10 @@ enum class filter_type : bool { std::unique_ptr filter_characters( strings_column_view const& input, std::vector> characters_to_filter, - filter_type keep_characters = filter_type::KEEP, - string_scalar const& replacement = string_scalar(""), - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + filter_type keep_characters = filter_type::KEEP, + string_scalar const& replacement = string_scalar(""), + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/strings/wrap.hpp b/cpp/include/cudf/strings/wrap.hpp index efdc3e62aff..c05c33fbac8 100644 --- a/cpp/include/cudf/strings/wrap.hpp +++ b/cpp/include/cudf/strings/wrap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace strings { @@ -66,8 +67,8 @@ namespace strings { std::unique_ptr wrap( strings_column_view const& input, size_type width, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of doxygen group } // namespace strings diff --git a/cpp/include/cudf/structs/detail/concatenate.hpp b/cpp/include/cudf/structs/detail/concatenate.hpp index 82ccca188e2..5dc3169c0c4 100644 --- a/cpp/include/cudf/structs/detail/concatenate.hpp +++ b/cpp/include/cudf/structs/detail/concatenate.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ #include #include +#include + namespace cudf { namespace structs { namespace detail { @@ -50,7 +52,7 @@ namespace detail { */ std::unique_ptr concatenate(host_span columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace structs diff --git a/cpp/include/cudf/structs/detail/scan.hpp b/cpp/include/cudf/structs/detail/scan.hpp index 531e0a6c65f..c97a8452ecd 100644 --- a/cpp/include/cudf/structs/detail/scan.hpp +++ b/cpp/include/cudf/structs/detail/scan.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { namespace structs { @@ -38,7 +39,7 @@ namespace detail { template std::unique_ptr scan_inclusive(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace structs diff --git a/cpp/include/cudf/table/table.hpp b/cpp/include/cudf/table/table.hpp index 439b02c2d53..8efe6eb8c72 100644 --- a/cpp/include/cudf/table/table.hpp +++ b/cpp/include/cudf/table/table.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -56,8 +57,8 @@ class table { * @param mr Device memory resource to use for all device memory allocations */ explicit table(table const& other, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Moves the contents from a vector of `unique_ptr`s to columns to * construct a new table. @@ -75,8 +76,8 @@ class table { * @param mr Device memory resource used for allocating the device memory for the new columns */ table(table_view view, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the number of columns in the table diff --git a/cpp/include/cudf/timezone.hpp b/cpp/include/cudf/timezone.hpp index 56678c73811..7f65128526e 100644 --- a/cpp/include/cudf/timezone.hpp +++ b/cpp/include/cudf/timezone.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ #pragma once #include +#include #include #include @@ -49,6 +50,6 @@ static constexpr uint32_t solar_cycle_entry_count = 2 * solar_cycle_years; std::unique_ptr
make_timezone_transition_table( std::optional tzif_dir, std::string_view timezone_name, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); } // namespace cudf diff --git a/cpp/include/cudf/transform.hpp b/cpp/include/cudf/transform.hpp index 49ec3d7c0d5..7bb9fb7a42e 100644 --- a/cpp/include/cudf/transform.hpp +++ b/cpp/include/cudf/transform.hpp @@ -20,6 +20,7 @@ #include #include +#include #include @@ -54,7 +55,7 @@ std::unique_ptr transform( std::string const& unary_udf, data_type output_type, bool is_ptx, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a null_mask from `input` by converting `NaN` to null and @@ -69,7 +70,7 @@ std::unique_ptr transform( */ std::pair, size_type> nans_to_nulls( column_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Compute a new column by evaluating an expression tree on a table. @@ -87,7 +88,7 @@ std::pair, size_type> nans_to_nulls( std::unique_ptr compute_column( table_view const& table, ast::expression const& expr, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a bitmask from a column of boolean elements. @@ -106,7 +107,7 @@ std::unique_ptr compute_column( */ std::pair, cudf::size_type> bools_to_mask( column_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Encode the rows of the given table as integers @@ -134,7 +135,7 @@ std::pair, cudf::size_type> bools_to_mask( */ std::pair, std::unique_ptr> encode( cudf::table_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Encodes `input` by generating a new column for each value in `categories` indicating the @@ -166,7 +167,7 @@ std::pair, std::unique_ptr> encode( std::pair, table_view> one_hot_encode( column_view const& input, column_view const& categories, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a boolean column from given bitmask. @@ -193,7 +194,7 @@ std::unique_ptr mask_to_bools( bitmask_type const* bitmask, size_type begin_bit, size_type end_bit, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns an approximate cumulative size in bits of all columns in the `table_view` for @@ -221,8 +222,7 @@ std::unique_ptr mask_to_bools( * @return A 32-bit integer column containing the per-row bit counts */ std::unique_ptr row_bit_count( - table_view const& t, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + table_view const& t, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns an approximate cumulative size in bits of all columns in the `table_view` for @@ -245,7 +245,7 @@ std::unique_ptr row_bit_count( std::unique_ptr segmented_row_bit_count( table_view const& t, size_type segment_length, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/transpose.hpp b/cpp/include/cudf/transpose.hpp index e5d083ae7b3..c01a04afe87 100644 --- a/cpp/include/cudf/transpose.hpp +++ b/cpp/include/cudf/transpose.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include namespace cudf { /** @@ -44,7 +45,7 @@ namespace cudf { */ std::pair, table_view> transpose( table_view const& input, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf/unary.hpp b/cpp/include/cudf/unary.hpp index 5ded22488c7..74c8bc67d3a 100644 --- a/cpp/include/cudf/unary.hpp +++ b/cpp/include/cudf/unary.hpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -147,8 +148,8 @@ enum class unary_operator : int32_t { std::unique_ptr unary_operation( cudf::column_view const& input, cudf::unary_operator op, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a column of `type_id::BOOL8` elements where for every element in `input` `true` @@ -163,8 +164,8 @@ std::unique_ptr unary_operation( */ std::unique_ptr is_null( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a column of `type_id::BOOL8` elements where for every element in `input` `true` @@ -179,8 +180,8 @@ std::unique_ptr is_null( */ std::unique_ptr is_valid( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Casts data from dtype specified in input to dtype specified in output. @@ -198,8 +199,8 @@ std::unique_ptr is_valid( std::unique_ptr cast( column_view const& input, data_type out_type, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a column of `type_id::BOOL8` elements indicating the presence of `NaN` values @@ -216,8 +217,8 @@ std::unique_ptr cast( */ std::unique_ptr is_nan( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a column of `type_id::BOOL8` elements indicating the absence of `NaN` values @@ -235,8 +236,8 @@ std::unique_ptr is_nan( */ std::unique_ptr is_not_nan( cudf::column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace cudf diff --git a/cpp/include/cudf_test/base_fixture.hpp b/cpp/include/cudf_test/base_fixture.hpp index 14b94e061ae..18f75bbc842 100644 --- a/cpp/include/cudf_test/base_fixture.hpp +++ b/cpp/include/cudf_test/base_fixture.hpp @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace test { @@ -36,7 +37,7 @@ namespace test { * ``` */ class BaseFixture : public ::testing::Test { - rmm::mr::device_memory_resource* _mr{rmm::mr::get_current_device_resource()}; + rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource()}; public: /** @@ -44,7 +45,7 @@ class BaseFixture : public ::testing::Test { * all tests inheriting from this fixture * @return pointer to memory resource */ - rmm::mr::device_memory_resource* mr() { return _mr; } + rmm::device_async_resource_ref mr() { return _mr; } }; /** @@ -57,7 +58,7 @@ class BaseFixture : public ::testing::Test { */ template class BaseFixtureWithParam : public ::testing::TestWithParam { - rmm::mr::device_memory_resource* _mr{rmm::mr::get_current_device_resource()}; + rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource()}; public: /** @@ -65,7 +66,7 @@ class BaseFixtureWithParam : public ::testing::TestWithParam { * all tests inheriting from this fixture * @return pointer to memory resource */ - rmm::mr::device_memory_resource* mr() const { return _mr; } + rmm::device_async_resource_ref mr() const { return _mr; } }; /** diff --git a/cpp/include/nvtext/byte_pair_encoding.hpp b/cpp/include/nvtext/byte_pair_encoding.hpp index 4d6d8335eac..375d44e367a 100644 --- a/cpp/include/nvtext/byte_pair_encoding.hpp +++ b/cpp/include/nvtext/byte_pair_encoding.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,8 @@ #include #include +#include + namespace nvtext { /** @@ -45,8 +47,8 @@ struct bpe_merge_pairs { * @param mr Device memory resource used to allocate the device memory */ bpe_merge_pairs(std::unique_ptr&& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Construct a new bpe merge pairs object @@ -56,8 +58,8 @@ struct bpe_merge_pairs { * @param mr Device memory resource used to allocate the device memory */ bpe_merge_pairs(cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); ~bpe_merge_pairs(); bpe_merge_pairs(); @@ -94,8 +96,8 @@ struct bpe_merge_pairs { */ std::unique_ptr load_merge_pairs( cudf::strings_column_view const& merge_pairs, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Byte pair encode the input strings. @@ -127,7 +129,7 @@ std::unique_ptr byte_pair_encoding( cudf::strings_column_view const& input, bpe_merge_pairs const& merges_pairs, cudf::string_scalar const& separator = cudf::string_scalar(" "), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/detail/generate_ngrams.hpp b/cpp/include/nvtext/detail/generate_ngrams.hpp index 835124141d4..c4b89b6d495 100644 --- a/cpp/include/nvtext/detail/generate_ngrams.hpp +++ b/cpp/include/nvtext/detail/generate_ngrams.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +18,21 @@ #include #include +#include namespace nvtext { namespace detail { /** * @copydoc hash_character_ngrams(cudf::strings_column_view const&, - * cudf::size_type, rmm::mr::device_memory_resource*) + * cudf::size_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for allocating/copying device memory and launching kernels */ std::unique_ptr hash_character_ngrams(cudf::strings_column_view const& strings, cudf::size_type ngrams, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace nvtext diff --git a/cpp/include/nvtext/detail/load_hash_file.hpp b/cpp/include/nvtext/detail/load_hash_file.hpp index f4107adb07e..0c27981f80b 100644 --- a/cpp/include/nvtext/detail/load_hash_file.hpp +++ b/cpp/include/nvtext/detail/load_hash_file.hpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -43,7 +44,7 @@ namespace detail { std::unique_ptr load_vocabulary_file( std::string const& filename_hashed_vocabulary, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace nvtext diff --git a/cpp/include/nvtext/detail/tokenize.hpp b/cpp/include/nvtext/detail/tokenize.hpp index 80a6edc496b..d48027e4631 100644 --- a/cpp/include/nvtext/detail/tokenize.hpp +++ b/cpp/include/nvtext/detail/tokenize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,52 +21,53 @@ #include #include +#include namespace nvtext { namespace detail { /** * @copydoc nvtext::tokenize(strings_column_view const&,string_scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ std::unique_ptr tokenize(cudf::strings_column_view const& strings, cudf::string_scalar const& delimiter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc nvtext::tokenize(strings_column_view const&,strings_column_view - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ std::unique_ptr tokenize(cudf::strings_column_view const& strings, cudf::strings_column_view const& delimiters, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc nvtext::count_tokens(strings_column_view const&, string_scalar - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ std::unique_ptr count_tokens(cudf::strings_column_view const& strings, cudf::string_scalar const& delimiter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc nvtext::count_tokens(strings_column_view const&,strings_column_view - * const&,rmm::mr::device_memory_resource*) + * const&,rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches */ std::unique_ptr count_tokens(cudf::strings_column_view const& strings, cudf::strings_column_view const& delimiters, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace nvtext diff --git a/cpp/include/nvtext/edit_distance.hpp b/cpp/include/nvtext/edit_distance.hpp index 9a24662455b..bfdfb4d1a1c 100644 --- a/cpp/include/nvtext/edit_distance.hpp +++ b/cpp/include/nvtext/edit_distance.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + //! NVText APIs namespace nvtext { /** @@ -60,8 +62,8 @@ namespace nvtext { std::unique_ptr edit_distance( cudf::strings_column_view const& input, cudf::strings_column_view const& targets, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Compute the edit distance between all the strings in the input column. @@ -98,8 +100,8 @@ std::unique_ptr edit_distance( */ std::unique_ptr edit_distance_matrix( cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/generate_ngrams.hpp b/cpp/include/nvtext/generate_ngrams.hpp index e3d667f0292..bebe2e46023 100644 --- a/cpp/include/nvtext/generate_ngrams.hpp +++ b/cpp/include/nvtext/generate_ngrams.hpp @@ -19,6 +19,8 @@ #include #include +#include + namespace nvtext { /** * @addtogroup nvtext_ngrams @@ -58,8 +60,8 @@ std::unique_ptr generate_ngrams( cudf::strings_column_view const& input, cudf::size_type ngrams, cudf::string_scalar const& separator, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Generates ngrams of characters within each string @@ -86,9 +88,9 @@ std::unique_ptr generate_ngrams( */ std::unique_ptr generate_character_ngrams( cudf::strings_column_view const& input, - cudf::size_type ngrams = 2, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type ngrams = 2, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Hashes ngrams of characters within each string @@ -121,9 +123,9 @@ std::unique_ptr generate_character_ngrams( */ std::unique_ptr hash_character_ngrams( cudf::strings_column_view const& input, - cudf::size_type ngrams = 5, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type ngrams = 5, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/jaccard.hpp b/cpp/include/nvtext/jaccard.hpp index 19d6c111200..649c17f0b1c 100644 --- a/cpp/include/nvtext/jaccard.hpp +++ b/cpp/include/nvtext/jaccard.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ #include #include +#include + namespace nvtext { /** * @addtogroup nvtext_jaccard @@ -72,8 +74,8 @@ std::unique_ptr jaccard_index( cudf::strings_column_view const& input1, cudf::strings_column_view const& input2, cudf::size_type width, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/minhash.hpp b/cpp/include/nvtext/minhash.hpp index 47c625b5079..7d3f6059454 100644 --- a/cpp/include/nvtext/minhash.hpp +++ b/cpp/include/nvtext/minhash.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,8 @@ #include #include +#include + namespace nvtext { /** * @addtogroup nvtext_minhash @@ -53,7 +55,7 @@ std::unique_ptr minhash( cudf::numeric_scalar seed = 0, cudf::size_type width = 4, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the minhash values for each string per seed @@ -83,9 +85,9 @@ std::unique_ptr minhash( std::unique_ptr minhash( cudf::strings_column_view const& input, cudf::device_span seeds, - cudf::size_type width = 4, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type width = 4, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the minhash value for each string @@ -114,7 +116,7 @@ std::unique_ptr minhash64( cudf::numeric_scalar seed = 0, cudf::size_type width = 4, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the minhash values for each string per seed @@ -144,9 +146,9 @@ std::unique_ptr minhash64( std::unique_ptr minhash64( cudf::strings_column_view const& input, cudf::device_span seeds, - cudf::size_type width = 4, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type width = 4, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/ngrams_tokenize.hpp b/cpp/include/nvtext/ngrams_tokenize.hpp index 9d76ef8689f..09ce323a7ae 100644 --- a/cpp/include/nvtext/ngrams_tokenize.hpp +++ b/cpp/include/nvtext/ngrams_tokenize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + namespace nvtext { /** * @addtogroup nvtext_ngrams @@ -80,8 +82,8 @@ std::unique_ptr ngrams_tokenize( cudf::size_type ngrams, cudf::string_scalar const& delimiter, cudf::string_scalar const& separator, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/normalize.hpp b/cpp/include/nvtext/normalize.hpp index 3cbff5c744b..e5967e78318 100644 --- a/cpp/include/nvtext/normalize.hpp +++ b/cpp/include/nvtext/normalize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ #include #include +#include + //! NVText APIs namespace nvtext { /** @@ -51,8 +53,8 @@ namespace nvtext { */ std::unique_ptr normalize_spaces( cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Normalizes strings characters for tokenizing. @@ -102,8 +104,8 @@ std::unique_ptr normalize_spaces( std::unique_ptr normalize_characters( cudf::strings_column_view const& input, bool do_lower_case, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/replace.hpp b/cpp/include/nvtext/replace.hpp index 88cf7d41901..aac21346c72 100644 --- a/cpp/include/nvtext/replace.hpp +++ b/cpp/include/nvtext/replace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + //! NVText APIs namespace nvtext { /** @@ -88,7 +90,7 @@ std::unique_ptr replace_tokens( cudf::strings_column_view const& replacements, cudf::string_scalar const& delimiter = cudf::string_scalar{""}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Removes tokens whose lengths are less than a specified number of characters. @@ -137,7 +139,7 @@ std::unique_ptr filter_tokens( cudf::string_scalar const& replacement = cudf::string_scalar{""}, cudf::string_scalar const& delimiter = cudf::string_scalar{""}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/stemmer.hpp b/cpp/include/nvtext/stemmer.hpp index 0e1759fdc5a..20b81aba661 100644 --- a/cpp/include/nvtext/stemmer.hpp +++ b/cpp/include/nvtext/stemmer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + namespace nvtext { /** * @addtogroup nvtext_stemmer @@ -79,8 +81,8 @@ std::unique_ptr is_letter( cudf::strings_column_view const& input, letter_type ltype, cudf::size_type character_index, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns boolean column indicating if character at `indices[i]` of `input[i]` @@ -132,8 +134,8 @@ std::unique_ptr is_letter( cudf::strings_column_view const& input, letter_type ltype, cudf::column_view const& indices, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the Porter Stemmer measurements of a strings column. @@ -166,8 +168,8 @@ std::unique_ptr is_letter( */ std::unique_ptr porter_stemmer_measure( cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/subword_tokenize.hpp b/cpp/include/nvtext/subword_tokenize.hpp index 72a899d70b4..a4e06495a1d 100644 --- a/cpp/include/nvtext/subword_tokenize.hpp +++ b/cpp/include/nvtext/subword_tokenize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + namespace nvtext { /** @@ -65,7 +67,7 @@ struct hashed_vocabulary { */ std::unique_ptr load_vocabulary_file( std::string const& filename_hashed_vocabulary, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Result object for the subword_tokenize functions. @@ -155,7 +157,7 @@ tokenizer_result subword_tokenize( uint32_t stride, bool do_lower_case, bool do_truncate, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of group } // namespace nvtext diff --git a/cpp/include/nvtext/tokenize.hpp b/cpp/include/nvtext/tokenize.hpp index 107fefcc3bf..ea1b9c716f0 100644 --- a/cpp/include/nvtext/tokenize.hpp +++ b/cpp/include/nvtext/tokenize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + namespace nvtext { /** * @addtogroup nvtext_tokenize @@ -60,7 +62,7 @@ std::unique_ptr tokenize( cudf::strings_column_view const& input, cudf::string_scalar const& delimiter = cudf::string_scalar{""}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a single column of strings by tokenizing the input strings @@ -95,8 +97,8 @@ std::unique_ptr tokenize( std::unique_ptr tokenize( cudf::strings_column_view const& input, cudf::strings_column_view const& delimiters, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the number of tokens in each string of a strings column. @@ -127,7 +129,7 @@ std::unique_ptr count_tokens( cudf::strings_column_view const& input, cudf::string_scalar const& delimiter = cudf::string_scalar{""}, rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the number of tokens in each string of a strings column @@ -158,8 +160,8 @@ std::unique_ptr count_tokens( std::unique_ptr count_tokens( cudf::strings_column_view const& input, cudf::strings_column_view const& delimiters, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns a single column of strings by converting each character to a string. @@ -183,8 +185,8 @@ std::unique_ptr count_tokens( */ std::unique_ptr character_tokenize( cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Creates a strings column from a strings column of tokens and an @@ -225,7 +227,7 @@ std::unique_ptr detokenize( cudf::column_view const& row_indices, cudf::string_scalar const& separator = cudf::string_scalar(" "), rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Vocabulary object to be used with nvtext::tokenize_with_vocabulary @@ -246,8 +248,8 @@ struct tokenize_vocabulary { * @param mr Device memory resource used to allocate the returned column's device memory */ tokenize_vocabulary(cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); ~tokenize_vocabulary(); struct tokenize_vocabulary_impl; @@ -269,8 +271,8 @@ struct tokenize_vocabulary { */ std::unique_ptr load_vocabulary( cudf::strings_column_view const& input, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** * @brief Returns the token ids for the input string by looking up each delimited @@ -301,9 +303,9 @@ std::unique_ptr tokenize_with_vocabulary( cudf::strings_column_view const& input, tokenize_vocabulary const& vocabulary, cudf::string_scalar const& delimiter, - cudf::size_type default_id = -1, - rmm::cuda_stream_view stream = cudf::get_default_stream(), - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); + cudf::size_type default_id = -1, + rmm::cuda_stream_view stream = cudf::get_default_stream(), + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); /** @} */ // end of tokenize group } // namespace nvtext diff --git a/cpp/src/binaryop/binaryop.cpp b/cpp/src/binaryop/binaryop.cpp index be91c3b4d08..e39a2bb3ae8 100644 --- a/cpp/src/binaryop/binaryop.cpp +++ b/cpp/src/binaryop/binaryop.cpp @@ -39,6 +39,7 @@ #include #include +#include #include @@ -56,7 +57,7 @@ std::pair scalar_col_valid_mask_and( column_view const& col, scalar const& s, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (col.is_empty()) return std::pair(rmm::device_buffer{0, stream, mr}, 0); @@ -179,7 +180,7 @@ void fixed_point_binary_operation_validation(binary_operator op, /** * @copydoc cudf::binary_operation(column_view const&, column_view const&, - * binary_operator, data_type, rmm::mr::device_memory_resource*) + * binary_operator, data_type, rmm::device_async_resource_ref) * * @param stream CUDA stream used for device memory operations and kernel launches. */ @@ -189,7 +190,7 @@ std::unique_ptr binary_operation(LhsType const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if constexpr (std::is_same_v and std::is_same_v) CUDF_EXPECTS(lhs.size() == rhs.size(), "Column sizes don't match"); @@ -250,7 +251,7 @@ std::unique_ptr make_fixed_width_column_for_output(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (binops::is_null_dependent(op)) { return make_fixed_width_column(output_type, rhs.size(), mask_state::ALL_VALID, stream, mr); @@ -277,7 +278,7 @@ std::unique_ptr make_fixed_width_column_for_output(column_view const& lh binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (binops::is_null_dependent(op)) { return make_fixed_width_column(output_type, lhs.size(), mask_state::ALL_VALID, stream, mr); @@ -304,7 +305,7 @@ std::unique_ptr make_fixed_width_column_for_output(column_view const& lh binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (binops::is_null_dependent(op)) { return make_fixed_width_column(output_type, rhs.size(), mask_state::ALL_VALID, stream, mr); @@ -320,7 +321,7 @@ std::unique_ptr binary_operation(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return binops::compiled::binary_operation( lhs, rhs, op, output_type, stream, mr); @@ -330,7 +331,7 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return binops::compiled::binary_operation( lhs, rhs, op, output_type, stream, mr); @@ -340,7 +341,7 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return binops::compiled::binary_operation( lhs, rhs, op, output_type, stream, mr); @@ -351,7 +352,7 @@ std::unique_ptr binary_operation(column_view const& lhs, std::string const& ptx, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Check for datatype auto is_type_supported_ptx = [](data_type type) -> bool { @@ -405,7 +406,7 @@ std::unique_ptr binary_operation(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::binary_operation(lhs, rhs, op, output_type, stream, mr); @@ -415,7 +416,7 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::binary_operation(lhs, rhs, op, output_type, stream, mr); @@ -425,7 +426,7 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::binary_operation(lhs, rhs, op, output_type, stream, mr); @@ -436,7 +437,7 @@ std::unique_ptr binary_operation(column_view const& lhs, std::string const& ptx, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::binary_operation(lhs, rhs, ptx, output_type, stream, mr); diff --git a/cpp/src/binaryop/compiled/binary_ops.cu b/cpp/src/binaryop/compiled/binary_ops.cu index 1429635b803..d3257fadb1d 100644 --- a/cpp/src/binaryop/compiled/binary_ops.cu +++ b/cpp/src/binaryop/compiled/binary_ops.cu @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,7 @@ struct scalar_as_column_view { template ())> return_type operator()(scalar const& s, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource*) + rmm::device_async_resource_ref) { auto& h_scalar_type_view = static_cast&>(const_cast(s)); auto col_v = column_view(s.type(), @@ -61,7 +62,7 @@ struct scalar_as_column_view { return std::pair{col_v, std::unique_ptr(nullptr)}; } template ())> - return_type operator()(scalar const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + return_type operator()(scalar const&, rmm::cuda_stream_view, rmm::device_async_resource_ref) { CUDF_FAIL("Unsupported type"); } @@ -69,7 +70,7 @@ struct scalar_as_column_view { // specialization for cudf::string_view template <> scalar_as_column_view::return_type scalar_as_column_view::operator()( - scalar const& s, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + scalar const& s, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { using T = cudf::string_view; auto& h_scalar_type_view = static_cast&>(const_cast(s)); @@ -96,7 +97,7 @@ scalar_as_column_view::return_type scalar_as_column_view::operator() scalar_as_column_view::return_type scalar_as_column_view::operator()( - scalar const& s, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + scalar const& s, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { auto col = make_column_from_scalar(s, 1, stream, mr); return std::pair{col->view(), std::move(col)}; @@ -114,7 +115,7 @@ scalar_as_column_view::return_type scalar_as_column_view::operator() string_null_min_max(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // hard-coded to only work with cudf::string_view so we don't explode compile times CUDF_EXPECTS(lhs.type().id() == cudf::type_id::STRING, "Invalid/Unsupported lhs datatype"); @@ -280,7 +281,7 @@ std::unique_ptr string_null_min_max(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // hard-coded to only work with cudf::string_view so we don't explode compile times CUDF_EXPECTS(lhs.type().id() == cudf::type_id::STRING, "Invalid/Unsupported lhs datatype"); @@ -297,7 +298,7 @@ std::unique_ptr string_null_min_max(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // hard-coded to only work with cudf::string_view so we don't explode compile times CUDF_EXPECTS(lhs.type().id() == cudf::type_id::STRING, "Invalid/Unsupported lhs datatype"); diff --git a/cpp/src/binaryop/compiled/binary_ops.hpp b/cpp/src/binaryop/compiled/binary_ops.hpp index 47fd50c5d97..c7eb08cd133 100644 --- a/cpp/src/binaryop/compiled/binary_ops.hpp +++ b/cpp/src/binaryop/compiled/binary_ops.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -37,21 +38,21 @@ std::unique_ptr string_null_min_max(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr string_null_min_max(column_view const& lhs, scalar const& rhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); std::unique_ptr string_null_min_max(column_view const& lhs, column_view const& rhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Performs a binary operation between a string scalar and a string @@ -77,7 +78,7 @@ std::unique_ptr binary_operation(scalar const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Performs a binary operation between a string column and a string @@ -103,7 +104,7 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Performs a binary operation between two string columns. @@ -128,7 +129,7 @@ std::unique_ptr binary_operation(column_view const& lhs, binary_operator op, data_type output_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); void binary_operation(mutable_column_view& out, scalar const& lhs, diff --git a/cpp/src/bitmask/null_mask.cu b/cpp/src/bitmask/null_mask.cu index 806beeb4efe..4da2e502ce6 100644 --- a/cpp/src/bitmask/null_mask.cu +++ b/cpp/src/bitmask/null_mask.cu @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -79,7 +80,7 @@ namespace detail { rmm::device_buffer create_null_mask(size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { size_type mask_size{0}; @@ -157,7 +158,7 @@ void set_null_mask(bitmask_type* bitmask, rmm::device_buffer create_null_mask(size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::create_null_mask(size, state, stream, mr); } @@ -211,7 +212,7 @@ rmm::device_buffer copy_bitmask(bitmask_type const* mask, size_type begin_bit, size_type end_bit, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(begin_bit >= 0, "Invalid range."); @@ -235,7 +236,7 @@ rmm::device_buffer copy_bitmask(bitmask_type const* mask, // Create a bitmask from a column view rmm::device_buffer copy_bitmask(column_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); rmm::device_buffer null_mask{0, stream, mr}; @@ -432,7 +433,7 @@ std::pair bitmask_and(host_span begin_bits, size_type mask_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return bitmask_binop( [] __device__(bitmask_type left, bitmask_type right) { return left & right; }, @@ -446,7 +447,7 @@ std::pair bitmask_and(host_span bitmask_and(table_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); rmm::device_buffer null_mask{0, stream, mr}; @@ -479,7 +480,7 @@ std::pair bitmask_and(table_view const& view, // Returns the bitwise OR of the null masks of all columns in the table view std::pair bitmask_or(table_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); rmm::device_buffer null_mask{0, stream, mr}; @@ -512,7 +513,7 @@ std::pair bitmask_or(table_view const& view, void set_all_valid_null_masks(column_view const& input, column& output, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.nullable()) { auto mask = detail::create_null_mask(output.size(), mask_state::ALL_VALID, stream, mr); @@ -531,7 +532,7 @@ rmm::device_buffer copy_bitmask(bitmask_type const* mask, size_type begin_bit, size_type end_bit, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_bitmask(mask, begin_bit, end_bit, stream, mr); @@ -540,7 +541,7 @@ rmm::device_buffer copy_bitmask(bitmask_type const* mask, // Create a bitmask from a column view rmm::device_buffer copy_bitmask(column_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_bitmask(view, stream, mr); @@ -548,7 +549,7 @@ rmm::device_buffer copy_bitmask(column_view const& view, std::pair bitmask_and(table_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::bitmask_and(view, stream, mr); @@ -556,7 +557,7 @@ std::pair bitmask_and(table_view const& view, std::pair bitmask_or(table_view const& view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::bitmask_or(view, stream, mr); diff --git a/cpp/src/column/column.cu b/cpp/src/column/column.cu index d4a8fff69e2..90f719b9516 100644 --- a/cpp/src/column/column.cu +++ b/cpp/src/column/column.cu @@ -35,6 +35,7 @@ #include #include +#include #include @@ -46,9 +47,7 @@ namespace cudf { // Copy ctor w/ optional stream/mr -column::column(column const& other, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) +column::column(column const& other, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) : _type{other._type}, _size{other._size}, _data{other._data, stream, mr}, @@ -160,7 +159,7 @@ namespace { struct create_column_from_view { cudf::column_view view; rmm::cuda_stream_view stream{cudf::get_default_stream()}; - rmm::mr::device_memory_resource* mr; + rmm::device_async_resource_ref mr; template >* = nullptr> @@ -254,7 +253,7 @@ struct create_column_from_view { } // anonymous namespace // Copy from a view -column::column(column_view view, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) +column::column(column_view view, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) : // Move is needed here because the dereference operator of unique_ptr returns // an lvalue reference, which would otherwise dispatch to the copy constructor column{std::move(*type_dispatcher(view.type(), create_column_from_view{view, stream, mr}))} diff --git a/cpp/src/column/column_factories.cpp b/cpp/src/column/column_factories.cpp index d8da6a95aa4..e40056fc8a1 100644 --- a/cpp/src/column/column_factories.cpp +++ b/cpp/src/column/column_factories.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,8 @@ #include #include +#include + #include namespace cudf { @@ -75,7 +77,7 @@ std::unique_ptr make_numeric_column(data_type type, size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(is_numeric(type), "Invalid, non-numeric type."); @@ -95,7 +97,7 @@ std::unique_ptr make_fixed_point_column(data_type type, size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(is_fixed_point(type), "Invalid, non-fixed_point type."); @@ -115,7 +117,7 @@ std::unique_ptr make_timestamp_column(data_type type, size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(is_timestamp(type), "Invalid, non-timestamp type."); @@ -135,7 +137,7 @@ std::unique_ptr make_duration_column(data_type type, size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(is_duration(type), "Invalid, non-duration type."); @@ -155,7 +157,7 @@ std::unique_ptr make_fixed_width_column(data_type type, size_type size, mask_state state, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(is_fixed_width(type), "Invalid, non-fixed-width type."); @@ -171,7 +173,7 @@ std::unique_ptr make_fixed_width_column(data_type type, std::unique_ptr make_dictionary_from_scalar(scalar const& s, size_type size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (size == 0) return make_empty_column(type_id::DICTIONARY32); CUDF_EXPECTS(size >= 0, "Column size cannot be negative."); diff --git a/cpp/src/column/column_factories.cu b/cpp/src/column/column_factories.cu index 0e65a131e67..bad20d6817c 100644 --- a/cpp/src/column/column_factories.cu +++ b/cpp/src/column/column_factories.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,8 @@ #include #include +#include + #include namespace cudf { @@ -33,7 +35,7 @@ struct column_from_scalar_dispatch { std::unique_ptr operator()(scalar const& value, size_type size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { if (size == 0) return make_empty_column(value.type()); if (!value.is_valid(stream)) @@ -51,7 +53,7 @@ std::unique_ptr column_from_scalar_dispatch::operator() column_from_scalar_dispatch::operator() std::unique_ptr column_from_scalar_dispatch::operator()( - scalar const&, size_type, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) const + scalar const&, size_type, rmm::cuda_stream_view, rmm::device_async_resource_ref) const { CUDF_FAIL("dictionary not supported when creating from scalar"); } @@ -78,7 +80,7 @@ std::unique_ptr column_from_scalar_dispatch::operator()(&value); return lists::detail::make_lists_column_from_scalar(*lv, size, stream, mr); @@ -89,7 +91,7 @@ std::unique_ptr column_from_scalar_dispatch::operator() const&>(value); @@ -113,7 +115,7 @@ std::unique_ptr column_from_scalar_dispatch::operator() make_column_from_scalar(scalar const& s, size_type size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type_dispatcher(s.type(), column_from_scalar_dispatch{}, s, size, stream, mr); } diff --git a/cpp/src/copying/concatenate.cu b/cpp/src/copying/concatenate.cu index b1d850e0b27..7c57be8e7c0 100644 --- a/cpp/src/copying/concatenate.cu +++ b/cpp/src/copying/concatenate.cu @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -241,7 +242,7 @@ template std::unique_ptr fused_concatenate(host_span views, bool const has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using mask_policy = cudf::mask_allocation_policy; @@ -288,7 +289,7 @@ template std::unique_ptr for_each_concatenate(host_span views, bool const has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { size_type const total_element_count = std::accumulate(views.begin(), views.end(), 0, [](auto accumulator, auto const& v) { @@ -321,7 +322,7 @@ std::unique_ptr for_each_concatenate(host_span views, struct concatenate_dispatch { host_span views; rmm::cuda_stream_view stream; - rmm::mr::device_memory_resource* mr; + rmm::device_async_resource_ref mr; // fixed width template @@ -485,7 +486,7 @@ void bounds_and_type_check(host_span cols, rmm::cuda_stream_v // Concatenates the elements from a vector of column_views std::unique_ptr concatenate(host_span columns_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(not columns_to_concat.empty(), "Unexpected empty list of columns to concatenate."); @@ -504,7 +505,7 @@ std::unique_ptr concatenate(host_span columns_to_conc std::unique_ptr
concatenate(host_span tables_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (tables_to_concat.empty()) { return std::make_unique
(); } @@ -533,7 +534,7 @@ std::unique_ptr
concatenate(host_span tables_to_concat, rmm::device_buffer concatenate_masks(host_span views, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { bool const has_nulls = std::any_of(views.begin(), views.end(), [](column_view const col) { return col.has_nulls(); }); @@ -558,7 +559,7 @@ rmm::device_buffer concatenate_masks(host_span views, rmm::device_buffer concatenate_masks(host_span views, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::concatenate_masks(views, stream, mr); @@ -567,7 +568,7 @@ rmm::device_buffer concatenate_masks(host_span views, // Concatenates the elements from a vector of column_views std::unique_ptr concatenate(host_span columns_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::concatenate(columns_to_concat, stream, mr); @@ -575,7 +576,7 @@ std::unique_ptr concatenate(host_span columns_to_conc std::unique_ptr
concatenate(host_span tables_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::concatenate(tables_to_concat, stream, mr); diff --git a/cpp/src/copying/contiguous_split.cu b/cpp/src/copying/contiguous_split.cu index 23bcd344a32..37db2c74790 100644 --- a/cpp/src/copying/contiguous_split.cu +++ b/cpp/src/copying/contiguous_split.cu @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -48,6 +49,7 @@ #include #include +#include #include namespace cudf { @@ -988,7 +990,7 @@ struct packed_split_indices_and_src_buf_info { std::size_t num_partitions, cudf::size_type num_src_bufs, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) : indices_size( cudf::util::round_up_safe((num_partitions + 1) * sizeof(size_type), split_align)), src_buf_info_size( @@ -1046,7 +1048,7 @@ struct packed_partition_buf_size_and_dst_buf_info { packed_partition_buf_size_and_dst_buf_info(std::size_t num_partitions, std::size_t num_bufs, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) : stream(stream), buf_sizes_size{cudf::util::round_up_safe(num_partitions * sizeof(std::size_t), split_align)}, dst_buf_info_size{cudf::util::round_up_safe(num_bufs * sizeof(dst_buf_info), split_align)}, @@ -1097,7 +1099,7 @@ struct packed_src_and_dst_pointers { std::size_t num_partitions, cudf::size_type num_src_bufs, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) : stream(stream), src_bufs_size{cudf::util::round_up_safe(num_src_bufs * sizeof(uint8_t*), split_align)}, dst_bufs_size{cudf::util::round_up_safe(num_partitions * sizeof(uint8_t*), split_align)}, @@ -1158,7 +1160,7 @@ std::unique_ptr setup_src_and_dst_pointers( cudf::size_type num_src_bufs, std::vector& out_buffers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) { auto src_and_dst_pointers = std::make_unique( input, num_partitions, num_src_bufs, stream, temp_mr); @@ -1195,7 +1197,7 @@ std::unique_ptr compute_splits( cudf::size_type num_src_bufs, std::size_t num_bufs, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) { auto partition_buf_size_and_dst_buf_info = std::make_unique( @@ -1366,7 +1368,7 @@ struct chunk_iteration_state { std::size_t num_partitions, std::size_t user_buffer_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr); + rmm::device_async_resource_ref temp_mr); /** * @brief As of the time of the call, return the starting 1MB batch index, and the @@ -1426,7 +1428,7 @@ std::unique_ptr chunk_iteration_state::create( std::size_t num_partitions, std::size_t user_buffer_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) { rmm::device_uvector d_batch_offsets(num_bufs + 1, stream, temp_mr); @@ -1646,7 +1648,7 @@ std::unique_ptr compute_batches(int num_bufs, std::size_t num_partitions, std::size_t user_buffer_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) { // Since we parallelize at one block per copy, performance is vulnerable to situations where we // have small numbers of copies to do (a combination of small numbers of splits and/or columns), @@ -1769,8 +1771,8 @@ struct contiguous_split_state { contiguous_split_state(cudf::table_view const& input, std::size_t user_buffer_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, - rmm::mr::device_memory_resource* temp_mr) + std::optional mr, + rmm::device_async_resource_ref temp_mr) : contiguous_split_state(input, {}, user_buffer_size, stream, mr, temp_mr) { } @@ -1778,8 +1780,8 @@ struct contiguous_split_state { contiguous_split_state(cudf::table_view const& input, std::vector const& splits, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, - rmm::mr::device_memory_resource* temp_mr) + std::optional mr, + rmm::device_async_resource_ref temp_mr) : contiguous_split_state(input, splits, 0, stream, mr, temp_mr) { } @@ -1897,8 +1899,8 @@ struct contiguous_split_state { std::vector const& splits, std::size_t user_buffer_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, - rmm::mr::device_memory_resource* temp_mr) + std::optional mr, + rmm::device_async_resource_ref temp_mr) : input(input), user_buffer_size(user_buffer_size), stream(stream), @@ -1936,7 +1938,8 @@ struct contiguous_split_state { std::transform(h_buf_sizes, h_buf_sizes + num_partitions, std::back_inserter(out_buffers), - [stream = stream, mr = mr](std::size_t bytes) { + [stream = stream, + mr = mr.value_or(rmm::mr::get_current_device_resource())](std::size_t bytes) { return rmm::device_buffer{bytes, stream, mr}; }); } @@ -2014,11 +2017,11 @@ struct contiguous_split_state { cudf::table_view const input; ///< The input table_view to operate on std::size_t const user_buffer_size; ///< The size of the user buffer for the chunked_pack case rmm::cuda_stream_view const stream; - rmm::mr::device_memory_resource* const mr; ///< The memory resource for any data returned + std::optional mr; ///< The resource for any data returned // this resource defaults to `mr` for the contiguous_split case, but it can be useful for the // `chunked_pack` case to allocate scratch/temp memory in a pool - rmm::mr::device_memory_resource* const temp_mr; ///< The memory resource for scratch/temp space + rmm::device_async_resource_ref const temp_mr; ///< The memory resource for scratch/temp space // whether the table was empty to begin with (0 rows or 0 columns) and should be metadata-only bool const is_empty; ///< True if the source table has 0 rows or 0 columns @@ -2062,7 +2065,7 @@ struct contiguous_split_state { std::vector contiguous_split(cudf::table_view const& input, std::vector const& splits, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // `temp_mr` is the same as `mr` for contiguous_split as it allocates all // of its memory from the default memory resource in cuDF @@ -2075,7 +2078,7 @@ std::vector contiguous_split(cudf::table_view const& input, std::vector contiguous_split(cudf::table_view const& input, std::vector const& splits, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::contiguous_split(input, splits, cudf::get_default_stream(), mr); @@ -2083,14 +2086,14 @@ std::vector contiguous_split(cudf::table_view const& input, chunked_pack::chunked_pack(cudf::table_view const& input, std::size_t user_buffer_size, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) { CUDF_EXPECTS(user_buffer_size >= desired_batch_size, "The output buffer size must be at least 1MB in size"); - // We pass `nullptr` for the first `mr` in `contiguous_split_state` to indicate + // We pass `std::nullopt` for the first `mr` in `contiguous_split_state` to indicate // that it does not allocate any user-bound data for the `chunked_pack` case. state = std::make_unique( - input, user_buffer_size, cudf::get_default_stream(), nullptr, temp_mr); + input, user_buffer_size, cudf::get_default_stream(), std::nullopt, temp_mr); } // required for the unique_ptr to work with a incomplete type (contiguous_split_state) @@ -2115,7 +2118,7 @@ std::unique_ptr> chunked_pack::build_metadata() const std::unique_ptr chunked_pack::create(cudf::table_view const& input, std::size_t user_buffer_size, - rmm::mr::device_memory_resource* temp_mr) + rmm::device_async_resource_ref temp_mr) { return std::make_unique(input, user_buffer_size, temp_mr); } diff --git a/cpp/src/copying/copy.cpp b/cpp/src/copying/copy.cpp index cb7d507de81..98ee6aa8f68 100644 --- a/cpp/src/copying/copy.cpp +++ b/cpp/src/copying/copy.cpp @@ -26,6 +26,7 @@ #include #include +#include #include @@ -119,7 +120,7 @@ std::unique_ptr allocate_like(column_view const& input, size_type size, mask_allocation_policy mask_alloc, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS( @@ -177,7 +178,7 @@ std::unique_ptr
empty_like(table_view const& input_table) std::unique_ptr allocate_like(column_view const& input, mask_allocation_policy mask_alloc, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::allocate_like(input, input.size(), mask_alloc, stream, mr); @@ -187,7 +188,7 @@ std::unique_ptr allocate_like(column_view const& input, size_type size, mask_allocation_policy mask_alloc, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::allocate_like(input, size, mask_alloc, stream, mr); diff --git a/cpp/src/copying/copy.cu b/cpp/src/copying/copy.cu index 8299c211fad..92fb2e61741 100644 --- a/cpp/src/copying/copy.cu +++ b/cpp/src/copying/copy.cu @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -77,7 +78,7 @@ struct copy_if_else_functor_impl bool right_nullable, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto p_lhs = get_iterable_device_view{}(lhs_h, stream); auto p_rhs = get_iterable_device_view{}(rhs_h, stream); @@ -110,7 +111,7 @@ struct copy_if_else_functor_impl { bool right_nullable, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using T = string_view; @@ -162,7 +163,7 @@ std::unique_ptr scatter_gather_based_if_else(cudf::column_view const& lh size_type size, Filter is_left, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto gather_map = rmm::device_uvector{static_cast(size), stream}; auto const gather_map_end = thrust::copy_if(rmm::exec_policy(stream), @@ -196,7 +197,7 @@ std::unique_ptr scatter_gather_based_if_else(cudf::scalar const& lhs, size_type size, Filter is_left, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto scatter_map = rmm::device_uvector{static_cast(size), stream}; auto const scatter_map_end = thrust::copy_if(rmm::exec_policy(stream), @@ -225,7 +226,7 @@ std::unique_ptr scatter_gather_based_if_else(cudf::column_view const& lh size_type size, Filter is_left, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return scatter_gather_based_if_else(rhs, lhs, size, logical_not{is_left}, stream, mr); } @@ -236,7 +237,7 @@ std::unique_ptr scatter_gather_based_if_else(cudf::scalar const& lhs, size_type size, Filter is_left, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto rhs_col = cudf::make_column_from_scalar(rhs, size, stream, mr); return scatter_gather_based_if_else(lhs, rhs_col->view(), size, is_left, stream, mr); @@ -252,7 +253,7 @@ struct copy_if_else_functor_impl { bool, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return scatter_gather_based_if_else(lhs, rhs, size, filter, stream, mr); } @@ -268,7 +269,7 @@ struct copy_if_else_functor_impl { bool, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return scatter_gather_based_if_else(lhs, rhs, size, filter, stream, mr); } @@ -284,7 +285,7 @@ struct copy_if_else_functor_impl { bool, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return scatter_gather_based_if_else(lhs, rhs, size, filter, stream, mr); } @@ -303,7 +304,7 @@ struct copy_if_else_functor { bool right_nullable, Filter filter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { copy_if_else_functor_impl copier{}; return copier(lhs, rhs, size, left_nullable, right_nullable, filter, stream, mr); @@ -318,7 +319,7 @@ std::unique_ptr copy_if_else(Left const& lhs, bool right_nullable, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(boolean_mask.type() == data_type(type_id::BOOL8), "Boolean mask column must be of type type_id::BOOL8", @@ -356,7 +357,7 @@ std::unique_ptr copy_if_else(column_view const& lhs, column_view const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(boolean_mask.size() == lhs.size(), "Boolean mask column must be the same size as lhs and rhs columns", @@ -372,7 +373,7 @@ std::unique_ptr copy_if_else(scalar const& lhs, column_view const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(boolean_mask.size() == rhs.size(), "Boolean mask column must be the same size as rhs column", @@ -390,7 +391,7 @@ std::unique_ptr copy_if_else(column_view const& lhs, scalar const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(boolean_mask.size() == lhs.size(), "Boolean mask column must be the same size as lhs column", @@ -408,7 +409,7 @@ std::unique_ptr copy_if_else(scalar const& lhs, scalar const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS( lhs.type() == rhs.type(), "Both inputs must be of the same type", cudf::data_type_error); @@ -422,7 +423,7 @@ std::unique_ptr copy_if_else(column_view const& lhs, column_view const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_if_else(lhs, rhs, boolean_mask, stream, mr); @@ -432,7 +433,7 @@ std::unique_ptr copy_if_else(scalar const& lhs, column_view const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_if_else(lhs, rhs, boolean_mask, stream, mr); @@ -442,7 +443,7 @@ std::unique_ptr copy_if_else(column_view const& lhs, scalar const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_if_else(lhs, rhs, boolean_mask, stream, mr); @@ -452,7 +453,7 @@ std::unique_ptr copy_if_else(scalar const& lhs, scalar const& rhs, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_if_else(lhs, rhs, boolean_mask, stream, mr); diff --git a/cpp/src/copying/copy_range.cu b/cpp/src/copying/copy_range.cu index e10d7081a55..d2ea7036952 100644 --- a/cpp/src/copying/copy_range.cu +++ b/cpp/src/copying/copy_range.cu @@ -34,6 +34,7 @@ #include #include +#include #include @@ -98,7 +99,7 @@ struct out_of_place_copy_range_dispatch { cudf::size_type source_end, cudf::size_type target_begin, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { auto p_ret = std::make_unique(target, stream, mr); if ((!p_ret->nullable()) && source.has_nulls(source_begin, source_end)) { @@ -129,7 +130,7 @@ std::unique_ptr out_of_place_copy_range_dispatch::operator() out_of_place_copy_range_dispatch::operator() copy_range(column_view const& source, size_type source_end, size_type target_begin, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS((source_begin >= 0) && (source_end <= source.size()) && (source_begin <= source_end) && (target_begin >= 0) && @@ -270,7 +271,7 @@ std::unique_ptr copy_range(column_view const& source, size_type source_end, size_type target_begin, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::copy_range(source, target, source_begin, source_end, target_begin, stream, mr); diff --git a/cpp/src/copying/gather.cu b/cpp/src/copying/gather.cu index 78748e5a00b..5eb039419df 100644 --- a/cpp/src/copying/gather.cu +++ b/cpp/src/copying/gather.cu @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -39,7 +40,7 @@ std::unique_ptr
gather(table_view const& source_table, out_of_bounds_policy bounds_policy, negative_index_policy neg_indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(not gather_map.has_nulls(), "gather_map contains nulls", std::invalid_argument); @@ -66,7 +67,7 @@ std::unique_ptr
gather(table_view const& source_table, out_of_bounds_policy bounds_policy, negative_index_policy neg_indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(gather_map.size() <= static_cast(std::numeric_limits::max()), "gather map size exceeds the column size limit", @@ -85,7 +86,7 @@ std::unique_ptr
gather(table_view const& source_table, column_view const& gather_map, out_of_bounds_policy bounds_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/copying/get_element.cu b/cpp/src/copying/get_element.cu index 2e804415439..b8860da479c 100644 --- a/cpp/src/copying/get_element.cu +++ b/cpp/src/copying/get_element.cu @@ -29,6 +29,7 @@ #include #include +#include #include @@ -42,7 +43,7 @@ struct get_element_functor { std::unique_ptr operator()(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto s = make_fixed_width_scalar(data_type(type_to_id()), stream, mr); @@ -65,7 +66,7 @@ struct get_element_functor { std::unique_ptr operator()(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto device_col = column_device_view::create(input, stream); @@ -89,7 +90,7 @@ struct get_element_functor { std::unique_ptr operator()(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto dict_view = dictionary_column_view(input); auto indices_iter = detail::indexalator_factory::make_input_iterator(dict_view.indices()); @@ -124,7 +125,7 @@ struct get_element_functor { std::unique_ptr operator()(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { bool valid = is_element_valid_sync(input, index, stream); auto const child_col_idx = lists_column_view::child_column_index; @@ -148,7 +149,7 @@ struct get_element_functor { std::unique_ptr operator()(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using Type = typename T::rep; @@ -178,7 +179,7 @@ struct get_element_functor { std::unique_ptr operator()(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { bool valid = is_element_valid_sync(input, index, stream); auto row_contents = @@ -193,7 +194,7 @@ struct get_element_functor { std::unique_ptr get_element(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(index >= 0 and index < input.size(), "Index out of bounds", std::out_of_range); return type_dispatcher(input.type(), get_element_functor{}, input, index, stream, mr); @@ -204,7 +205,7 @@ std::unique_ptr get_element(column_view const& input, std::unique_ptr get_element(column_view const& input, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::get_element(input, index, stream, mr); diff --git a/cpp/src/copying/pack.cpp b/cpp/src/copying/pack.cpp index e4de4a43b68..b0208a58896 100644 --- a/cpp/src/copying/pack.cpp +++ b/cpp/src/copying/pack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -144,7 +145,7 @@ void build_column_metadata(metadata_builder& mb, */ packed_columns pack(cudf::table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // do a contiguous_split with no splits to get the memory for the table // arranged as we want it @@ -260,7 +261,7 @@ void metadata_builder::clear() { return impl->clear(); } /** * @copydoc cudf::pack */ -packed_columns pack(cudf::table_view const& input, rmm::mr::device_memory_resource* mr) +packed_columns pack(cudf::table_view const& input, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::pack(input, cudf::get_default_stream(), mr); diff --git a/cpp/src/copying/purge_nonempty_nulls.cu b/cpp/src/copying/purge_nonempty_nulls.cu index 620a03d8be5..d69d214a881 100644 --- a/cpp/src/copying/purge_nonempty_nulls.cu +++ b/cpp/src/copying/purge_nonempty_nulls.cu @@ -18,6 +18,8 @@ #include #include +#include + #include #include @@ -87,7 +89,7 @@ bool has_nonempty_nulls(cudf::column_view const& input, rmm::cuda_stream_view st std::unique_ptr purge_nonempty_nulls(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // If not compound types (LIST/STRING/STRUCT/DICTIONARY) then just copy the input into output. if (!cudf::is_compound(input.type())) { return std::make_unique(input, stream, mr); } @@ -132,11 +134,11 @@ bool has_nonempty_nulls(column_view const& input, rmm::cuda_stream_view stream) } /** - * @copydoc cudf::purge_nonempty_nulls(column_view const&, rmm::mr::device_memory_resource*) + * @copydoc cudf::purge_nonempty_nulls(column_view const&, rmm::device_async_resource_ref) */ std::unique_ptr purge_nonempty_nulls(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::purge_nonempty_nulls(input, stream, mr); } diff --git a/cpp/src/copying/reverse.cu b/cpp/src/copying/reverse.cu index 78d1b54882c..d3d42e35e26 100644 --- a/cpp/src/copying/reverse.cu +++ b/cpp/src/copying/reverse.cu @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -37,7 +38,7 @@ namespace cudf { namespace detail { std::unique_ptr
reverse(table_view const& source_table, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { size_type num_rows = source_table.num_rows(); auto elements = make_counting_transform_iterator( @@ -51,7 +52,7 @@ std::unique_ptr
reverse(table_view const& source_table, std::unique_ptr reverse(column_view const& source_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return std::move( cudf::detail::reverse(table_view({source_column}), stream, mr)->release().front()); @@ -60,7 +61,7 @@ std::unique_ptr reverse(column_view const& source_column, std::unique_ptr
reverse(table_view const& source_table, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::reverse(source_table, stream, mr); @@ -68,7 +69,7 @@ std::unique_ptr
reverse(table_view const& source_table, std::unique_ptr reverse(column_view const& source_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::reverse(source_column, stream, mr); diff --git a/cpp/src/copying/sample.cu b/cpp/src/copying/sample.cu index 0211f97deb3..f8e3a9a83e3 100644 --- a/cpp/src/copying/sample.cu +++ b/cpp/src/copying/sample.cu @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -40,7 +41,7 @@ std::unique_ptr
sample(table_view const& input, sample_with_replacement replacement, int64_t const seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(n >= 0, "expected number of samples should be non-negative"); auto const num_rows = input.num_rows(); @@ -92,7 +93,7 @@ std::unique_ptr
sample(table_view const& input, sample_with_replacement replacement, int64_t const seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sample(input, n, replacement, seed, stream, mr); diff --git a/cpp/src/copying/scatter.cu b/cpp/src/copying/scatter.cu index 3bc3979ec1b..cfcbe4724df 100644 --- a/cpp/src/copying/scatter.cu +++ b/cpp/src/copying/scatter.cu @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -77,7 +78,7 @@ void scatter_scalar_bitmask_inplace(std::reference_wrapper const& size_type num_scatter_rows, column& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { constexpr size_type block_size = 256; size_type const grid_size = grid_1d(num_scatter_rows, block_size).num_blocks; @@ -109,7 +110,7 @@ struct column_scalar_scatterer_impl { size_type scatter_rows, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(source.get().type() == target.type(), "scalar and column types must match", @@ -142,7 +143,7 @@ struct column_scalar_scatterer_impl { size_type scatter_rows, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(source.get().type() == target.type(), "scalar and column types must match", @@ -166,7 +167,7 @@ struct column_scalar_scatterer_impl { size_type scatter_rows, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(source.get().type() == target.type(), "scalar and column types must match", @@ -186,7 +187,7 @@ struct column_scalar_scatterer_impl { size_type scatter_rows, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto dict_target = dictionary::detail::add_keys(dictionary_column_view(target), @@ -238,7 +239,7 @@ struct column_scalar_scatterer { size_type scatter_rows, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { column_scalar_scatterer_impl scatterer{}; return scatterer(source, scatter_iter, scatter_rows, target, stream, mr); @@ -252,7 +253,7 @@ struct column_scalar_scatterer_impl { size_type scatter_rows, column_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(source.get().type() == target.type(), "scalar and column types must match", @@ -306,7 +307,7 @@ std::unique_ptr
scatter(table_view const& source, column_view const& scatter_map, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(source.num_columns() == target.num_columns(), "Number of columns in source and target not equal", @@ -336,7 +337,7 @@ std::unique_ptr
scatter(table_view const& source, device_span const scatter_map, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(scatter_map.size() <= static_cast(std::numeric_limits::max()), "scatter map size exceeds the column size limit", @@ -353,7 +354,7 @@ std::unique_ptr
scatter(std::vector> column_view const& indices, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(source.size() == static_cast(target.num_columns()), "Number of scalars in source and number of columns in target not equal", @@ -405,7 +406,7 @@ std::unique_ptr boolean_mask_scatter(column_view const& input, column_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto indices = cudf::make_numeric_column( data_type{type_id::INT32}, target.size(), mask_state::UNALLOCATED, stream); @@ -430,7 +431,7 @@ std::unique_ptr boolean_mask_scatter(scalar const& input, column_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::copy_if_else(input, target, boolean_mask, stream, mr); } @@ -439,7 +440,7 @@ std::unique_ptr
boolean_mask_scatter(table_view const& input, table_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(input.num_columns() == target.num_columns(), "Mismatch in number of input columns and target columns", @@ -482,7 +483,7 @@ std::unique_ptr
boolean_mask_scatter( table_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(static_cast(input.size()) == target.num_columns(), "Mismatch in number of scalars and target columns", @@ -527,7 +528,7 @@ std::unique_ptr
scatter(table_view const& source, column_view const& scatter_map, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::scatter(source, scatter_map, target, stream, mr); @@ -537,7 +538,7 @@ std::unique_ptr
scatter(std::vector> column_view const& indices, table_view const& target, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::scatter(source, indices, target, stream, mr); @@ -547,7 +548,7 @@ std::unique_ptr
boolean_mask_scatter(table_view const& input, table_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::boolean_mask_scatter(input, target, boolean_mask, stream, mr); @@ -558,7 +559,7 @@ std::unique_ptr
boolean_mask_scatter( table_view const& target, column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::boolean_mask_scatter(input, target, boolean_mask, stream, mr); diff --git a/cpp/src/copying/segmented_shift.cu b/cpp/src/copying/segmented_shift.cu index dd2733cf7e9..b7abc60f240 100644 --- a/cpp/src/copying/segmented_shift.cu +++ b/cpp/src/copying/segmented_shift.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -73,7 +74,7 @@ struct segmented_shift_functor() size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_device_view = column_device_view::create(segmented_values, stream); bool nullable = not fill_value.is_valid(stream) or segmented_values.nullable(); @@ -102,7 +103,7 @@ struct segmented_shift_functor { size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_device_view = column_device_view::create(segmented_values, stream); auto input_iterator = make_optional_iterator( @@ -129,7 +130,7 @@ struct segmented_shift_functor_forwarder { size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { segmented_shift_functor shifter; return shifter(segmented_values, segment_offsets, offset, fill_value, stream, mr); @@ -143,7 +144,7 @@ std::unique_ptr segmented_shift(column_view const& segmented_values, size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (segmented_values.is_empty()) { return empty_like(segmented_values); } if (offset == 0) { return std::make_unique(segmented_values, stream, mr); }; diff --git a/cpp/src/copying/shift.cu b/cpp/src/copying/shift.cu index 8e013bb1212..bdc741887f7 100644 --- a/cpp/src/copying/shift.cu +++ b/cpp/src/copying/shift.cu @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -51,7 +52,7 @@ std::pair create_null_mask(column_device_view con size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const size = input.size(); auto func_validity = @@ -81,7 +82,7 @@ struct shift_functor { size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output = cudf::strings::detail::shift( cudf::strings_column_view(input), offset, fill_value, stream, mr); @@ -101,7 +102,7 @@ struct shift_functor { size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using ScalarType = cudf::scalar_type_t; auto& scalar = static_cast(fill_value); @@ -155,7 +156,7 @@ std::unique_ptr shift(column_view const& input, size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(input.type() == fill_value.type(), "shift requires each fill value type to match the corresponding column type.", @@ -173,7 +174,7 @@ std::unique_ptr shift(column_view const& input, size_type offset, scalar const& fill_value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::shift(input, offset, fill_value, stream, mr); diff --git a/cpp/src/datetime/datetime_ops.cu b/cpp/src/datetime/datetime_ops.cu index 371663c41ee..7629cad79a9 100644 --- a/cpp/src/datetime/datetime_ops.cu +++ b/cpp/src/datetime/datetime_ops.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -254,7 +255,7 @@ struct dispatch_round { rounding_frequency component, cudf::column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto size = column.size(); auto output_col_type = data_type{cudf::type_to_id()}; @@ -319,7 +320,7 @@ struct launch_functor { template std::unique_ptr apply_datetime_op(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(is_timestamp(column.type()), "Column type should be timestamp"); auto size = column.size(); @@ -355,7 +356,7 @@ struct add_calendrical_months_functor { column_view timestamp_column, MonthIterator months_begin, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto size = timestamp_column.size(); auto output_col_type = timestamp_column.type(); @@ -386,7 +387,7 @@ struct add_calendrical_months_functor { std::unique_ptr add_calendrical_months(column_view const& timestamp_column, column_view const& months_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(is_timestamp(timestamp_column.type()), "Column type should be timestamp"); CUDF_EXPECTS( @@ -413,7 +414,7 @@ std::unique_ptr add_calendrical_months(column_view const& timestamp_colu std::unique_ptr add_calendrical_months(column_view const& timestamp_column, scalar const& months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(is_timestamp(timestamp_column.type()), "Column type should be timestamp"); CUDF_EXPECTS(months.type().id() == type_id::INT16 or months.type().id() == type_id::INT32, @@ -442,7 +443,7 @@ std::unique_ptr round_general(rounding_function round_kind, rounding_frequency component, column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return cudf::type_dispatcher( column.type(), dispatch_round{}, round_kind, component, column, stream, mr); @@ -450,7 +451,7 @@ std::unique_ptr round_general(rounding_function round_kind, std::unique_ptr extract_year(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -459,7 +460,7 @@ std::unique_ptr extract_year(column_view const& column, std::unique_ptr extract_month(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -468,7 +469,7 @@ std::unique_ptr extract_month(column_view const& column, std::unique_ptr extract_day(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -477,7 +478,7 @@ std::unique_ptr extract_day(column_view const& column, std::unique_ptr extract_weekday(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -486,7 +487,7 @@ std::unique_ptr extract_weekday(column_view const& column, std::unique_ptr extract_hour(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -495,7 +496,7 @@ std::unique_ptr extract_hour(column_view const& column, std::unique_ptr extract_minute(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -504,7 +505,7 @@ std::unique_ptr extract_minute(column_view const& column, std::unique_ptr extract_second(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -513,7 +514,7 @@ std::unique_ptr extract_second(column_view const& column, std::unique_ptr extract_millisecond_fraction(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -522,7 +523,7 @@ std::unique_ptr extract_millisecond_fraction(column_view const& column, std::unique_ptr extract_microsecond_fraction(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -531,7 +532,7 @@ std::unique_ptr extract_microsecond_fraction(column_view const& column, std::unique_ptr extract_nanosecond_fraction(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op< detail::extract_component_operator, @@ -540,7 +541,7 @@ std::unique_ptr extract_nanosecond_fraction(column_view const& column, std::unique_ptr last_day_of_month(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op(column, stream, mr); @@ -548,7 +549,7 @@ std::unique_ptr last_day_of_month(column_view const& column, std::unique_ptr day_of_year(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::apply_datetime_op( column, stream, mr); @@ -556,21 +557,21 @@ std::unique_ptr day_of_year(column_view const& column, std::unique_ptr is_leap_year(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return apply_datetime_op(column, stream, mr); } std::unique_ptr days_in_month(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return apply_datetime_op(column, stream, mr); } std::unique_ptr extract_quarter(column_view const& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return apply_datetime_op(column, stream, mr); } @@ -579,7 +580,7 @@ std::unique_ptr extract_quarter(column_view const& column, std::unique_ptr ceil_datetimes(column_view const& column, rounding_frequency freq, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::round_general( @@ -588,7 +589,7 @@ std::unique_ptr ceil_datetimes(column_view const& column, std::unique_ptr floor_datetimes(column_view const& column, rounding_frequency freq, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::round_general( @@ -597,88 +598,85 @@ std::unique_ptr floor_datetimes(column_view const& column, std::unique_ptr round_datetimes(column_view const& column, rounding_frequency freq, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::round_general( detail::rounding_function::ROUND, freq, column, cudf::get_default_stream(), mr); } -std::unique_ptr extract_year(column_view const& column, rmm::mr::device_memory_resource* mr) +std::unique_ptr extract_year(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_year(column, cudf::get_default_stream(), mr); } -std::unique_ptr extract_month(column_view const& column, - rmm::mr::device_memory_resource* mr) +std::unique_ptr extract_month(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_month(column, cudf::get_default_stream(), mr); } -std::unique_ptr extract_day(column_view const& column, rmm::mr::device_memory_resource* mr) +std::unique_ptr extract_day(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_day(column, cudf::get_default_stream(), mr); } std::unique_ptr extract_weekday(column_view const& column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_weekday(column, cudf::get_default_stream(), mr); } -std::unique_ptr extract_hour(column_view const& column, rmm::mr::device_memory_resource* mr) +std::unique_ptr extract_hour(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_hour(column, cudf::get_default_stream(), mr); } -std::unique_ptr extract_minute(column_view const& column, - rmm::mr::device_memory_resource* mr) +std::unique_ptr extract_minute(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_minute(column, cudf::get_default_stream(), mr); } -std::unique_ptr extract_second(column_view const& column, - rmm::mr::device_memory_resource* mr) +std::unique_ptr extract_second(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_second(column, cudf::get_default_stream(), mr); } std::unique_ptr extract_millisecond_fraction(column_view const& column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_millisecond_fraction(column, cudf::get_default_stream(), mr); } std::unique_ptr extract_microsecond_fraction(column_view const& column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_microsecond_fraction(column, cudf::get_default_stream(), mr); } std::unique_ptr extract_nanosecond_fraction(column_view const& column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_nanosecond_fraction(column, cudf::get_default_stream(), mr); } std::unique_ptr last_day_of_month(column_view const& column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::last_day_of_month(column, cudf::get_default_stream(), mr); } -std::unique_ptr day_of_year(column_view const& column, rmm::mr::device_memory_resource* mr) +std::unique_ptr day_of_year(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::day_of_year(column, cudf::get_default_stream(), mr); @@ -686,7 +684,7 @@ std::unique_ptr day_of_year(column_view const& column, rmm::mr::device_m std::unique_ptr add_calendrical_months(cudf::column_view const& timestamp_column, cudf::column_view const& months_column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::add_calendrical_months( @@ -695,27 +693,26 @@ std::unique_ptr add_calendrical_months(cudf::column_view const& ti std::unique_ptr add_calendrical_months(cudf::column_view const& timestamp_column, cudf::scalar const& months, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::add_calendrical_months(timestamp_column, months, cudf::get_default_stream(), mr); } -std::unique_ptr is_leap_year(column_view const& column, rmm::mr::device_memory_resource* mr) +std::unique_ptr is_leap_year(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::is_leap_year(column, cudf::get_default_stream(), mr); } -std::unique_ptr days_in_month(column_view const& column, - rmm::mr::device_memory_resource* mr) +std::unique_ptr days_in_month(column_view const& column, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::days_in_month(column, cudf::get_default_stream(), mr); } std::unique_ptr extract_quarter(column_view const& column, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_quarter(column, cudf::get_default_stream(), mr); diff --git a/cpp/src/datetime/timezone.cpp b/cpp/src/datetime/timezone.cpp index a75eea7172f..a3471485293 100644 --- a/cpp/src/datetime/timezone.cpp +++ b/cpp/src/datetime/timezone.cpp @@ -19,6 +19,8 @@ #include #include +#include + #include #include #include @@ -379,7 +381,7 @@ static int64_t get_transition_time(dst_transition_s const& trans, int year) std::unique_ptr
make_timezone_transition_table(std::optional tzif_dir, std::string_view timezone_name, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::make_timezone_transition_table( @@ -391,7 +393,7 @@ namespace detail { std::unique_ptr
make_timezone_transition_table(std::optional tzif_dir, std::string_view timezone_name, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (timezone_name == "UTC" || timezone_name.empty()) { // Return an empty table for UTC diff --git a/cpp/src/dictionary/add_keys.cu b/cpp/src/dictionary/add_keys.cu index 3973100aced..5fd21ee0094 100644 --- a/cpp/src/dictionary/add_keys.cu +++ b/cpp/src/dictionary/add_keys.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -49,7 +50,7 @@ namespace detail { std::unique_ptr add_keys(dictionary_column_view const& dictionary_column, column_view const& new_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!new_keys.has_nulls(), "Keys must not have nulls"); auto old_keys = dictionary_column.keys(); // [a,b,c,d,f] @@ -131,7 +132,7 @@ std::unique_ptr add_keys(dictionary_column_view const& dictionary_column std::unique_ptr add_keys(dictionary_column_view const& dictionary_column, column_view const& keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::add_keys(dictionary_column, keys, stream, mr); diff --git a/cpp/src/dictionary/decode.cu b/cpp/src/dictionary/decode.cu index 8ce741c4a91..9f05593fc40 100644 --- a/cpp/src/dictionary/decode.cu +++ b/cpp/src/dictionary/decode.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -46,7 +47,7 @@ struct indices_handler_fn { */ std::unique_ptr decode(dictionary_column_view const& source, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (source.is_empty()) return make_empty_column(type_id::EMPTY); @@ -77,7 +78,7 @@ std::unique_ptr decode(dictionary_column_view const& source, std::unique_ptr decode(dictionary_column_view const& source, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::decode(source, stream, mr); diff --git a/cpp/src/dictionary/detail/concatenate.cu b/cpp/src/dictionary/detail/concatenate.cu index 17295fb0345..62a6c816493 100644 --- a/cpp/src/dictionary/detail/concatenate.cu +++ b/cpp/src/dictionary/detail/concatenate.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -140,7 +141,7 @@ struct dispatch_compute_indices { offsets_pair const* d_offsets, size_type const* d_map_to_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto keys_view = column_device_view::create(all_keys, stream); auto indices_view = column_device_view::create(all_indices, stream); @@ -206,7 +207,7 @@ struct dispatch_compute_indices { std::unique_ptr concatenate(host_span columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // exception here is the same behavior as in cudf::concatenate CUDF_EXPECTS(not columns.empty(), "Unexpected empty list of columns to concatenate."); diff --git a/cpp/src/dictionary/detail/merge.cu b/cpp/src/dictionary/detail/merge.cu index 2fe21680873..c65aa5d1101 100644 --- a/cpp/src/dictionary/detail/merge.cu +++ b/cpp/src/dictionary/detail/merge.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include #include @@ -36,7 +37,7 @@ std::unique_ptr merge(dictionary_column_view const& lcol, dictionary_column_view const& rcol, cudf::detail::index_vector const& row_order, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const lcol_iter = cudf::detail::indexalator_factory::make_input_iterator(lcol.indices()); auto const rcol_iter = cudf::detail::indexalator_factory::make_input_iterator(rcol.indices()); diff --git a/cpp/src/dictionary/dictionary_factories.cu b/cpp/src/dictionary/dictionary_factories.cu index f70423a13a9..37f8fa7a05b 100644 --- a/cpp/src/dictionary/dictionary_factories.cu +++ b/cpp/src/dictionary/dictionary_factories.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace { @@ -30,7 +31,7 @@ struct dispatch_create_indices { template ()>* = nullptr> std::unique_ptr operator()(column_view const& indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(std::is_unsigned(), "indices must be an unsigned type"); column_view indices_view{ @@ -40,7 +41,7 @@ struct dispatch_create_indices { template ()>* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) + rmm::device_async_resource_ref) { CUDF_FAIL("indices must be an integer type."); } @@ -50,7 +51,7 @@ struct dispatch_create_indices { std::unique_ptr make_dictionary_column(column_view const& keys_column, column_view const& indices_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!keys_column.has_nulls(), "keys column must not have nulls"); if (keys_column.is_empty()) return make_empty_column(type_id::DICTIONARY32); @@ -117,7 +118,7 @@ struct make_unsigned_fn { std::unique_ptr make_dictionary_column(std::unique_ptr keys, std::unique_ptr indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!keys->has_nulls(), "keys column must not have nulls"); diff --git a/cpp/src/dictionary/encode.cu b/cpp/src/dictionary/encode.cu index c92b57f0cac..ff29d83b80a 100644 --- a/cpp/src/dictionary/encode.cu +++ b/cpp/src/dictionary/encode.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -41,7 +42,7 @@ namespace detail { std::unique_ptr encode(column_view const& input_column, data_type indices_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(is_unsigned(indices_type), "indices must be type unsigned integer"); CUDF_EXPECTS(input_column.type().id() != type_id::DICTIONARY32, @@ -90,7 +91,7 @@ data_type get_indices_type_for_size(size_type keys_size) std::unique_ptr encode(column_view const& input_column, data_type indices_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::encode(input_column, indices_type, stream, mr); diff --git a/cpp/src/dictionary/remove_keys.cu b/cpp/src/dictionary/remove_keys.cu index 86b70f1119b..718ca419289 100644 --- a/cpp/src/dictionary/remove_keys.cu +++ b/cpp/src/dictionary/remove_keys.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -59,7 +60,7 @@ template std::unique_ptr remove_keys_fn(dictionary_column_view const& dictionary_column, KeysKeeper keys_to_keep_fn, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const keys_view = dictionary_column.keys(); auto const indices_type = dictionary_column.indices().type(); @@ -150,7 +151,7 @@ std::unique_ptr remove_keys_fn(dictionary_column_view const& dictionary_ std::unique_ptr remove_keys(dictionary_column_view const& dictionary_column, column_view const& keys_to_remove, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!keys_to_remove.has_nulls(), "keys_to_remove must not have nulls"); auto const keys_view = dictionary_column.keys(); @@ -166,7 +167,7 @@ std::unique_ptr remove_keys(dictionary_column_view const& dictionary_col std::unique_ptr remove_unused_keys(dictionary_column_view const& dictionary_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // locate the keys to remove auto const keys_size = dictionary_column.keys_size(); @@ -196,7 +197,7 @@ std::unique_ptr remove_unused_keys(dictionary_column_view const& diction std::unique_ptr remove_keys(dictionary_column_view const& dictionary_column, column_view const& keys_to_remove, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::remove_keys(dictionary_column, keys_to_remove, stream, mr); @@ -204,7 +205,7 @@ std::unique_ptr remove_keys(dictionary_column_view const& dictionary_col std::unique_ptr remove_unused_keys(dictionary_column_view const& dictionary_column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::remove_unused_keys(dictionary_column, stream, mr); diff --git a/cpp/src/dictionary/replace.cu b/cpp/src/dictionary/replace.cu index 7069993866c..bb6b08c243d 100644 --- a/cpp/src/dictionary/replace.cu +++ b/cpp/src/dictionary/replace.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include #include +#include namespace cudf { namespace dictionary { @@ -52,7 +53,7 @@ template std::unique_ptr replace_indices(column_view const& input, ReplacementIter replacement_iter, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const input_view = column_device_view::create(input, stream); auto const d_input = *input_view; @@ -74,12 +75,12 @@ std::unique_ptr replace_indices(column_view const& input, /** * @copydoc cudf::dictionary::detail::replace_nulls(cudf::column_view const&,cudf::column_view - * const& rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + * const& rmm::cuda_stream_view, rmm::device_async_resource_ref) */ std::unique_ptr replace_nulls(dictionary_column_view const& input, dictionary_column_view const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.is_empty()) { return cudf::empty_like(input.parent()); } if (!input.has_nulls()) { return std::make_unique(input.parent(), stream, mr); } @@ -107,12 +108,12 @@ std::unique_ptr replace_nulls(dictionary_column_view const& input, /** * @copydoc cudf::dictionary::detail::replace_nulls(cudf::column_view const&,cudf::scalar - * const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + * const&, rmm::cuda_stream_view, rmm::device_async_resource_ref) */ std::unique_ptr replace_nulls(dictionary_column_view const& input, scalar const& replacement, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.is_empty()) { return cudf::empty_like(input.parent()); } if (!input.has_nulls() || !replacement.is_valid(stream)) { diff --git a/cpp/src/dictionary/search.cu b/cpp/src/dictionary/search.cu index e35aded1984..680eadddba8 100644 --- a/cpp/src/dictionary/search.cu +++ b/cpp/src/dictionary/search.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -40,7 +41,7 @@ struct dispatch_scalar_index { std::unique_ptr operator()(size_type index, bool is_valid, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return std::make_unique>(index, is_valid, stream, mr); } @@ -69,7 +70,7 @@ struct find_index_fn { std::unique_ptr operator()(dictionary_column_view const& input, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { if (!key.is_valid(stream)) return type_dispatcher(input.indices().type(), dispatch_scalar_index{}, 0, false, stream, mr); @@ -96,7 +97,7 @@ struct find_index_fn { std::unique_ptr operator()(dictionary_column_view const&, scalar const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) const + rmm::device_async_resource_ref) const { CUDF_FAIL( "dictionary, list_view, and struct_view columns cannot be the keys column of a dictionary"); @@ -111,7 +112,7 @@ struct find_insert_index_fn { std::unique_ptr operator()(dictionary_column_view const& input, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { if (!key.is_valid(stream)) return type_dispatcher(input.indices().type(), dispatch_scalar_index{}, 0, false, stream, mr); @@ -138,7 +139,7 @@ struct find_insert_index_fn { std::unique_ptr operator()(dictionary_column_view const&, scalar const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) const + rmm::device_async_resource_ref) const { CUDF_FAIL("dictionary, list_view, and struct_view columns cannot be the keys for a dictionary"); } @@ -149,7 +150,7 @@ struct find_insert_index_fn { std::unique_ptr get_index(dictionary_column_view const& dictionary, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (dictionary.is_empty()) return std::make_unique>(0, false, stream, mr); @@ -160,7 +161,7 @@ std::unique_ptr get_index(dictionary_column_view const& dictionary, std::unique_ptr get_insert_index(dictionary_column_view const& dictionary, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (dictionary.is_empty()) return std::make_unique>(0, false, stream, mr); @@ -175,7 +176,7 @@ std::unique_ptr get_insert_index(dictionary_column_view const& dictionar std::unique_ptr get_index(dictionary_column_view const& dictionary, scalar const& key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::get_index(dictionary, key, stream, mr); diff --git a/cpp/src/dictionary/set_keys.cu b/cpp/src/dictionary/set_keys.cu index b49cf7850b1..b56eec9401a 100644 --- a/cpp/src/dictionary/set_keys.cu +++ b/cpp/src/dictionary/set_keys.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -61,7 +62,7 @@ struct dispatch_compute_indices { operator()(dictionary_column_view const& input, column_view const& new_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto dictionary_view = column_device_view::create(input.parent(), stream); auto dictionary_itr = make_dictionary_iterator(*dictionary_view); @@ -119,7 +120,7 @@ struct dispatch_compute_indices { std::unique_ptr set_keys(dictionary_column_view const& dictionary_column, column_view const& new_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!new_keys.has_nulls(), "keys parameter must not have nulls"); auto keys = dictionary_column.keys(); @@ -177,7 +178,7 @@ std::unique_ptr set_keys(dictionary_column_view const& dictionary_column std::vector> match_dictionaries( cudf::host_span input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector keys(input.size()); std::transform(input.begin(), input.end(), keys.begin(), [](auto& col) { return col.keys(); }); @@ -191,7 +192,7 @@ std::vector> match_dictionaries( } std::pair>, std::vector> match_dictionaries( - std::vector tables, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + std::vector tables, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { // Make a copy of all the column views from each table_view std::vector> updated_columns; @@ -242,7 +243,7 @@ std::pair>, std::vector> match_d std::unique_ptr set_keys(dictionary_column_view const& dictionary_column, column_view const& keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::set_keys(dictionary_column, keys, stream, mr); @@ -251,7 +252,7 @@ std::unique_ptr set_keys(dictionary_column_view const& dictionary_column std::vector> match_dictionaries( cudf::host_span input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::match_dictionaries(input, stream, mr); diff --git a/cpp/src/filling/calendrical_month_sequence.cu b/cpp/src/filling/calendrical_month_sequence.cu index 80badb7d566..3e6d693dde5 100644 --- a/cpp/src/filling/calendrical_month_sequence.cu +++ b/cpp/src/filling/calendrical_month_sequence.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -30,7 +31,7 @@ std::unique_ptr calendrical_month_sequence(size_type size, scalar const& init, size_type months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type_dispatcher( init.type(), calendrical_month_sequence_functor{}, size, init, months, stream, mr); @@ -41,7 +42,7 @@ std::unique_ptr calendrical_month_sequence(size_type size, scalar const& init, size_type months, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::calendrical_month_sequence(size, init, months, stream, mr); diff --git a/cpp/src/filling/fill.cu b/cpp/src/filling/fill.cu index 42d1f7592ec..c4d786bd73b 100644 --- a/cpp/src/filling/fill.cu +++ b/cpp/src/filling/fill.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ #include #include +#include #include @@ -107,7 +108,7 @@ struct out_of_place_fill_range_dispatch { std::unique_ptr operator()(cudf::size_type begin, cudf::size_type end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(input.type() == value.type(), "Data type mismatch."); auto p_ret = std::make_unique(input, stream, mr); @@ -134,7 +135,7 @@ std::unique_ptr out_of_place_fill_range_dispatch::operator(); @@ -148,7 +149,7 @@ std::unique_ptr out_of_place_fill_range_dispatch::operator()(input, stream, mr); cudf::dictionary_column_view const target(input); @@ -233,7 +234,7 @@ std::unique_ptr fill(column_view const& input, size_type end, scalar const& value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS((begin >= 0) && (end <= input.size()) && (begin <= end), "Range is out of bounds."); @@ -258,7 +259,7 @@ std::unique_ptr fill(column_view const& input, size_type end, scalar const& value, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::fill(input, begin, end, value, stream, mr); diff --git a/cpp/src/filling/repeat.cu b/cpp/src/filling/repeat.cu index 87cc0f21d0e..ff4005d9366 100644 --- a/cpp/src/filling/repeat.cu +++ b/cpp/src/filling/repeat.cu @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -102,7 +103,7 @@ namespace detail { std::unique_ptr
repeat(table_view const& input_table, column_view const& count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(input_table.num_rows() == count.size(), "in and count must have equal size"); CUDF_EXPECTS(not count.has_nulls(), "count cannot contain nulls"); @@ -131,7 +132,7 @@ std::unique_ptr
repeat(table_view const& input_table, std::unique_ptr
repeat(table_view const& input_table, size_type count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if ((input_table.num_rows() == 0) || (count == 0)) { return cudf::empty_like(input_table); } @@ -154,7 +155,7 @@ std::unique_ptr
repeat(table_view const& input_table, std::unique_ptr
repeat(table_view const& input_table, column_view const& count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::repeat(input_table, count, stream, mr); @@ -163,7 +164,7 @@ std::unique_ptr
repeat(table_view const& input_table, std::unique_ptr
repeat(table_view const& input_table, size_type count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::repeat(input_table, count, stream, mr); diff --git a/cpp/src/filling/sequence.cu b/cpp/src/filling/sequence.cu index 99a17f8b0e0..f7067c3a91b 100644 --- a/cpp/src/filling/sequence.cu +++ b/cpp/src/filling/sequence.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -66,7 +67,7 @@ struct sequence_functor { scalar const& init, scalar const& step, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto result = make_fixed_width_column(init.type(), size, mask_state::UNALLOCATED, stream, mr); auto result_device_view = mutable_column_device_view::create(*result, stream); @@ -92,7 +93,7 @@ struct sequence_functor { std::unique_ptr operator()(size_type size, scalar const& init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto result = make_fixed_width_column(init.type(), size, mask_state::UNALLOCATED, stream, mr); auto result_device_view = mutable_column_device_view::create(*result, stream); @@ -125,7 +126,7 @@ std::unique_ptr sequence(size_type size, scalar const& init, scalar const& step, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(init.type() == step.type(), "init and step must be of the same type."); CUDF_EXPECTS(size >= 0, "size must be >= 0"); @@ -137,7 +138,7 @@ std::unique_ptr sequence(size_type size, std::unique_ptr sequence(size_type size, scalar const& init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(size >= 0, "size must be >= 0"); CUDF_EXPECTS(is_numeric(init.type()), "init scalar type must be numeric"); @@ -151,7 +152,7 @@ std::unique_ptr sequence(size_type size, scalar const& init, scalar const& step, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sequence(size, init, step, stream, mr); @@ -160,7 +161,7 @@ std::unique_ptr sequence(size_type size, std::unique_ptr sequence(size_type size, scalar const& init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sequence(size, init, stream, mr); diff --git a/cpp/src/groupby/common/utils.hpp b/cpp/src/groupby/common/utils.hpp index 09b85c74f08..82c3c08b501 100644 --- a/cpp/src/groupby/common/utils.hpp +++ b/cpp/src/groupby/common/utils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ #include #include +#include + #include #include @@ -31,7 +33,7 @@ template inline std::vector extract_results(host_span requests, cudf::detail::result_cache& cache, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector results(requests.size()); std::unordered_map>, diff --git a/cpp/src/groupby/groupby.cu b/cpp/src/groupby/groupby.cu index e3c021eb66a..73cb4efd283 100644 --- a/cpp/src/groupby/groupby.cu +++ b/cpp/src/groupby/groupby.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ #include #include +#include #include @@ -65,7 +66,7 @@ groupby::groupby(table_view const& keys, std::pair, std::vector> groupby::dispatch_aggregation( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // If sort groupby has been called once on this groupby object, then // always use sort groupby from now on. Because once keys are sorted, @@ -193,7 +194,7 @@ void verify_valid_requests(host_span requests) // Compute aggregation requests std::pair, std::vector> groupby::aggregate( - host_span requests, rmm::mr::device_memory_resource* mr) + host_span requests, rmm::device_async_resource_ref mr) { return aggregate(requests, cudf::get_default_stream(), mr); } @@ -202,7 +203,7 @@ std::pair, std::vector> groupby::aggr std::pair, std::vector> groupby::aggregate( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS( @@ -220,7 +221,7 @@ std::pair, std::vector> groupby::aggr // Compute scan requests std::pair, std::vector> groupby::scan( - host_span requests, rmm::mr::device_memory_resource* mr) + host_span requests, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS( @@ -236,7 +237,7 @@ std::pair, std::vector> groupby::scan return sort_scan(requests, cudf::get_default_stream(), mr); } -groupby::groups groupby::get_groups(table_view values, rmm::mr::device_memory_resource* mr) +groupby::groups groupby::get_groups(table_view values, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); auto const stream = cudf::get_default_stream(); @@ -262,7 +263,7 @@ groupby::groups groupby::get_groups(table_view values, rmm::mr::device_memory_re std::pair, std::unique_ptr
> groupby::replace_nulls( table_view const& values, host_span replace_policies, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(_keys.num_rows() == values.num_rows(), @@ -306,7 +307,7 @@ std::pair, std::unique_ptr
> groupby::shift( table_view const& values, host_span offsets, std::vector> const& fill_values, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(values.num_columns() == static_cast(fill_values.size()), diff --git a/cpp/src/groupby/hash/groupby.cu b/cpp/src/groupby/hash/groupby.cu index acc1b087510..4f75ab19c66 100644 --- a/cpp/src/groupby/hash/groupby.cu +++ b/cpp/src/groupby/hash/groupby.cu @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -190,7 +191,7 @@ class hash_compound_agg_finalizer final : public cudf::detail::aggregation_final SetType set; bitmask_type const* __restrict__ row_bitmask; rmm::cuda_stream_view stream; - rmm::mr::device_memory_resource* mr; + rmm::device_async_resource_ref mr; public: using cudf::detail::aggregation_finalizer::visit; @@ -202,7 +203,7 @@ class hash_compound_agg_finalizer final : public cudf::detail::aggregation_final SetType set, bitmask_type const* row_bitmask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : col(col), sparse_results(sparse_results), dense_results(dense_results), @@ -398,7 +399,7 @@ void sparse_to_dense_results(table_view const& keys, bool keys_have_nulls, null_policy include_null_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto row_bitmask = cudf::detail::bitmask_and(keys, stream, rmm::mr::get_current_device_resource()).first; @@ -551,7 +552,7 @@ std::unique_ptr
groupby(table_view const& keys, bool const keys_have_nulls, null_policy const include_null_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_keys = keys.num_rows(); auto const null_keys_are_equal = null_equality::EQUAL; @@ -654,7 +655,7 @@ std::pair, std::vector> groupby( host_span requests, null_policy include_null_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { cudf::detail::result_cache cache(requests.size()); diff --git a/cpp/src/groupby/sort/aggregate.cpp b/cpp/src/groupby/sort/aggregate.cpp index 2d6f99de25a..ba59616babe 100644 --- a/cpp/src/groupby/sort/aggregate.cpp +++ b/cpp/src/groupby/sort/aggregate.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -797,7 +798,7 @@ void aggregate_result_functor::operator()(aggregatio std::pair, std::vector> groupby::sort_aggregate( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // We're going to start by creating a cache of results so that aggs that // depend on other aggs will not have to be recalculated. e.g. mean depends on diff --git a/cpp/src/groupby/sort/functors.hpp b/cpp/src/groupby/sort/functors.hpp index be36956b929..057085fe85d 100644 --- a/cpp/src/groupby/sort/functors.hpp +++ b/cpp/src/groupby/sort/functors.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -42,7 +43,7 @@ struct store_result_functor { sort::sort_groupby_helper& helper, cudf::detail::result_cache& cache, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, sorted keys_are_sorted = sorted::NO) : helper(helper), cache(cache), @@ -98,8 +99,8 @@ struct store_result_functor { cudf::detail::result_cache& cache; ///< cache of results to store into column_view const& values; ///< Column of values to group and aggregate - rmm::cuda_stream_view stream; ///< CUDA stream on which to execute kernels - rmm::mr::device_memory_resource* mr; ///< Memory resource to allocate space for results + rmm::cuda_stream_view stream; ///< CUDA stream on which to execute kernels + rmm::device_async_resource_ref mr; ///< Memory resource to allocate space for results sorted keys_are_sorted; ///< Whether the keys are sorted std::unique_ptr sorted_values; ///< Memoised grouped and sorted values diff --git a/cpp/src/groupby/sort/group_argmax.cu b/cpp/src/groupby/sort/group_argmax.cu index a9c098bcf61..a1d197b1307 100644 --- a/cpp/src/groupby/sort/group_argmax.cu +++ b/cpp/src/groupby/sort/group_argmax.cu @@ -20,6 +20,7 @@ #include #include +#include #include @@ -31,7 +32,7 @@ std::unique_ptr group_argmax(column_view const& values, cudf::device_span group_labels, column_view const& key_sort_order, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto indices = type_dispatcher(values.type(), group_reduction_dispatcher{}, diff --git a/cpp/src/groupby/sort/group_argmin.cu b/cpp/src/groupby/sort/group_argmin.cu index 53a514ac8a7..03243bef836 100644 --- a/cpp/src/groupby/sort/group_argmin.cu +++ b/cpp/src/groupby/sort/group_argmin.cu @@ -20,6 +20,7 @@ #include #include +#include #include @@ -31,7 +32,7 @@ std::unique_ptr group_argmin(column_view const& values, cudf::device_span group_labels, column_view const& key_sort_order, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto indices = type_dispatcher(values.type(), group_reduction_dispatcher{}, diff --git a/cpp/src/groupby/sort/group_collect.cu b/cpp/src/groupby/sort/group_collect.cu index f95ad72f453..555c5d3ad41 100644 --- a/cpp/src/groupby/sort/group_collect.cu +++ b/cpp/src/groupby/sort/group_collect.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -50,7 +51,7 @@ std::pair, std::unique_ptr> purge_null_entries( column_view const& offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_device_view = column_device_view::create(values, stream); @@ -91,7 +92,7 @@ std::unique_ptr group_collect(column_view const& values, size_type num_groups, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto [child_column, offsets_column] = [null_handling, num_groups, &values, &group_offsets, stream, mr] { diff --git a/cpp/src/groupby/sort/group_correlation.cu b/cpp/src/groupby/sort/group_correlation.cu index 4389b833c33..152aa98a8b9 100644 --- a/cpp/src/groupby/sort/group_correlation.cu +++ b/cpp/src/groupby/sort/group_correlation.cu @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -120,7 +121,7 @@ std::unique_ptr group_covariance(column_view const& values_0, size_type min_periods, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using result_type = id_to_type; static_assert( @@ -181,7 +182,7 @@ std::unique_ptr group_correlation(column_view const& covariance, column_view const& stddev_0, column_view const& stddev_1, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using result_type = id_to_type; CUDF_EXPECTS(covariance.type().id() == type_id::FLOAT64, "Covariance result must be FLOAT64"); diff --git a/cpp/src/groupby/sort/group_count.cu b/cpp/src/groupby/sort/group_count.cu index 2f289c8c8a7..56a4943e272 100644 --- a/cpp/src/groupby/sort/group_count.cu +++ b/cpp/src/groupby/sort/group_count.cu @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -37,7 +38,7 @@ std::unique_ptr group_count_valid(column_view const& values, cudf::device_span group_labels, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(num_groups >= 0, "number of groups cannot be negative"); CUDF_EXPECTS(static_cast(values.size()) == group_labels.size(), @@ -80,7 +81,7 @@ std::unique_ptr group_count_valid(column_view const& values, std::unique_ptr group_count_all(cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(num_groups >= 0, "number of groups cannot be negative"); diff --git a/cpp/src/groupby/sort/group_count_scan.cu b/cpp/src/groupby/sort/group_count_scan.cu index 2e8fd41d984..c076f21e1f8 100644 --- a/cpp/src/groupby/sort/group_count_scan.cu +++ b/cpp/src/groupby/sort/group_count_scan.cu @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -30,7 +31,7 @@ namespace groupby { namespace detail { std::unique_ptr count_scan(cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::unique_ptr result = make_fixed_width_column( data_type{type_id::INT32}, group_labels.size(), mask_state::UNALLOCATED, stream, mr); diff --git a/cpp/src/groupby/sort/group_histogram.cu b/cpp/src/groupby/sort/group_histogram.cu index 67c30adcd47..1000ec0d470 100644 --- a/cpp/src/groupby/sort/group_histogram.cu +++ b/cpp/src/groupby/sort/group_histogram.cu @@ -26,6 +26,7 @@ #include #include +#include #include @@ -38,7 +39,7 @@ std::unique_ptr build_histogram(column_view const& values, std::optional const& partial_counts, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(static_cast(values.size()) == group_labels.size(), "Size of values column should be the same as that of group labels.", @@ -89,7 +90,7 @@ std::unique_ptr group_histogram(column_view const& values, cudf::device_span group_labels, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Empty group should be handled before reaching here. CUDF_EXPECTS(num_groups > 0, "Group should not be empty.", std::invalid_argument); @@ -101,7 +102,7 @@ std::unique_ptr group_merge_histogram(column_view const& values, cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Empty group should be handled before reaching here. CUDF_EXPECTS(num_groups > 0, "Group should not be empty.", std::invalid_argument); diff --git a/cpp/src/groupby/sort/group_m2.cu b/cpp/src/groupby/sort/group_m2.cu index 70b05100fb0..77f33486284 100644 --- a/cpp/src/groupby/sort/group_m2.cu +++ b/cpp/src/groupby/sort/group_m2.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -88,7 +89,7 @@ struct m2_functor { column_view const& group_means, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using result_type = cudf::detail::target_type_t; auto result = make_numeric_column(data_type(type_to_id()), @@ -133,7 +134,7 @@ std::unique_ptr group_m2(column_view const& values, column_view const& group_means, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) ? dictionary_column_view(values).keys().type() diff --git a/cpp/src/groupby/sort/group_max.cu b/cpp/src/groupby/sort/group_max.cu index 148188f5fdf..60b071c25ff 100644 --- a/cpp/src/groupby/sort/group_max.cu +++ b/cpp/src/groupby/sort/group_max.cu @@ -17,6 +17,7 @@ #include "groupby/sort/group_single_pass_reduction_util.cuh" #include +#include namespace cudf { namespace groupby { @@ -25,7 +26,7 @@ std::unique_ptr group_max(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) ? dictionary_column_view(values).keys().type() diff --git a/cpp/src/groupby/sort/group_max_scan.cu b/cpp/src/groupby/sort/group_max_scan.cu index 8679ab09df6..270059cfcad 100644 --- a/cpp/src/groupby/sort/group_max_scan.cu +++ b/cpp/src/groupby/sort/group_max_scan.cu @@ -17,6 +17,7 @@ #include "groupby/sort/group_scan_util.cuh" #include +#include namespace cudf { namespace groupby { @@ -25,7 +26,7 @@ std::unique_ptr max_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), group_scan_dispatcher{}, diff --git a/cpp/src/groupby/sort/group_merge_lists.cu b/cpp/src/groupby/sort/group_merge_lists.cu index 2c72128dbfb..92cce1aa00e 100644 --- a/cpp/src/groupby/sort/group_merge_lists.cu +++ b/cpp/src/groupby/sort/group_merge_lists.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -30,7 +31,7 @@ std::unique_ptr group_merge_lists(column_view const& values, cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(values.type().id() == type_id::LIST, "Input to `group_merge_lists` must be a lists column."); diff --git a/cpp/src/groupby/sort/group_merge_m2.cu b/cpp/src/groupby/sort/group_merge_m2.cu index a580c9dac9d..4ad8fa5ff07 100644 --- a/cpp/src/groupby/sort/group_merge_m2.cu +++ b/cpp/src/groupby/sort/group_merge_m2.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -131,7 +132,7 @@ std::unique_ptr group_merge_m2(column_view const& values, cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(values.type().id() == type_id::STRUCT, "Input to `group_merge_m2` must be a structs column."); diff --git a/cpp/src/groupby/sort/group_min.cu b/cpp/src/groupby/sort/group_min.cu index 3939fc41b65..22aaf664168 100644 --- a/cpp/src/groupby/sort/group_min.cu +++ b/cpp/src/groupby/sort/group_min.cu @@ -17,6 +17,7 @@ #include "groupby/sort/group_single_pass_reduction_util.cuh" #include +#include namespace cudf { namespace groupby { @@ -25,7 +26,7 @@ std::unique_ptr group_min(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) ? dictionary_column_view(values).keys().type() diff --git a/cpp/src/groupby/sort/group_min_scan.cu b/cpp/src/groupby/sort/group_min_scan.cu index 7d2a88fb038..4ddc10a2e5a 100644 --- a/cpp/src/groupby/sort/group_min_scan.cu +++ b/cpp/src/groupby/sort/group_min_scan.cu @@ -17,6 +17,7 @@ #include "groupby/sort/group_scan_util.cuh" #include +#include namespace cudf { namespace groupby { @@ -25,7 +26,7 @@ std::unique_ptr min_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), group_scan_dispatcher{}, diff --git a/cpp/src/groupby/sort/group_nth_element.cu b/cpp/src/groupby/sort/group_nth_element.cu index 694c052e42d..1bc1eef908c 100644 --- a/cpp/src/groupby/sort/group_nth_element.cu +++ b/cpp/src/groupby/sort/group_nth_element.cu @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -49,7 +50,7 @@ std::unique_ptr group_nth_element(column_view const& values, size_type n, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(static_cast(values.size()) == group_labels.size(), "Size of values column should be same as that of group labels"); diff --git a/cpp/src/groupby/sort/group_nunique.cu b/cpp/src/groupby/sort/group_nunique.cu index 1a5f1691d5b..de11e70719a 100644 --- a/cpp/src/groupby/sort/group_nunique.cu +++ b/cpp/src/groupby/sort/group_nunique.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -78,7 +79,7 @@ std::unique_ptr group_nunique(column_view const& values, cudf::device_span group_offsets, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(num_groups >= 0, "number of groups cannot be negative"); CUDF_EXPECTS(static_cast(values.size()) == group_labels.size(), diff --git a/cpp/src/groupby/sort/group_product.cu b/cpp/src/groupby/sort/group_product.cu index c53362f2095..83ca1059325 100644 --- a/cpp/src/groupby/sort/group_product.cu +++ b/cpp/src/groupby/sort/group_product.cu @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace groupby { @@ -28,7 +29,7 @@ std::unique_ptr group_product(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) ? dictionary_column_view(values).keys().type() diff --git a/cpp/src/groupby/sort/group_product_scan.cu b/cpp/src/groupby/sort/group_product_scan.cu index e1a615730dd..40c53ceeff1 100644 --- a/cpp/src/groupby/sort/group_product_scan.cu +++ b/cpp/src/groupby/sort/group_product_scan.cu @@ -17,6 +17,7 @@ #include "groupby/sort/group_scan_util.cuh" #include +#include namespace cudf { namespace groupby { @@ -25,7 +26,7 @@ std::unique_ptr product_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), group_scan_dispatcher{}, diff --git a/cpp/src/groupby/sort/group_quantiles.cu b/cpp/src/groupby/sort/group_quantiles.cu index a6bc2d5b38d..3156dfaadd0 100644 --- a/cpp/src/groupby/sort/group_quantiles.cu +++ b/cpp/src/groupby/sort/group_quantiles.cu @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -90,7 +91,7 @@ struct quantiles_functor { device_span quantile, interpolation interpolation, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using ResultType = cudf::detail::target_type_t; @@ -161,7 +162,7 @@ std::unique_ptr group_quantiles(column_view const& values, std::vector const& quantiles, interpolation interp, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto dv_quantiles = cudf::detail::make_device_uvector_async( quantiles, stream, rmm::mr::get_current_device_resource()); diff --git a/cpp/src/groupby/sort/group_rank_scan.cu b/cpp/src/groupby/sort/group_rank_scan.cu index 5cf7844410e..0b65889f127 100644 --- a/cpp/src/groupby/sort/group_rank_scan.cu +++ b/cpp/src/groupby/sort/group_rank_scan.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -100,7 +101,7 @@ std::unique_ptr rank_generator(column_view const& grouped_values, scan_operator scan_op, bool has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const grouped_values_view = table_view{{grouped_values}}; auto const comparator = @@ -155,7 +156,7 @@ std::unique_ptr min_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return rank_generator( grouped_values, @@ -176,7 +177,7 @@ std::unique_ptr max_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return rank_generator( grouped_values, @@ -197,7 +198,7 @@ std::unique_ptr first_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto ranks = make_fixed_width_column( data_type{type_to_id()}, group_labels.size(), mask_state::UNALLOCATED, stream, mr); @@ -218,7 +219,7 @@ std::unique_ptr average_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto max_rank = max_rank_scan(grouped_values, value_order, @@ -251,7 +252,7 @@ std::unique_ptr dense_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return rank_generator( grouped_values, @@ -272,7 +273,7 @@ std::unique_ptr group_rank_to_percentage(rank_method const method, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(percentage != rank_percentage::NONE, "Percentage cannot be NONE"); auto ranks = make_fixed_width_column( diff --git a/cpp/src/groupby/sort/group_reductions.hpp b/cpp/src/groupby/sort/group_reductions.hpp index 3aa79f226a3..5e76dc3135a 100644 --- a/cpp/src/groupby/sort/group_reductions.hpp +++ b/cpp/src/groupby/sort/group_reductions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include @@ -52,7 +53,7 @@ std::unique_ptr group_sum(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise product @@ -75,7 +76,7 @@ std::unique_ptr group_product(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise minimum value @@ -98,7 +99,7 @@ std::unique_ptr group_min(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise maximum value @@ -121,7 +122,7 @@ std::unique_ptr group_max(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate group-wise indices of maximum values. @@ -146,7 +147,7 @@ std::unique_ptr group_argmax(column_view const& values, cudf::device_span group_labels, column_view const& key_sort_order, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate group-wise indices of minimum values. @@ -171,7 +172,7 @@ std::unique_ptr group_argmin(column_view const& values, cudf::device_span group_labels, column_view const& key_sort_order, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate number of non-null values in each group of @@ -195,7 +196,7 @@ std::unique_ptr group_count_valid(column_view const& values, cudf::device_span group_labels, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate number of values in each group of @p values @@ -215,7 +216,7 @@ std::unique_ptr group_count_valid(column_view const& values, std::unique_ptr group_count_all(cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to compute histogram for each group in @p values. * @@ -242,7 +243,7 @@ std::unique_ptr group_histogram(column_view const& values, cudf::device_span group_labels, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate sum of squares of differences from means. @@ -266,7 +267,7 @@ std::unique_ptr group_m2(column_view const& values, column_view const& group_means, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise variance @@ -296,7 +297,7 @@ std::unique_ptr group_var(column_view const& values, cudf::device_span group_labels, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise quantiles @@ -326,7 +327,7 @@ std::unique_ptr group_quantiles(column_view const& values, std::vector const& quantiles, interpolation interp, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate number of unique values in each group of @@ -358,7 +359,7 @@ std::unique_ptr group_nunique(column_view const& values, cudf::device_span group_offsets, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate nth values in each group of @p values @@ -393,7 +394,7 @@ std::unique_ptr group_nth_element(column_view const& values, size_type n, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to collect grouped values into a lists column * @@ -418,7 +419,7 @@ std::unique_ptr group_collect(column_view const& values, size_type num_groups, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to merge grouped lists into one list. @@ -441,7 +442,7 @@ std::unique_ptr group_merge_lists(column_view const& values, cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to merge grouped M2 values corresponding to the same key. @@ -467,7 +468,7 @@ std::unique_ptr group_merge_m2(column_view const& values, cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to merge multiple output of HISTOGRAM aggregation. @@ -494,7 +495,7 @@ std::unique_ptr group_merge_histogram(column_view const& values, cudf::device_span group_offsets, size_type num_groups, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to find covariance of child columns of a non-nullable struct column. @@ -521,7 +522,7 @@ std::unique_ptr group_covariance(column_view const& values_0, size_type min_periods, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to find correlation from covariance and standard deviation. @@ -536,7 +537,7 @@ std::unique_ptr group_correlation(column_view const& covariance, column_view const& stddev_0, column_view const& stddev_1, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace groupby diff --git a/cpp/src/groupby/sort/group_replace_nulls.cu b/cpp/src/groupby/sort/group_replace_nulls.cu index 49557164230..566507da230 100644 --- a/cpp/src/groupby/sort/group_replace_nulls.cu +++ b/cpp/src/groupby/sort/group_replace_nulls.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -40,7 +41,7 @@ std::unique_ptr group_replace_nulls(cudf::column_view const& grouped_val device_span group_labels, cudf::replace_policy replace_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { cudf::size_type size = grouped_value.size(); diff --git a/cpp/src/groupby/sort/group_scan.hpp b/cpp/src/groupby/sort/group_scan.hpp index fd53046f7e2..6f2daae5f9d 100644 --- a/cpp/src/groupby/sort/group_scan.hpp +++ b/cpp/src/groupby/sort/group_scan.hpp @@ -21,6 +21,7 @@ #include #include +#include #include @@ -40,7 +41,7 @@ std::unique_ptr sum_scan(column_view const& values, size_type num_groups, device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise cumulative product @@ -57,7 +58,7 @@ std::unique_ptr product_scan(column_view const& values, size_type num_groups, device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise cumulative minimum value @@ -72,7 +73,7 @@ std::unique_ptr min_scan(column_view const& values, size_type num_groups, device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise cumulative maximum value @@ -87,7 +88,7 @@ std::unique_ptr max_scan(column_view const& values, size_type num_groups, device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate cumulative number of values in each group @@ -99,7 +100,7 @@ std::unique_ptr max_scan(column_view const& values, */ std::unique_ptr count_scan(device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise min rank value @@ -118,7 +119,7 @@ std::unique_ptr min_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise max rank value @@ -128,14 +129,14 @@ std::unique_ptr min_rank_scan(column_view const& grouped_values, * device_span group_labels, * device_span group_offsets, * rmm::cuda_stream_view stream, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr max_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise first rank value @@ -145,14 +146,14 @@ std::unique_ptr max_rank_scan(column_view const& grouped_values, * device_span group_labels, * device_span group_offsets, * rmm::cuda_stream_view stream, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr first_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise average rank value @@ -162,14 +163,14 @@ std::unique_ptr first_rank_scan(column_view const& grouped_values, * device_span group_labels, * device_span group_offsets, * rmm::cuda_stream_view stream, - * rmm::mr::device_memory_resource* mr) + * rmm::device_async_resource_ref mr) */ std::unique_ptr average_rank_scan(column_view const& grouped_values, column_view const& value_order, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Internal API to calculate groupwise dense rank value @@ -186,7 +187,7 @@ std::unique_ptr dense_rank_scan(column_view const& grouped_values, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Convert groupwise rank to groupwise percentage rank @@ -209,7 +210,7 @@ std::unique_ptr group_rank_to_percentage(rank_method const method, device_span group_labels, device_span group_offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace groupby diff --git a/cpp/src/groupby/sort/group_scan_util.cuh b/cpp/src/groupby/sort/group_scan_util.cuh index 2ebc8ba7d5d..b360ba2c45d 100644 --- a/cpp/src/groupby/sort/group_scan_util.cuh +++ b/cpp/src/groupby/sort/group_scan_util.cuh @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -60,7 +61,7 @@ struct group_scan_dispatcher { size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return group_scan_functor::invoke(values, num_groups, group_labels, stream, mr); } @@ -89,7 +90,7 @@ struct group_scan_functor() size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using DeviceType = device_storage_type_t; using OpType = cudf::detail::corresponding_operator_t; @@ -145,7 +146,7 @@ struct group_scan_functor group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using OpType = cudf::detail::corresponding_operator_t; @@ -191,7 +192,7 @@ struct group_scan_functor group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (values.is_empty()) { return cudf::empty_like(values); } diff --git a/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh b/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh index 42d4b654346..5e892710d3b 100644 --- a/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh +++ b/cpp/src/groupby/sort/group_single_pass_reduction_util.cuh @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -116,7 +117,7 @@ struct group_reduction_dispatcher { size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return group_reduction_functor::invoke(values, num_groups, group_labels, stream, mr); } @@ -149,7 +150,7 @@ struct group_reduction_functor< size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using SourceDType = device_storage_type_t; @@ -218,7 +219,7 @@ struct group_reduction_functor< size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // This is be expected to be size_type. using ResultType = cudf::detail::target_type_t; diff --git a/cpp/src/groupby/sort/group_std.cu b/cpp/src/groupby/sort/group_std.cu index 30b6f67dffe..70f64186f21 100644 --- a/cpp/src/groupby/sort/group_std.cu +++ b/cpp/src/groupby/sort/group_std.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -104,7 +105,7 @@ struct var_functor { cudf::device_span group_labels, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using ResultType = cudf::detail::target_type_t; @@ -175,7 +176,7 @@ std::unique_ptr group_var(column_view const& values, cudf::device_span group_labels, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) ? dictionary_column_view(values).keys().type() diff --git a/cpp/src/groupby/sort/group_sum.cu b/cpp/src/groupby/sort/group_sum.cu index 0af7cb22159..316b6f395bb 100644 --- a/cpp/src/groupby/sort/group_sum.cu +++ b/cpp/src/groupby/sort/group_sum.cu @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace groupby { @@ -28,7 +29,7 @@ std::unique_ptr group_sum(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto values_type = cudf::is_dictionary(values.type()) ? dictionary_column_view(values).keys().type() diff --git a/cpp/src/groupby/sort/group_sum_scan.cu b/cpp/src/groupby/sort/group_sum_scan.cu index 2efa1185899..01c4d0c2c4a 100644 --- a/cpp/src/groupby/sort/group_sum_scan.cu +++ b/cpp/src/groupby/sort/group_sum_scan.cu @@ -17,6 +17,7 @@ #include "groupby/sort/group_scan_util.cuh" #include +#include namespace cudf { namespace groupby { @@ -25,7 +26,7 @@ std::unique_ptr sum_scan(column_view const& values, size_type num_groups, cudf::device_span group_labels, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type_dispatcher(values.type(), group_scan_dispatcher{}, diff --git a/cpp/src/groupby/sort/scan.cpp b/cpp/src/groupby/sort/scan.cpp index 45c232aa3aa..f211c61b3b7 100644 --- a/cpp/src/groupby/sort/scan.cpp +++ b/cpp/src/groupby/sort/scan.cpp @@ -35,6 +35,7 @@ #include #include +#include #include @@ -207,7 +208,7 @@ void scan_result_functor::operator()(aggregation const& agg) std::pair, std::vector> groupby::sort_scan( host_span requests, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // We're going to start by creating a cache of results so that aggs that // depend on other aggs will not have to be recalculated. e.g. mean depends on diff --git a/cpp/src/groupby/sort/sort_helper.cu b/cpp/src/groupby/sort/sort_helper.cu index 1e6c7a9393f..4da1da089cd 100644 --- a/cpp/src/groupby/sort/sort_helper.cu +++ b/cpp/src/groupby/sort/sort_helper.cu @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -248,7 +249,7 @@ column_view sort_groupby_helper::keys_bitmask_column(rmm::cuda_stream_view strea } sort_groupby_helper::column_ptr sort_groupby_helper::sorted_values( - column_view const& values, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + column_view const& values, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { column_ptr values_sort_order = cudf::detail::stable_sorted_order(table_view({unsorted_keys_labels(stream), values}), @@ -272,7 +273,7 @@ sort_groupby_helper::column_ptr sort_groupby_helper::sorted_values( } sort_groupby_helper::column_ptr sort_groupby_helper::grouped_values( - column_view const& values, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + column_view const& values, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { auto gather_map = key_sort_order(stream); @@ -287,7 +288,7 @@ sort_groupby_helper::column_ptr sort_groupby_helper::grouped_values( } std::unique_ptr
sort_groupby_helper::unique_keys(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto idx_data = key_sort_order(stream).data(); @@ -305,7 +306,7 @@ std::unique_ptr
sort_groupby_helper::unique_keys(rmm::cuda_stream_view st } std::unique_ptr
sort_groupby_helper::sorted_keys(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return cudf::detail::gather(_keys, key_sort_order(stream), diff --git a/cpp/src/hash/md5_hash.cu b/cpp/src/hash/md5_hash.cu index b34455905d9..8f490ada8ff 100644 --- a/cpp/src/hash/md5_hash.cu +++ b/cpp/src/hash/md5_hash.cu @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -284,7 +285,7 @@ inline bool md5_leaf_type_check(data_type dt) std::unique_ptr md5(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.num_columns() == 0 || input.num_rows() == 0) { // Return the MD5 hash of a zero-length input. @@ -349,7 +350,7 @@ std::unique_ptr md5(table_view const& input, std::unique_ptr md5(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::md5(input, stream, mr); diff --git a/cpp/src/hash/murmurhash3_x64_128.cu b/cpp/src/hash/murmurhash3_x64_128.cu index 1fc469686e1..6c91532a193 100644 --- a/cpp/src/hash/murmurhash3_x64_128.cu +++ b/cpp/src/hash/murmurhash3_x64_128.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include @@ -109,7 +110,7 @@ class murmur_device_row_hasher { std::unique_ptr
murmurhash3_x64_128(table_view const& input, uint64_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output1 = make_numeric_column( data_type(type_id::UINT64), input.num_rows(), mask_state::UNALLOCATED, stream, mr); @@ -140,7 +141,7 @@ std::unique_ptr
murmurhash3_x64_128(table_view const& input, std::unique_ptr
murmurhash3_x64_128(table_view const& input, uint64_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::murmurhash3_x64_128(input, seed, stream, mr); diff --git a/cpp/src/hash/murmurhash3_x86_32.cu b/cpp/src/hash/murmurhash3_x86_32.cu index a6ab301a86e..eac72f5d995 100644 --- a/cpp/src/hash/murmurhash3_x86_32.cu +++ b/cpp/src/hash/murmurhash3_x86_32.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include @@ -33,7 +34,7 @@ namespace detail { std::unique_ptr murmurhash3_x86_32(table_view const& input, uint32_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output = make_numeric_column(data_type(type_to_id()), input.num_rows(), @@ -62,7 +63,7 @@ std::unique_ptr murmurhash3_x86_32(table_view const& input, std::unique_ptr murmurhash3_x86_32(table_view const& input, uint32_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::murmurhash3_x86_32(input, seed, stream, mr); diff --git a/cpp/src/hash/sha1_hash.cu b/cpp/src/hash/sha1_hash.cu index 71253d279b9..f7609eb26af 100644 --- a/cpp/src/hash/sha1_hash.cu +++ b/cpp/src/hash/sha1_hash.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -62,7 +63,7 @@ struct SHA1Hash : HashBase { std::unique_ptr sha1(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sha_hash(input, stream, mr); } @@ -71,7 +72,7 @@ std::unique_ptr sha1(table_view const& input, std::unique_ptr sha1(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sha1(input, stream, mr); diff --git a/cpp/src/hash/sha224_hash.cu b/cpp/src/hash/sha224_hash.cu index 61480a78776..cf04504a489 100644 --- a/cpp/src/hash/sha224_hash.cu +++ b/cpp/src/hash/sha224_hash.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -63,7 +64,7 @@ struct SHA224Hash : HashBase { std::unique_ptr sha224(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sha_hash(input, stream, mr); } @@ -72,7 +73,7 @@ std::unique_ptr sha224(table_view const& input, std::unique_ptr sha224(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sha224(input, stream, mr); diff --git a/cpp/src/hash/sha256_hash.cu b/cpp/src/hash/sha256_hash.cu index b15cfe09d52..664913c0f4c 100644 --- a/cpp/src/hash/sha256_hash.cu +++ b/cpp/src/hash/sha256_hash.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -63,7 +64,7 @@ struct SHA256Hash : HashBase { std::unique_ptr sha256(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sha_hash(input, stream, mr); } @@ -72,7 +73,7 @@ std::unique_ptr sha256(table_view const& input, std::unique_ptr sha256(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sha256(input, stream, mr); diff --git a/cpp/src/hash/sha384_hash.cu b/cpp/src/hash/sha384_hash.cu index 3075d2c62f8..92192f501ec 100644 --- a/cpp/src/hash/sha384_hash.cu +++ b/cpp/src/hash/sha384_hash.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -70,7 +71,7 @@ struct SHA384Hash : HashBase { std::unique_ptr sha384(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sha_hash(input, stream, mr); } @@ -79,7 +80,7 @@ std::unique_ptr sha384(table_view const& input, std::unique_ptr sha384(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sha384(input, stream, mr); diff --git a/cpp/src/hash/sha512_hash.cu b/cpp/src/hash/sha512_hash.cu index d073cf1edca..244206aeeb9 100644 --- a/cpp/src/hash/sha512_hash.cu +++ b/cpp/src/hash/sha512_hash.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -70,7 +71,7 @@ struct SHA512Hash : HashBase { std::unique_ptr sha512(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sha_hash(input, stream, mr); } @@ -79,7 +80,7 @@ std::unique_ptr sha512(table_view const& input, std::unique_ptr sha512(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sha512(input, stream, mr); diff --git a/cpp/src/hash/sha_hash.cuh b/cpp/src/hash/sha_hash.cuh index 0a22ee34918..005578cb2c2 100644 --- a/cpp/src/hash/sha_hash.cuh +++ b/cpp/src/hash/sha_hash.cuh @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -503,7 +504,7 @@ bool inline sha_leaf_type_check(data_type dt) template std::unique_ptr sha_hash(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.num_rows() == 0) { return cudf::make_empty_column(cudf::type_id::STRING); } diff --git a/cpp/src/hash/xxhash_64.cu b/cpp/src/hash/xxhash_64.cu index e17bc134420..4366c12b453 100644 --- a/cpp/src/hash/xxhash_64.cu +++ b/cpp/src/hash/xxhash_64.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include @@ -298,7 +299,7 @@ class device_row_hasher { std::unique_ptr xxhash_64(table_view const& input, uint64_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output = make_numeric_column(data_type(type_to_id()), input.num_rows(), @@ -327,7 +328,7 @@ std::unique_ptr xxhash_64(table_view const& input, std::unique_ptr xxhash_64(table_view const& input, uint64_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::xxhash_64(input, seed, stream, mr); diff --git a/cpp/src/interop/dlpack.cpp b/cpp/src/interop/dlpack.cpp index 9f36280930d..3109a36cbcf 100644 --- a/cpp/src/interop/dlpack.cpp +++ b/cpp/src/interop/dlpack.cpp @@ -24,6 +24,7 @@ #include #include +#include #include @@ -133,7 +134,7 @@ struct dltensor_context { namespace detail { std::unique_ptr
from_dlpack(DLManagedTensor const* managed_tensor, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(nullptr != managed_tensor, "managed_tensor is null"); auto const& tensor = managed_tensor->dl_tensor; @@ -219,7 +220,7 @@ std::unique_ptr
from_dlpack(DLManagedTensor const* managed_tensor, DLManagedTensor* to_dlpack(table_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_rows = input.num_rows(); auto const num_cols = input.num_columns(); @@ -298,13 +299,13 @@ DLManagedTensor* to_dlpack(table_view const& input, } // namespace detail std::unique_ptr
from_dlpack(DLManagedTensor const* managed_tensor, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::from_dlpack(managed_tensor, cudf::get_default_stream(), mr); } -DLManagedTensor* to_dlpack(table_view const& input, rmm::mr::device_memory_resource* mr) +DLManagedTensor* to_dlpack(table_view const& input, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::to_dlpack(input, cudf::get_default_stream(), mr); diff --git a/cpp/src/interop/from_arrow.cu b/cpp/src/interop/from_arrow.cu index 2a524c773c0..f100ca0cc2b 100644 --- a/cpp/src/interop/from_arrow.cu +++ b/cpp/src/interop/from_arrow.cu @@ -34,6 +34,7 @@ #include #include +#include #include @@ -100,7 +101,7 @@ struct dispatch_to_cudf_column { */ std::unique_ptr get_mask_buffer(arrow::Array const& array, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (array.null_bitmap_data() == nullptr) { return std::make_unique(0, stream, mr); @@ -126,7 +127,7 @@ struct dispatch_to_cudf_column { template ())> std::unique_ptr operator()( - arrow::Array const&, data_type, bool, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + arrow::Array const&, data_type, bool, rmm::cuda_stream_view, rmm::device_async_resource_ref) { CUDF_FAIL("Unsupported type in from_arrow."); } @@ -136,7 +137,7 @@ struct dispatch_to_cudf_column { data_type type, bool skip_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto data_buffer = array.data()->buffers[1]; size_type const num_rows = array.length(); @@ -186,7 +187,7 @@ std::unique_ptr get_column(arrow::Array const& array, data_type type, bool skip_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); template <> std::unique_ptr dispatch_to_cudf_column::operator()( @@ -194,7 +195,7 @@ std::unique_ptr dispatch_to_cudf_column::operator() data_type type, bool skip_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using DeviceType = __int128_t; @@ -230,12 +231,11 @@ std::unique_ptr dispatch_to_cudf_column::operator() } template <> -std::unique_ptr dispatch_to_cudf_column::operator()( - arrow::Array const& array, - data_type, - bool skip_mask, - rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) +std::unique_ptr dispatch_to_cudf_column::operator()(arrow::Array const& array, + data_type, + bool skip_mask, + rmm::cuda_stream_view stream, + rmm::device_async_resource_ref mr) { auto data_buffer = array.data()->buffers[1]; // mask-to-bools expects the mask to be bitmask_type aligned/padded @@ -273,7 +273,7 @@ std::unique_ptr dispatch_to_cudf_column::operator()( data_type, bool, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (array.length() == 0) { return make_empty_column(type_id::STRING); } auto str_array = static_cast(&array); @@ -311,7 +311,7 @@ std::unique_ptr dispatch_to_cudf_column::operator()( data_type, bool, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto dict_array = static_cast(&array); auto dict_type = arrow_to_cudf_type(*(dict_array->dictionary()->type())); @@ -344,7 +344,7 @@ std::unique_ptr dispatch_to_cudf_column::operator()( data_type, bool, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto struct_array = static_cast(&array); std::vector> child_columns; @@ -377,7 +377,7 @@ std::unique_ptr dispatch_to_cudf_column::operator()( data_type, bool, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto list_array = static_cast(&array); auto offset_array = std::make_unique( @@ -412,7 +412,7 @@ std::unique_ptr get_column(arrow::Array const& array, data_type type, bool skip_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return type.id() != type_id::EMPTY ? type_dispatcher(type, dispatch_to_cudf_column{}, array, type, skip_mask, stream, mr) @@ -423,7 +423,7 @@ std::unique_ptr get_column(arrow::Array const& array, std::unique_ptr
from_arrow(arrow::Table const& input_table, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input_table.num_columns() == 0) { return std::make_unique
(); } std::vector> columns; @@ -464,7 +464,7 @@ std::unique_ptr
from_arrow(arrow::Table const& input_table, std::unique_ptr from_arrow(arrow::Scalar const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto maybe_array = arrow::MakeArrayFromScalar(input, 1); if (!maybe_array.ok()) { CUDF_FAIL("Failed to create array"); } @@ -484,7 +484,7 @@ std::unique_ptr from_arrow(arrow::Scalar const& input, std::unique_ptr
from_arrow(arrow::Table const& input_table, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -493,7 +493,7 @@ std::unique_ptr
from_arrow(arrow::Table const& input_table, std::unique_ptr from_arrow(arrow::Scalar const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/interop/to_arrow_device.cu b/cpp/src/interop/to_arrow_device.cu index e824412e71c..1754d1493bd 100644 --- a/cpp/src/interop/to_arrow_device.cu +++ b/cpp/src/interop/to_arrow_device.cu @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -288,10 +289,7 @@ int initialize_array(ArrowArray* arr, ArrowType storage_type, cudf::column const struct dispatch_to_arrow_device { template ())> - int operator()(cudf::column&&, - rmm::cuda_stream_view, - rmm::mr::device_memory_resource*, - ArrowArray*) + int operator()(cudf::column&&, rmm::cuda_stream_view, rmm::device_async_resource_ref, ArrowArray*) { CUDF_FAIL("Unsupported type for to_arrow_device"); } @@ -299,7 +297,7 @@ struct dispatch_to_arrow_device { template ())> int operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -337,7 +335,7 @@ template int decimals_to_arrow(cudf::column&& input, int32_t precision, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -387,7 +385,7 @@ int decimals_to_arrow(cudf::column&& input, template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { using DeviceType = int32_t; @@ -398,7 +396,7 @@ int dispatch_to_arrow_device::operator()(cudf::column&& colu template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { using DeviceType = int64_t; @@ -409,7 +407,7 @@ int dispatch_to_arrow_device::operator()(cudf::column&& colu template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { using DeviceType = __int128_t; @@ -420,7 +418,7 @@ int dispatch_to_arrow_device::operator()(cudf::column&& col template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -442,7 +440,7 @@ int dispatch_to_arrow_device::operator()(cudf::column&& column, template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -478,19 +476,19 @@ int dispatch_to_arrow_device::operator()(cudf::column&& colum template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out); template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out); template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -523,7 +521,7 @@ int dispatch_to_arrow_device::operator()(cudf::column&& colum template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -557,7 +555,7 @@ int dispatch_to_arrow_device::operator()(cudf::column&& column, template <> int dispatch_to_arrow_device::operator()(cudf::column&& column, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr, + rmm::device_async_resource_ref mr, ArrowArray* out) { nanoarrow::UniqueArray tmp; @@ -639,7 +637,7 @@ unique_schema_t to_arrow_schema(cudf::table_view const& input, unique_device_array_t to_arrow_device(cudf::table&& table, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { nanoarrow::UniqueArray tmp; NANOARROW_THROW_NOT_OK(ArrowArrayInitFromType(tmp.get(), NANOARROW_TYPE_STRUCT)); @@ -689,7 +687,7 @@ unique_device_array_t to_arrow_device(cudf::table&& table, unique_device_array_t to_arrow_device(cudf::column&& col, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { nanoarrow::UniqueArray tmp; if (col.type().id() == cudf::type_id::EMPTY) { diff --git a/cpp/src/io/avro/reader_impl.cu b/cpp/src/io/avro/reader_impl.cu index 03fd663040a..814efe2b5a1 100644 --- a/cpp/src/io/avro/reader_impl.cu +++ b/cpp/src/io/avro/reader_impl.cu @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -373,7 +374,7 @@ std::vector decode_data(metadata& meta, std::vector> const& selection, std::vector const& column_types, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto out_buffers = std::vector(); @@ -483,7 +484,7 @@ std::vector decode_data(metadata& meta, table_with_metadata read_avro(std::unique_ptr&& source, avro_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto skip_rows = options.get_skip_rows(); auto num_rows = options.get_num_rows(); diff --git a/cpp/src/io/csv/durations.cu b/cpp/src/io/csv/durations.cu index 76b1b46dc61..918951d5902 100644 --- a/cpp/src/io/csv/durations.cu +++ b/cpp/src/io/csv/durations.cu @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -174,7 +175,7 @@ struct dispatch_from_durations_fn { template ()>* = nullptr> std::unique_ptr operator()(column_view const& durations, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { size_type strings_count = durations.size(); auto column = column_device_view::create(durations, stream); @@ -211,7 +212,7 @@ struct dispatch_from_durations_fn { template ()>* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) const + rmm::device_async_resource_ref) const { CUDF_FAIL("Values for from_durations function must be a duration type."); } @@ -221,7 +222,7 @@ struct dispatch_from_durations_fn { std::unique_ptr pandas_format_durations(column_view const& durations, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { size_type strings_count = durations.size(); if (strings_count == 0) return make_empty_column(type_id::STRING); diff --git a/cpp/src/io/csv/durations.hpp b/cpp/src/io/csv/durations.hpp index ac925011c58..f671f435eeb 100644 --- a/cpp/src/io/csv/durations.hpp +++ b/cpp/src/io/csv/durations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include #include @@ -30,7 +31,7 @@ namespace csv { std::unique_ptr pandas_format_durations(column_view const& durations, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace csv } // namespace detail diff --git a/cpp/src/io/csv/reader_impl.cu b/cpp/src/io/csv/reader_impl.cu index 02daf4655db..67c1194578a 100644 --- a/cpp/src/io/csv/reader_impl.cu +++ b/cpp/src/io/csv/reader_impl.cu @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -574,7 +575,7 @@ std::vector decode_data(parse_options const& parse_opts, int32_t num_actual_columns, int32_t num_active_columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Alloc output; columns' data memory is still expected for empty dataframe std::vector out_buffers; @@ -667,7 +668,7 @@ table_with_metadata read_csv(cudf::io::datasource* source, csv_reader_options const& reader_opts, parse_options const& parse_opts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector header; @@ -995,7 +996,7 @@ parse_options make_parse_options(csv_reader_options const& reader_opts, table_with_metadata read_csv(std::unique_ptr&& source, csv_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto parse_options = make_parse_options(options, stream); diff --git a/cpp/src/io/csv/writer_impl.cu b/cpp/src/io/csv/writer_impl.cu index c143d258448..335ce77e3e3 100644 --- a/cpp/src/io/csv/writer_impl.cu +++ b/cpp/src/io/csv/writer_impl.cu @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -140,7 +141,7 @@ struct column_to_strings_fn { explicit column_to_strings_fn(csv_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : options_(options), stream_(stream), mr_(mr) { } @@ -277,7 +278,7 @@ struct column_to_strings_fn { private: csv_writer_options const& options_; rmm::cuda_stream_view stream_; - rmm::mr::device_memory_resource* mr_; + rmm::device_async_resource_ref mr_; }; } // unnamed namespace @@ -288,7 +289,7 @@ void write_chunked_begin(data_sink* out_sink, host_span user_column_names, csv_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (options.is_enabled_include_header()) { // need to generate column names if names are not provided @@ -354,7 +355,7 @@ void write_chunked(data_sink* out_sink, strings_column_view const& str_column_view, csv_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // algorithm outline: // @@ -410,7 +411,7 @@ void write_csv(data_sink* out_sink, host_span user_column_names, csv_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // write header: column names separated by delimiter: // (even for tables with no rows) diff --git a/cpp/src/io/functions.cpp b/cpp/src/io/functions.cpp index 46c6c67c8df..f0a37839810 100644 --- a/cpp/src/io/functions.cpp +++ b/cpp/src/io/functions.cpp @@ -36,6 +36,8 @@ #include #include +#include + #include namespace cudf::io { @@ -156,8 +158,7 @@ std::vector> make_datasinks(sink_info const& info) } // namespace -table_with_metadata read_avro(avro_reader_options const& options, - rmm::mr::device_memory_resource* mr) +table_with_metadata read_avro(avro_reader_options const& options, rmm::device_async_resource_ref mr) { namespace avro = cudf::io::detail::avro; @@ -201,7 +202,7 @@ compression_type infer_compression_type(compression_type compression, source_inf table_with_metadata read_json(json_reader_options options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -216,7 +217,7 @@ table_with_metadata read_json(json_reader_options options, void write_json(json_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto sinks = make_datasinks(options.get_sink()); CUDF_EXPECTS(sinks.size() == 1, "Multiple sinks not supported for JSON writing"); @@ -231,7 +232,7 @@ void write_json(json_writer_options const& options, table_with_metadata read_csv(csv_reader_options options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -253,7 +254,7 @@ table_with_metadata read_csv(csv_reader_options options, // Freeform API wraps the detail writer class API void write_csv(csv_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { using namespace cudf::io::detail; @@ -413,7 +414,7 @@ orc_metadata read_orc_metadata(source_info const& src_info, rmm::cuda_stream_vie */ table_with_metadata read_orc(orc_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -481,7 +482,7 @@ namespace detail_parquet = cudf::io::parquet::detail; table_with_metadata read_parquet(parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -569,7 +570,7 @@ std::unique_ptr> write_parquet(parquet_writer_options const chunked_parquet_reader::chunked_parquet_reader(std::size_t chunk_read_limit, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : reader{std::make_unique( chunk_read_limit, 0, make_datasources(options.get_source()), options, stream, mr)} { @@ -582,7 +583,7 @@ chunked_parquet_reader::chunked_parquet_reader(std::size_t chunk_read_limit, std::size_t pass_read_limit, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : reader{std::make_unique(chunk_read_limit, pass_read_limit, make_datasources(options.get_source()), diff --git a/cpp/src/io/json/json_column.cu b/cpp/src/io/json/json_column.cu index 9d40c657396..7117af8948b 100644 --- a/cpp/src/io/json/json_column.cu +++ b/cpp/src/io/json/json_column.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -481,7 +482,7 @@ void make_device_json_column(device_span input, bool is_array_of_arrays, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -893,7 +894,7 @@ std::pair, std::vector> device_json_co cudf::io::parse_options const& options, std::optional schema, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); auto validity_size_check = [](device_json_column& json_col) { @@ -1050,7 +1051,7 @@ std::pair, std::vector> device_json_co table_with_metadata device_parse_nested_json(device_span d_input, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/io/json/json_normalization.cu b/cpp/src/io/json/json_normalization.cu index b3a029224d7..eb06ea0177e 100644 --- a/cpp/src/io/json/json_normalization.cu +++ b/cpp/src/io/json/json_normalization.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -299,7 +300,7 @@ namespace detail { rmm::device_uvector normalize_single_quotes(rmm::device_uvector&& inbuf, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto parser = fst::detail::make_fst( fst::detail::make_symbol_group_lut(normalize_quotes::qna_sgs), @@ -323,7 +324,7 @@ rmm::device_uvector normalize_single_quotes(rmm::device_uvector normalize_whitespace(rmm::device_uvector&& inbuf, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto parser = fst::detail::make_fst( fst::detail::make_symbol_group_lut(normalize_whitespace::wna_sgs), diff --git a/cpp/src/io/json/json_tree.cu b/cpp/src/io/json/json_tree.cu index 1b7976dab89..ad807b57766 100644 --- a/cpp/src/io/json/json_tree.cu +++ b/cpp/src/io/json/json_tree.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -218,7 +219,7 @@ tree_meta_t get_tree_representation(device_span tokens, device_span token_indices, bool is_strict_nested_boundaries, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); // Whether a token does represent a node in the tree representation @@ -634,7 +635,7 @@ std::pair, rmm::device_uvector> hash_n bool is_array_of_arrays, bool is_enabled_lines, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); auto const num_nodes = parent_node_ids.size(); @@ -779,7 +780,7 @@ std::pair, rmm::device_uvector> gene bool is_array_of_arrays, bool is_enabled_lines, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); auto const num_nodes = d_tree.node_categories.size(); @@ -848,7 +849,7 @@ rmm::device_uvector compute_row_offsets(rmm::device_uvector d_input, bool is_array_of_arrays, bool is_enabled_lines, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); auto [new_col_id, new_parent_col_id] = diff --git a/cpp/src/io/json/legacy/read_json.hpp b/cpp/src/io/json/legacy/read_json.hpp index 32d05c432b4..2c02fdd402f 100644 --- a/cpp/src/io/json/legacy/read_json.hpp +++ b/cpp/src/io/json/legacy/read_json.hpp @@ -17,6 +17,7 @@ #include #include +#include #include @@ -32,6 +33,6 @@ namespace cudf::io::json::detail::legacy { table_with_metadata read_json(host_span> sources, json_reader_options const& reader_opts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::io::json::detail::legacy diff --git a/cpp/src/io/json/legacy/reader_impl.cu b/cpp/src/io/json/legacy/reader_impl.cu index f9d0f6895b9..846b3cfab4e 100644 --- a/cpp/src/io/json/legacy/reader_impl.cu +++ b/cpp/src/io/json/legacy/reader_impl.cu @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -486,7 +487,7 @@ table_with_metadata convert_data_to_table(parse_options_view const& parse_opts, device_span rec_starts, device_span data, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_columns = dtypes.size(); auto const num_records = rec_starts.size(); @@ -598,7 +599,7 @@ table_with_metadata convert_data_to_table(parse_options_view const& parse_opts, table_with_metadata read_json(host_span> sources, json_reader_options const& reader_opts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(not sources.empty(), "No sources were defined"); CUDF_EXPECTS(sources.size() == 1 or reader_opts.get_compression() == compression_type::NONE, diff --git a/cpp/src/io/json/nested_json.hpp b/cpp/src/io/json/nested_json.hpp index 5d54e340e2b..a302785cee8 100644 --- a/cpp/src/io/json/nested_json.hpp +++ b/cpp/src/io/json/nested_json.hpp @@ -22,6 +22,8 @@ #include #include +#include + #include #include @@ -172,7 +174,7 @@ struct device_json_column { * @param stream The CUDA stream to which kernels are dispatched * @param mr Optional, resource with which to allocate */ - device_json_column(rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + device_json_column(rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) : string_offsets(0, stream), string_lengths(0, stream), child_offsets(0, stream, mr), @@ -232,7 +234,7 @@ tree_meta_t get_tree_representation(device_span tokens, device_span token_indices, bool is_strict_nested_boundaries, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Traverse the tree representation of the JSON input in records orient format and populate @@ -253,7 +255,7 @@ records_orient_tree_traversal(device_span d_input, bool is_array_of_arrays, bool is_enabled_lines, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Searches for and selects nodes at level `row_array_children_level`. For each selected @@ -307,7 +309,7 @@ cudf::io::parse_options parsing_options(cudf::io::json_reader_options const& opt table_with_metadata device_parse_nested_json(device_span input, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Get the path data type of a column by path if present in input schema @@ -347,7 +349,7 @@ struct path_from_tree { table_with_metadata host_parse_nested_json(device_span input, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail diff --git a/cpp/src/io/json/nested_json_gpu.cu b/cpp/src/io/json/nested_json_gpu.cu index 4ddbe735963..8da1bb3ddfc 100644 --- a/cpp/src/io/json/nested_json_gpu.cu +++ b/cpp/src/io/json/nested_json_gpu.cu @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1531,7 +1532,7 @@ std::pair, rmm::device_uvector> ge device_span json_in, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { check_input_size(json_in.size()); @@ -1664,7 +1665,7 @@ void make_json_column(json_column& root_column, cudf::io::json_reader_options const& options, bool include_quote_char, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Range of encapsulating function that parses to internal columnar data representation CUDF_FUNC_RANGE(); @@ -2064,7 +2065,7 @@ std::pair, std::vector> json_column_to cudf::io::json_reader_options const& options, std::optional schema, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Range of orchestrating/encapsulating function CUDF_FUNC_RANGE(); @@ -2222,7 +2223,7 @@ std::pair, std::vector> json_column_to table_with_metadata host_parse_nested_json(device_span d_input, cudf::io::json_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Range of orchestrating/encapsulating function CUDF_FUNC_RANGE(); diff --git a/cpp/src/io/json/read_json.cu b/cpp/src/io/json/read_json.cu index b03e0dd452b..3ea8639641c 100644 --- a/cpp/src/io/json/read_json.cu +++ b/cpp/src/io/json/read_json.cu @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -205,7 +206,7 @@ auto get_record_range_raw_input(host_span> sources, table_with_metadata read_json(host_span> sources, json_reader_options const& reader_opts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/io/json/read_json.hpp b/cpp/src/io/json/read_json.hpp index d05134fa837..0c30b4cad46 100644 --- a/cpp/src/io/json/read_json.hpp +++ b/cpp/src/io/json/read_json.hpp @@ -23,6 +23,7 @@ #include #include +#include #include @@ -31,7 +32,7 @@ namespace cudf::io::json::detail { table_with_metadata read_json(host_span> sources, json_reader_options const& reader_opts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); size_type find_first_delimiter(device_span d_data, char const delimiter, diff --git a/cpp/src/io/json/write_json.cu b/cpp/src/io/json/write_json.cu index 8c3aceeefd4..596b3381eaf 100644 --- a/cpp/src/io/json/write_json.cu +++ b/cpp/src/io/json/write_json.cu @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -167,7 +168,7 @@ struct escape_strings_fn { std::unique_ptr get_escaped_strings(column_view const& column_v, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto [offsets_column, chars] = cudf::strings::detail::make_strings_children(*this, column_v.size(), stream, mr); @@ -256,7 +257,7 @@ std::unique_ptr struct_to_strings(table_view const& strings_columns, string_scalar const& narep, bool include_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(column_names.type().id() == type_id::STRING, "Column names must be of type string"); @@ -373,7 +374,7 @@ std::unique_ptr join_list_of_strings(lists_column_view const& lists_stri string_view const element_separator, string_view const element_narep, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -497,7 +498,7 @@ struct column_to_strings_fn { explicit column_to_strings_fn(json_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : options_(options), stream_(stream), mr_(mr), @@ -740,7 +741,7 @@ struct column_to_strings_fn { private: json_writer_options const& options_; rmm::cuda_stream_view stream_; - rmm::mr::device_memory_resource* mr_; + rmm::device_async_resource_ref mr_; string_scalar const narep; // "null" // struct convert constants string_scalar const struct_value_separator; // "," @@ -804,7 +805,7 @@ void write_chunked(data_sink* out_sink, int const skip_last_chars, json_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(str_column_view.size() > 0, "Unexpected empty strings column."); @@ -828,7 +829,7 @@ void write_json(data_sink* out_sink, table_view const& table, json_writer_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); std::vector user_column_names = [&]() { diff --git a/cpp/src/io/orc/reader_impl.cu b/cpp/src/io/orc/reader_impl.cu index f078e20f7e6..77151f5b7b8 100644 --- a/cpp/src/io/orc/reader_impl.cu +++ b/cpp/src/io/orc/reader_impl.cu @@ -18,12 +18,14 @@ #include "reader_impl_chunking.hpp" #include "reader_impl_helpers.hpp" +#include + namespace cudf::io::orc::detail { reader::impl::impl(std::vector>&& sources, orc_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : _stream(stream), _mr(mr), _timestamp_type{options.get_timestamp_type()}, @@ -119,7 +121,7 @@ table_with_metadata reader::impl::read_chunk_internal() reader::reader(std::vector>&& sources, orc_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : _impl{std::make_unique(std::move(sources), options, stream, mr)} { } diff --git a/cpp/src/io/orc/reader_impl.hpp b/cpp/src/io/orc/reader_impl.hpp index ab8eaebeb61..8b859da07e9 100644 --- a/cpp/src/io/orc/reader_impl.hpp +++ b/cpp/src/io/orc/reader_impl.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -50,7 +51,7 @@ class reader::impl { explicit impl(std::vector>&& sources, orc_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Read an entire set or a subset of data and returns a set of columns @@ -93,7 +94,7 @@ class reader::impl { table_with_metadata read_chunk_internal(); rmm::cuda_stream_view const _stream; - rmm::mr::device_memory_resource* const _mr; + rmm::device_async_resource_ref const _mr; // Reader configs data_type const _timestamp_type; // Override output timestamp resolution diff --git a/cpp/src/io/orc/reader_impl_helpers.cpp b/cpp/src/io/orc/reader_impl_helpers.cpp index ea4e5dcfaab..c943ae17d97 100644 --- a/cpp/src/io/orc/reader_impl_helpers.cpp +++ b/cpp/src/io/orc/reader_impl_helpers.cpp @@ -16,6 +16,8 @@ #include "reader_impl_helpers.hpp" +#include + namespace cudf::io::orc::detail { std::unique_ptr create_empty_column(size_type orc_col_id, @@ -111,7 +113,7 @@ column_buffer assemble_buffer(size_type orc_col_id, column_hierarchy const& selected_columns, std::vector>& col_buffers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const col_id = col_meta.orc_col_map[level][orc_col_id]; auto& col_buffer = col_buffers[level][col_id]; diff --git a/cpp/src/io/orc/reader_impl_helpers.hpp b/cpp/src/io/orc/reader_impl_helpers.hpp index 22482bad486..6645eecbd29 100644 --- a/cpp/src/io/orc/reader_impl_helpers.hpp +++ b/cpp/src/io/orc/reader_impl_helpers.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -147,6 +148,6 @@ column_buffer assemble_buffer(size_type orc_col_id, column_hierarchy const& selected_columns, std::vector>& col_buffers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::io::orc::detail diff --git a/cpp/src/io/orc/reader_impl_preprocess.cu b/cpp/src/io/orc/reader_impl_preprocess.cu index 6c59f83bc46..04cb223c696 100644 --- a/cpp/src/io/orc/reader_impl_preprocess.cu +++ b/cpp/src/io/orc/reader_impl_preprocess.cu @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -401,7 +402,7 @@ rmm::device_buffer decompress_stripe_data( void update_null_mask(cudf::detail::hostdevice_2dvector& chunks, host_span out_buffers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_stripes = chunks.size().first; auto const num_columns = chunks.size().second; @@ -492,7 +493,7 @@ void decode_stream_data(std::size_t num_dicts, cudf::detail::device_2dspan row_groups, std::vector& out_buffers, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_stripes = chunks.size().first; auto const num_columns = chunks.size().second; diff --git a/cpp/src/io/parquet/predicate_pushdown.cpp b/cpp/src/io/parquet/predicate_pushdown.cpp index f43a8fd24c4..9869dafadfb 100644 --- a/cpp/src/io/parquet/predicate_pushdown.cpp +++ b/cpp/src/io/parquet/predicate_pushdown.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -129,7 +130,7 @@ struct stats_caster { size_t col_idx, cudf::data_type dtype, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { // List, Struct, Dictionary types are not supported if constexpr (cudf::is_compound() && !std::is_same_v) { @@ -165,7 +166,7 @@ struct stats_caster { static auto make_strings_children(host_span host_strings, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector chars{}; std::vector offsets(1, 0); @@ -182,7 +183,7 @@ struct stats_caster { auto to_device(cudf::data_type dtype, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if constexpr (std::is_same_v) { auto [d_chars, d_offsets] = make_strings_children(val, stream, mr); diff --git a/cpp/src/io/parquet/reader.cpp b/cpp/src/io/parquet/reader.cpp index 17d7c07bc91..170f7503134 100644 --- a/cpp/src/io/parquet/reader.cpp +++ b/cpp/src/io/parquet/reader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ #include "reader_impl.hpp" +#include + namespace cudf::io::parquet::detail { reader::reader() = default; @@ -23,7 +25,7 @@ reader::reader() = default; reader::reader(std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : _impl(std::make_unique(std::move(sources), options, stream, mr)) { } @@ -47,7 +49,7 @@ chunked_reader::chunked_reader(std::size_t chunk_read_limit, std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { _impl = std::make_unique( chunk_read_limit, pass_read_limit, std::move(sources), options, stream, mr); diff --git a/cpp/src/io/parquet/reader_impl.cpp b/cpp/src/io/parquet/reader_impl.cpp index 2356878f6ba..e7409f45e13 100644 --- a/cpp/src/io/parquet/reader_impl.cpp +++ b/cpp/src/io/parquet/reader_impl.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include #include @@ -362,7 +364,7 @@ void reader::impl::decode_page_data(bool uses_custom_row_bounds, size_t skip_row reader::impl::impl(std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : impl(0 /*chunk_read_limit*/, 0 /*input_pass_read_limit*/, std::forward>>(sources), @@ -377,7 +379,7 @@ reader::impl::impl(std::size_t chunk_read_limit, std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : _stream{stream}, _mr{mr}, _sources{std::move(sources)}, diff --git a/cpp/src/io/parquet/reader_impl.hpp b/cpp/src/io/parquet/reader_impl.hpp index 185419a5b46..6c6cedf4e76 100644 --- a/cpp/src/io/parquet/reader_impl.hpp +++ b/cpp/src/io/parquet/reader_impl.hpp @@ -31,6 +31,8 @@ #include #include +#include +#include #include #include @@ -57,7 +59,7 @@ class reader::impl { explicit impl(std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Read an entire set or a subset of data and returns a set of columns @@ -108,7 +110,7 @@ class reader::impl { std::vector>&& sources, parquet_reader_options const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @copydoc cudf::io::chunked_parquet_reader::has_next @@ -346,7 +348,7 @@ class reader::impl { private: rmm::cuda_stream_view _stream; - rmm::mr::device_memory_resource* _mr = nullptr; + rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource()}; std::vector> _sources; std::unique_ptr _metadata; diff --git a/cpp/src/io/text/multibyte_split.cu b/cpp/src/io/text/multibyte_split.cu index 8e37564fc35..976d735e010 100644 --- a/cpp/src/io/text/multibyte_split.cu +++ b/cpp/src/io/text/multibyte_split.cu @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -306,7 +307,7 @@ std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source byte_range_info byte_range, bool strip_delimiters, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -565,7 +566,7 @@ std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source const& source, std::string const& delimiter, std::optional byte_range, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return multibyte_split( source, delimiter, parse_options{byte_range.value_or(create_byte_range_info_max())}, mr); @@ -574,7 +575,7 @@ std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source const& source, std::string const& delimiter, parse_options options, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto stream = cudf::get_default_stream(); @@ -586,7 +587,7 @@ std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source std::unique_ptr multibyte_split(cudf::io::text::data_chunk_source const& source, std::string const& delimiter, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return multibyte_split(source, delimiter, parse_options{}, mr); } diff --git a/cpp/src/io/utilities/column_buffer.cpp b/cpp/src/io/utilities/column_buffer.cpp index 96503e4907b..5dc2291abdc 100644 --- a/cpp/src/io/utilities/column_buffer.cpp +++ b/cpp/src/io/utilities/column_buffer.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -102,7 +103,7 @@ void copy_buffer_data(string_policy const& buff, string_policy& new_buff) template void column_buffer_base::create(size_type _size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { size = _size; _mr = mr; @@ -286,7 +287,7 @@ template std::unique_ptr empty_like(column_buffer_base& buffer, column_name_info* schema_info, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (schema_info != nullptr) { schema_info->name = buffer.name; } @@ -357,12 +358,12 @@ template std::unique_ptr make_column( template std::unique_ptr empty_like(string_column_buffer& buffer, column_name_info* schema_info, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); template std::unique_ptr empty_like(pointer_column_buffer& buffer, column_name_info* schema_info, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); template std::string type_to_name(string_column_buffer const& buffer); template std::string type_to_name(pointer_column_buffer const& buffer); diff --git a/cpp/src/io/utilities/column_buffer.hpp b/cpp/src/io/utilities/column_buffer.hpp index 57ee1043ee9..ace1396bc09 100644 --- a/cpp/src/io/utilities/column_buffer.hpp +++ b/cpp/src/io/utilities/column_buffer.hpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include @@ -50,7 +52,7 @@ namespace detail { inline rmm::device_buffer create_data(data_type type, size_type size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::size_t data_size = size_of(type) * size; @@ -96,7 +98,7 @@ class column_buffer_base { size_type _size, bool _is_nullable, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : column_buffer_base(_type, _is_nullable) { } @@ -111,7 +113,7 @@ class column_buffer_base { // instantiate a column of known type with a specified size. Allows deferred creation for // preprocessing steps such as in the Parquet reader - void create(size_type _size, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr); + void create(size_type _size, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr); // Create a new column_buffer that has empty data but with the same basic information as the // input column, including same type, nullability, name, and user_data. @@ -140,7 +142,7 @@ class column_buffer_base { rmm::device_buffer _data{}; rmm::device_buffer _null_mask{}; size_type _null_count{0}; - rmm::mr::device_memory_resource* _mr; + rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource()}; public: data_type type{type_id::EMPTY}; @@ -174,7 +176,7 @@ class gather_column_buffer : public column_buffer_base { size_type _size, bool _is_nullable, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : column_buffer_base(_type, _size, _is_nullable, stream, mr) { create(_size, stream, mr); @@ -208,7 +210,7 @@ class inline_column_buffer : public column_buffer_base { size_type _size, bool _is_nullable, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : column_buffer_base(_type, _size, _is_nullable, stream, mr) { create(_size, stream, mr); @@ -251,7 +253,7 @@ template std::unique_ptr empty_like(column_buffer_base& buffer, column_name_info* schema_info, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Given a column_buffer, produce a formatted name string describing the type. diff --git a/cpp/src/io/utilities/data_casting.cu b/cpp/src/io/utilities/data_casting.cu index 4b5d47e71fb..c9e507925ec 100644 --- a/cpp/src/io/utilities/data_casting.cu +++ b/cpp/src/io/utilities/data_casting.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -796,7 +797,7 @@ static std::unique_ptr parse_string(string_view_pair_it str_tuples, rmm::device_scalar& d_null_count, cudf::io::parse_options_view const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // CUDF_FUNC_RANGE(); @@ -914,7 +915,7 @@ std::unique_ptr parse_data( size_type null_count, cudf::io::parse_options_view const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); diff --git a/cpp/src/io/utilities/output_builder.cuh b/cpp/src/io/utilities/output_builder.cuh index 1858912a871..a7517983cd3 100644 --- a/cpp/src/io/utilities/output_builder.cuh +++ b/cpp/src/io/utilities/output_builder.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -206,7 +207,7 @@ class output_builder { output_builder(size_type max_write_size, size_type max_growth, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) : _size{0}, _max_write_size{max_write_size}, _max_growth{max_growth} { CUDF_EXPECTS(max_write_size > 0, "Internal error"); @@ -307,7 +308,7 @@ class output_builder { * @return The output vector. */ rmm::device_uvector gather(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { rmm::device_uvector output{size(), stream, mr}; auto output_it = output.begin(); diff --git a/cpp/src/io/utilities/string_parsing.hpp b/cpp/src/io/utilities/string_parsing.hpp index a98660c98a9..612889af74b 100644 --- a/cpp/src/io/utilities/string_parsing.hpp +++ b/cpp/src/io/utilities/string_parsing.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -74,6 +75,6 @@ std::unique_ptr parse_data( size_type null_count, cudf::io::parse_options_view const& options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace json::detail } // namespace cudf::io diff --git a/cpp/src/join/conditional_join.cu b/cpp/src/join/conditional_join.cu index cc729ad5e8b..095093d08e5 100644 --- a/cpp/src/join/conditional_join.cu +++ b/cpp/src/join/conditional_join.cu @@ -30,6 +30,7 @@ #include #include +#include #include @@ -44,7 +45,7 @@ conditional_join(table_view const& left, join_kind join_type, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // We can immediately filter out cases where the right table is empty. In // some cases, we return all the rows of the left table with a corresponding @@ -197,7 +198,7 @@ std::size_t compute_conditional_join_output_size(table_view const& left, ast::expression const& binary_predicate, join_kind join_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Until we add logic to handle the number of non-matches in the right table, // full joins are not supported in this function. Note that this does not @@ -293,7 +294,7 @@ conditional_inner_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::conditional_join(left, @@ -311,7 +312,7 @@ conditional_left_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::conditional_join(left, @@ -328,7 +329,7 @@ std::pair>, conditional_full_join(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::conditional_join(left, @@ -345,7 +346,7 @@ std::unique_ptr> conditional_left_semi_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return std::move(detail::conditional_join(left, @@ -363,7 +364,7 @@ std::unique_ptr> conditional_left_anti_join( table_view const& right, ast::expression const& binary_predicate, std::optional output_size, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return std::move(detail::conditional_join(left, @@ -379,7 +380,7 @@ std::unique_ptr> conditional_left_anti_join( std::size_t conditional_inner_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::compute_conditional_join_output_size( @@ -389,7 +390,7 @@ std::size_t conditional_inner_join_size(table_view const& left, std::size_t conditional_left_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::compute_conditional_join_output_size( @@ -399,7 +400,7 @@ std::size_t conditional_left_join_size(table_view const& left, std::size_t conditional_left_semi_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return std::move(detail::compute_conditional_join_output_size(left, @@ -413,7 +414,7 @@ std::size_t conditional_left_semi_join_size(table_view const& left, std::size_t conditional_left_anti_join_size(table_view const& left, table_view const& right, ast::expression const& binary_predicate, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return std::move(detail::compute_conditional_join_output_size(left, diff --git a/cpp/src/join/conditional_join.hpp b/cpp/src/join/conditional_join.hpp index 9bc6024ee7e..06eb83d6ba8 100644 --- a/cpp/src/join/conditional_join.hpp +++ b/cpp/src/join/conditional_join.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include @@ -49,7 +50,7 @@ conditional_join(table_view const& left, join_kind JoinKind, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Computes the size of a join operation between two tables without @@ -68,7 +69,7 @@ std::size_t compute_conditional_join_output_size(table_view const& left, ast::expression const& binary_predicate, join_kind JoinKind, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace detail } // namespace cudf diff --git a/cpp/src/join/cross_join.cu b/cpp/src/join/cross_join.cu index 07057acf37e..a2ee3a7796b 100644 --- a/cpp/src/join/cross_join.cu +++ b/cpp/src/join/cross_join.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -40,7 +41,7 @@ namespace detail { std::unique_ptr cross_join(cudf::table_view const& left, cudf::table_view const& right, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(0 != left.num_columns(), "Left table is empty"); CUDF_EXPECTS(0 != right.num_columns(), "Right table is empty"); @@ -74,7 +75,7 @@ std::unique_ptr cross_join(cudf::table_view const& left, std::unique_ptr cross_join(cudf::table_view const& left, cudf::table_view const& right, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::cross_join(left, right, cudf::get_default_stream(), mr); diff --git a/cpp/src/join/distinct_hash_join.cu b/cpp/src/join/distinct_hash_join.cu index 8bd42d867a3..a3652942973 100644 --- a/cpp/src/join/distinct_hash_join.cu +++ b/cpp/src/join/distinct_hash_join.cu @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -309,7 +310,7 @@ template std::pair>, std::unique_ptr>> distinct_hash_join::inner_join(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"distinct_hash_join::inner_join"}; @@ -352,7 +353,7 @@ distinct_hash_join::inner_join(rmm::cuda_stream_view stream, template std::unique_ptr> distinct_hash_join::left_join( - rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const + rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const { cudf::scoped_range range{"distinct_hash_join::left_join"}; @@ -419,7 +420,7 @@ template <> std::pair>, std::unique_ptr>> distinct_hash_join::inner_join(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->inner_join(stream, mr); } @@ -428,7 +429,7 @@ template <> std::pair>, std::unique_ptr>> distinct_hash_join::inner_join(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->inner_join(stream, mr); } @@ -436,14 +437,14 @@ distinct_hash_join::inner_join(rmm::cuda_stream_view strea template <> std::unique_ptr> distinct_hash_join::left_join(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->left_join(stream, mr); } template <> std::unique_ptr> distinct_hash_join::left_join( - rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const + rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const { return _impl->left_join(stream, mr); } diff --git a/cpp/src/join/hash_join.cu b/cpp/src/join/hash_join.cu index 17616818a58..fbe16378e8c 100644 --- a/cpp/src/join/hash_join.cu +++ b/cpp/src/join/hash_join.cu @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -157,7 +158,7 @@ probe_join_hash_table( null_equality compare_nulls, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Use the output size directly if provided. Otherwise, compute the exact output size auto const probe_join_type = @@ -267,7 +268,7 @@ std::size_t get_full_join_size( bool has_nulls, null_equality compare_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::size_t join_size = compute_join_output_size(build_table, probe_table, @@ -396,7 +397,7 @@ std::pair>, hash_join::inner_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); return compute_hash_join(probe, cudf::detail::join_kind::INNER_JOIN, output_size, stream, mr); @@ -408,7 +409,7 @@ std::pair>, hash_join::left_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); return compute_hash_join(probe, cudf::detail::join_kind::LEFT_JOIN, output_size, stream, mr); @@ -420,7 +421,7 @@ std::pair>, hash_join::full_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); return compute_hash_join(probe, cudf::detail::join_kind::FULL_JOIN, output_size, stream, mr); @@ -481,7 +482,7 @@ std::size_t hash_join::left_join_size(cudf::table_view const& probe, template std::size_t hash_join::full_join_size(cudf::table_view const& probe, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_FUNC_RANGE(); @@ -512,7 +513,7 @@ hash_join::probe_join_indices(cudf::table_view const& probe_table, cudf::detail::join_kind join, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { // Trivial left join case - exit early if (_is_empty and join != cudf::detail::join_kind::INNER_JOIN) { @@ -553,7 +554,7 @@ hash_join::compute_hash_join(cudf::table_view const& probe, cudf::detail::join_kind join, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { CUDF_EXPECTS(0 != probe.num_columns(), "Hash join probe table is empty"); @@ -603,7 +604,7 @@ std::pair>, hash_join::inner_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->inner_join(probe, output_size, stream, mr); } @@ -613,7 +614,7 @@ std::pair>, hash_join::left_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->left_join(probe, output_size, stream, mr); } @@ -623,7 +624,7 @@ std::pair>, hash_join::full_join(cudf::table_view const& probe, std::optional output_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->full_join(probe, output_size, stream, mr); } @@ -642,7 +643,7 @@ std::size_t hash_join::left_join_size(cudf::table_view const& probe, std::size_t hash_join::full_join_size(cudf::table_view const& probe, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return _impl->full_join_size(probe, stream, mr); } diff --git a/cpp/src/join/join.cu b/cpp/src/join/join.cu index ae025b1a213..bc7f09763ec 100644 --- a/cpp/src/join/join.cu +++ b/cpp/src/join/join.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include namespace cudf { namespace detail { @@ -33,7 +34,7 @@ inner_join(table_view const& left_input, table_view const& right_input, null_equality compare_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Make sure any dictionary columns have matched key sets. // This will return any new dictionary columns created as well as updated table_views. @@ -68,7 +69,7 @@ left_join(table_view const& left_input, table_view const& right_input, null_equality compare_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Make sure any dictionary columns have matched key sets. // This will return any new dictionary columns created as well as updated table_views. @@ -93,7 +94,7 @@ full_join(table_view const& left_input, table_view const& right_input, null_equality compare_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Make sure any dictionary columns have matched key sets. // This will return any new dictionary columns created as well as updated table_views. @@ -119,7 +120,7 @@ std::pair>, inner_join(table_view const& left, table_view const& right, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::inner_join(left, right, compare_nulls, cudf::get_default_stream(), mr); @@ -130,7 +131,7 @@ std::pair>, left_join(table_view const& left, table_view const& right, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::left_join(left, right, compare_nulls, cudf::get_default_stream(), mr); @@ -141,7 +142,7 @@ std::pair>, full_join(table_view const& left, table_view const& right, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::full_join(left, right, compare_nulls, cudf::get_default_stream(), mr); diff --git a/cpp/src/join/join_common_utils.cuh b/cpp/src/join/join_common_utils.cuh index 9da41e296e6..9758919c5b4 100644 --- a/cpp/src/join/join_common_utils.cuh +++ b/cpp/src/join/join_common_utils.cuh @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -146,7 +147,7 @@ std::pair>, std::unique_ptr>> get_trivial_left_join_indices(table_view const& left, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Builds the hash table based on the given `build_table`. @@ -245,7 +246,7 @@ get_left_join_indices_complement(std::unique_ptr> size_type left_table_row_count, size_type right_table_row_count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Device functor to determine if an index is contained in a range. diff --git a/cpp/src/join/join_utils.cu b/cpp/src/join/join_utils.cu index 7fa6642b19f..8d916da9f2c 100644 --- a/cpp/src/join/join_utils.cu +++ b/cpp/src/join/join_utils.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #include "join_common_utils.cuh" #include +#include #include #include @@ -53,7 +54,7 @@ std::pair>, std::unique_ptr>> get_trivial_left_join_indices(table_view const& left, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto left_indices = std::make_unique>(left.num_rows(), stream, mr); thrust::sequence(rmm::exec_policy(stream), left_indices->begin(), left_indices->end(), 0); @@ -93,7 +94,7 @@ get_left_join_indices_complement(std::unique_ptr> size_type left_table_row_count, size_type right_table_row_count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Get array of indices that do not appear in right_indices diff --git a/cpp/src/join/mixed_join.cu b/cpp/src/join/mixed_join.cu index 6223114fcd0..42e0e4f45ee 100644 --- a/cpp/src/join/mixed_join.cu +++ b/cpp/src/join/mixed_join.cu @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -54,7 +55,7 @@ mixed_join( join_kind join_type, std::optional>> const& output_size_data, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(left_conditional.num_rows() == left_equality.num_rows(), "The left conditional and equality tables must have the same number of rows."); @@ -304,7 +305,7 @@ compute_mixed_join_output_size(table_view const& left_equality, null_equality compare_nulls, join_kind join_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Until we add logic to handle the number of non-matches in the right table, // full joins are not supported in this function. Note that this does not @@ -483,7 +484,7 @@ mixed_inner_join( ast::expression const& binary_predicate, null_equality compare_nulls, std::optional>> const output_size_data, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::mixed_join(left_equality, @@ -505,7 +506,7 @@ std::pair>> mixed_in table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::compute_mixed_join_output_size(left_equality, @@ -529,7 +530,7 @@ mixed_left_join( ast::expression const& binary_predicate, null_equality compare_nulls, std::optional>> const output_size_data, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::mixed_join(left_equality, @@ -551,7 +552,7 @@ std::pair>> mixed_le table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::compute_mixed_join_output_size(left_equality, @@ -575,7 +576,7 @@ mixed_full_join( ast::expression const& binary_predicate, null_equality compare_nulls, std::optional>> const output_size_data, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::mixed_join(left_equality, diff --git a/cpp/src/join/mixed_join_semi.cu b/cpp/src/join/mixed_join_semi.cu index d654f580cad..8500b248fcf 100644 --- a/cpp/src/join/mixed_join_semi.cu +++ b/cpp/src/join/mixed_join_semi.cu @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -93,7 +94,7 @@ std::unique_ptr> mixed_join_semi( null_equality compare_nulls, join_kind join_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS((join_type != join_kind::INNER_JOIN) && (join_type != join_kind::LEFT_JOIN) && (join_type != join_kind::FULL_JOIN), @@ -279,7 +280,7 @@ std::unique_ptr> mixed_left_semi_join( table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::mixed_join_semi(left_equality, @@ -300,7 +301,7 @@ std::unique_ptr> mixed_left_anti_join( table_view const& right_conditional, ast::expression const& binary_predicate, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::mixed_join_semi(left_equality, diff --git a/cpp/src/join/semi_join.cu b/cpp/src/join/semi_join.cu index b0e5282d97f..91d98d5e8d3 100644 --- a/cpp/src/join/semi_join.cu +++ b/cpp/src/join/semi_join.cu @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,7 @@ std::unique_ptr> left_semi_anti_join( cudf::table_view const& right_keys, null_equality compare_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(0 != left_keys.num_columns(), "Left table is empty"); CUDF_EXPECTS(0 != right_keys.num_columns(), "Right table is empty"); @@ -97,7 +98,7 @@ std::unique_ptr> left_semi_join( cudf::table_view const& left, cudf::table_view const& right, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::left_semi_anti_join( @@ -108,7 +109,7 @@ std::unique_ptr> left_anti_join( cudf::table_view const& left, cudf::table_view const& right, null_equality compare_nulls, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::left_semi_anti_join( diff --git a/cpp/src/json/json_path.cu b/cpp/src/json/json_path.cu index ff42d9c8620..d1a1097de35 100644 --- a/cpp/src/json/json_path.cu +++ b/cpp/src/json/json_path.cu @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -977,7 +978,7 @@ std::unique_ptr get_json_object(cudf::strings_column_view const& c cudf::string_scalar const& json_path, get_json_object_options options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // preprocess the json_path into a command buffer auto preprocess = build_command_buffer(json_path, stream); @@ -1062,7 +1063,7 @@ std::unique_ptr get_json_object(cudf::strings_column_view const& c cudf::string_scalar const& json_path, get_json_object_options options, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::get_json_object(col, json_path, options, stream, mr); diff --git a/cpp/src/labeling/label_bins.cu b/cpp/src/labeling/label_bins.cu index 9fecaa1ddb2..1bfa7f39190 100644 --- a/cpp/src/labeling/label_bins.cu +++ b/cpp/src/labeling/label_bins.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,7 @@ std::unique_ptr label_bins(column_view const& input, column_view const& left_edges, column_view const& right_edges, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output = make_numeric_column( data_type(type_to_id()), input.size(), mask_state::UNALLOCATED, stream, mr); @@ -176,7 +177,7 @@ struct bin_type_dispatcher { column_view const& right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if ((left_inclusive == inclusive::YES) && (right_inclusive == inclusive::YES)) return label_bins, thrust::less_equal>( @@ -204,7 +205,7 @@ std::unique_ptr label_bins(column_view const& input, column_view const& right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE() CUDF_EXPECTS((input.type() == left_edges.type()) && (input.type() == right_edges.type()), @@ -237,7 +238,7 @@ std::unique_ptr label_bins(column_view const& input, column_view const& right_edges, inclusive right_inclusive, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::label_bins( diff --git a/cpp/src/lists/combine/concatenate_list_elements.cu b/cpp/src/lists/combine/concatenate_list_elements.cu index 579ad8e7dff..58ec053712d 100644 --- a/cpp/src/lists/combine/concatenate_list_elements.cu +++ b/cpp/src/lists/combine/concatenate_list_elements.cu @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -52,7 +53,7 @@ namespace { std::unique_ptr concatenate_lists_ignore_null(column_view const& input, bool build_null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_rows = input.size(); @@ -119,7 +120,7 @@ std::unique_ptr concatenate_lists_ignore_null(column_view const& input, std::pair, rmm::device_uvector> generate_list_offsets_and_validities(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_rows = input.size(); @@ -174,7 +175,7 @@ std::unique_ptr gather_list_entries(column_view const& input, size_type num_rows, size_type num_output_entries, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const child_col = lists_column_view(input).child(); auto const entry_col = lists_column_view(child_col).child(); @@ -213,7 +214,7 @@ std::unique_ptr gather_list_entries(column_view const& input, std::unique_ptr concatenate_lists_nullifying_rows(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Generate offsets and validities of the output lists column. auto [list_offsets, list_validities] = generate_list_offsets_and_validities(input, stream, mr); @@ -247,7 +248,7 @@ std::unique_ptr concatenate_lists_nullifying_rows(column_view const& inp std::unique_ptr concatenate_list_elements(column_view const& input, concatenate_null_policy null_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(input.type().id() == type_id::LIST, "Input column must be a lists column.", @@ -274,7 +275,7 @@ std::unique_ptr concatenate_list_elements(column_view const& input, std::unique_ptr concatenate_list_elements(column_view const& input, concatenate_null_policy null_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::concatenate_list_elements(input, null_policy, stream, mr); diff --git a/cpp/src/lists/combine/concatenate_rows.cu b/cpp/src/lists/combine/concatenate_rows.cu index baecef3b92d..38d299763a1 100644 --- a/cpp/src/lists/combine/concatenate_rows.cu +++ b/cpp/src/lists/combine/concatenate_rows.cu @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -75,7 +76,7 @@ generate_regrouped_offsets_and_null_mask(table_device_view const& input, concatenate_null_policy null_policy, device_span row_null_counts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // outgoing offsets. auto offsets = cudf::make_fixed_width_column( @@ -194,7 +195,7 @@ rmm::device_uvector generate_null_counts(table_device_view const& inp std::unique_ptr concatenate_rows(table_view const& input, concatenate_null_policy null_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(input.num_columns() > 0, "The input table must have at least one column."); @@ -314,7 +315,7 @@ std::unique_ptr concatenate_rows(table_view const& input, std::unique_ptr concatenate_rows(table_view const& input, concatenate_null_policy null_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::concatenate_rows(input, null_policy, stream, mr); diff --git a/cpp/src/lists/contains.cu b/cpp/src/lists/contains.cu index 378cf678f1f..4737b077deb 100644 --- a/cpp/src/lists/contains.cu +++ b/cpp/src/lists/contains.cu @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -184,7 +185,7 @@ std::unique_ptr dispatch_index_of(lists_column_view const& lists, column_view const& search_keys, duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(cudf::type_dispatcher(search_keys.type(), is_supported_type_fn{}), "Unsupported type in `dispatch_index_of` function."); @@ -245,7 +246,7 @@ std::unique_ptr dispatch_index_of(lists_column_view const& lists, */ std::unique_ptr to_contains(std::unique_ptr&& key_positions, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(key_positions->type().id() == type_to_id(), "Expected input column of type cudf::size_type."); @@ -274,7 +275,7 @@ std::unique_ptr index_of(lists_column_view const& lists, cudf::scalar const& search_key, duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (!search_key.is_valid(stream)) { return make_numeric_column( @@ -298,7 +299,7 @@ std::unique_ptr index_of(lists_column_view const& lists, column_view const& search_keys, duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(search_keys.size() == lists.size(), "Number of search keys must match list column size."); @@ -308,7 +309,7 @@ std::unique_ptr index_of(lists_column_view const& lists, std::unique_ptr contains(lists_column_view const& lists, cudf::scalar const& search_key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto key_indices = detail::index_of(lists, search_key, @@ -321,7 +322,7 @@ std::unique_ptr contains(lists_column_view const& lists, std::unique_ptr contains(lists_column_view const& lists, column_view const& search_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(search_keys.size() == lists.size(), "Number of search keys must match list column size."); @@ -336,7 +337,7 @@ std::unique_ptr contains(lists_column_view const& lists, std::unique_ptr contains_nulls(lists_column_view const& lists, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const lists_cv = lists.parent(); auto output = make_numeric_column(data_type{type_to_id()}, @@ -370,7 +371,7 @@ std::unique_ptr contains_nulls(lists_column_view const& lists, std::unique_ptr contains(lists_column_view const& lists, cudf::scalar const& search_key, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::contains(lists, search_key, stream, mr); @@ -379,7 +380,7 @@ std::unique_ptr contains(lists_column_view const& lists, std::unique_ptr contains(lists_column_view const& lists, column_view const& search_keys, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::contains(lists, search_keys, stream, mr); @@ -387,7 +388,7 @@ std::unique_ptr contains(lists_column_view const& lists, std::unique_ptr contains_nulls(lists_column_view const& lists, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::contains_nulls(lists, stream, mr); @@ -397,7 +398,7 @@ std::unique_ptr index_of(lists_column_view const& lists, cudf::scalar const& search_key, duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::index_of(lists, search_key, find_option, stream, mr); @@ -407,7 +408,7 @@ std::unique_ptr index_of(lists_column_view const& lists, column_view const& search_keys, duplicate_find_option find_option, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::index_of(lists, search_keys, find_option, stream, mr); diff --git a/cpp/src/lists/copying/concatenate.cu b/cpp/src/lists/copying/concatenate.cu index 5407b88236f..3d609a262b9 100644 --- a/cpp/src/lists/copying/concatenate.cu +++ b/cpp/src/lists/copying/concatenate.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include +#include #include @@ -56,7 +57,7 @@ namespace { std::unique_ptr merge_offsets(host_span columns, size_type total_list_count, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // outgoing offsets auto merged_offsets = cudf::make_fixed_width_column( @@ -96,7 +97,7 @@ std::unique_ptr merge_offsets(host_span columns */ std::unique_ptr concatenate(host_span columns, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { std::vector lists_columns; lists_columns.reserve(columns.size()); diff --git a/cpp/src/lists/copying/copying.cu b/cpp/src/lists/copying/copying.cu index 2d3826c8004..162c6140656 100644 --- a/cpp/src/lists/copying/copying.cu +++ b/cpp/src/lists/copying/copying.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -38,7 +39,7 @@ std::unique_ptr copy_slice(lists_column_view const& lists, size_type start, size_type end, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (lists.is_empty() or start == end) { return cudf::empty_like(lists.parent()); } if (end < 0 || end > lists.size()) end = lists.size(); diff --git a/cpp/src/lists/copying/gather.cu b/cpp/src/lists/copying/gather.cu index bd270b69656..cadeb273a65 100644 --- a/cpp/src/lists/copying/gather.cu +++ b/cpp/src/lists/copying/gather.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -92,7 +93,7 @@ struct list_gatherer { std::unique_ptr gather_list_leaf(column_view const& column, gather_data const& gd, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // gather map iterator for this level (N) auto gather_map_begin = thrust::make_transform_iterator( @@ -121,7 +122,7 @@ std::unique_ptr gather_list_leaf(column_view const& column, std::unique_ptr gather_list_nested(cudf::lists_column_view const& list, gather_data& gd, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // gather map iterator for this level (N) auto gather_map_begin = thrust::make_transform_iterator( diff --git a/cpp/src/lists/copying/scatter_helper.cu b/cpp/src/lists/copying/scatter_helper.cu index 1ec66b4f98e..b754fef24e5 100644 --- a/cpp/src/lists/copying/scatter_helper.cu +++ b/cpp/src/lists/copying/scatter_helper.cu @@ -23,6 +23,8 @@ #include #include +#include + #include #include #include @@ -54,7 +56,7 @@ std::pair construct_child_nullmask( cudf::detail::lists_column_device_view const& target_lists, size_type num_child_rows, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto is_valid_predicate = [d_list_vector = parent_list_vector.begin(), d_offsets = parent_list_offsets.template data(), @@ -160,7 +162,7 @@ struct list_child_constructor { cudf::lists_column_view const& source_lists_column_view, cudf::lists_column_view const& target_lists_column_view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto source_column_device_view = column_device_view::create(source_lists_column_view.parent(), stream); @@ -219,7 +221,7 @@ struct list_child_constructor { cudf::lists_column_view const& source_lists_column_view, cudf::lists_column_view const& target_lists_column_view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto source_column_device_view = column_device_view::create(source_lists_column_view.parent(), stream); @@ -282,7 +284,7 @@ struct list_child_constructor { cudf::lists_column_view const& source_lists_column_view, cudf::lists_column_view const& target_lists_column_view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto source_column_device_view = column_device_view::create(source_lists_column_view.parent(), stream); @@ -378,7 +380,7 @@ struct list_child_constructor { cudf::lists_column_view const& source_lists_column_view, cudf::lists_column_view const& target_lists_column_view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto const source_column_device_view = column_device_view::create(source_lists_column_view.parent(), stream); @@ -468,7 +470,7 @@ std::unique_ptr build_lists_child_column_recursive( cudf::lists_column_view const& source_lists_column_view, cudf::lists_column_view const& target_lists_column_view, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return cudf::type_dispatcher(child_column_type, list_child_constructor{}, diff --git a/cpp/src/lists/copying/segmented_gather.cu b/cpp/src/lists/copying/segmented_gather.cu index 156f868c5bd..89b1a126fc5 100644 --- a/cpp/src/lists/copying/segmented_gather.cu +++ b/cpp/src/lists/copying/segmented_gather.cu @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -35,7 +36,7 @@ std::unique_ptr segmented_gather(lists_column_view const& value_column, lists_column_view const& gather_map, out_of_bounds_policy bounds_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(is_index_type(gather_map.child().type()), "Gather map should be list column of index type"); @@ -120,7 +121,7 @@ std::unique_ptr segmented_gather(lists_column_view const& source_column, lists_column_view const& gather_map_list, out_of_bounds_policy bounds_policy, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::segmented_gather(source_column, gather_map_list, bounds_policy, stream, mr); diff --git a/cpp/src/lists/count_elements.cu b/cpp/src/lists/count_elements.cu index 2fd0851067a..19c434d10e1 100644 --- a/cpp/src/lists/count_elements.cu +++ b/cpp/src/lists/count_elements.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -45,7 +46,7 @@ namespace detail { */ std::unique_ptr count_elements(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto device_column = cudf::column_device_view::create(input.parent(), stream); auto d_column = *device_column; @@ -74,7 +75,7 @@ std::unique_ptr count_elements(lists_column_view const& input, std::unique_ptr count_elements(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::count_elements(input, stream, mr); diff --git a/cpp/src/lists/explode.cu b/cpp/src/lists/explode.cu index 5f1d30321a2..370d7480578 100644 --- a/cpp/src/lists/explode.cu +++ b/cpp/src/lists/explode.cu @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,7 @@ std::unique_ptr
build_table( thrust::optional> explode_col_gather_map, thrust::optional> position_array, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto select_iter = thrust::make_transform_iterator( thrust::make_counting_iterator(0), @@ -113,7 +114,7 @@ std::unique_ptr
build_table( std::unique_ptr
explode(table_view const& input_table, size_type const explode_column_idx, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { lists_column_view explode_col{input_table.column(explode_column_idx)}; auto sliced_child = explode_col.get_sliced_child(stream); @@ -151,7 +152,7 @@ std::unique_ptr
explode(table_view const& input_table, std::unique_ptr
explode_position(table_view const& input_table, size_type const explode_column_idx, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { lists_column_view explode_col{input_table.column(explode_column_idx)}; auto sliced_child = explode_col.get_sliced_child(stream); @@ -202,7 +203,7 @@ std::unique_ptr
explode_outer(table_view const& input_table, size_type const explode_column_idx, bool include_position, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { lists_column_view explode_col{input_table.column(explode_column_idx)}; auto sliced_child = explode_col.get_sliced_child(stream); @@ -299,11 +300,11 @@ std::unique_ptr
explode_outer(table_view const& input_table, } // namespace detail /** - * @copydoc cudf::explode(table_view const&, size_type, rmm::mr::device_memory_resource*) + * @copydoc cudf::explode(table_view const&, size_type, rmm::device_async_resource_ref) */ std::unique_ptr
explode(table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(input_table.column(explode_column_idx).type().id() == type_id::LIST, @@ -312,11 +313,11 @@ std::unique_ptr
explode(table_view const& input_table, } /** - * @copydoc cudf::explode_position(table_view const&, size_type, rmm::mr::device_memory_resource*) + * @copydoc cudf::explode_position(table_view const&, size_type, rmm::device_async_resource_ref) */ std::unique_ptr
explode_position(table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(input_table.column(explode_column_idx).type().id() == type_id::LIST, @@ -325,11 +326,11 @@ std::unique_ptr
explode_position(table_view const& input_table, } /** - * @copydoc cudf::explode_outer(table_view const&, size_type, rmm::mr::device_memory_resource*) + * @copydoc cudf::explode_outer(table_view const&, size_type, rmm::device_async_resource_ref) */ std::unique_ptr
explode_outer(table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(input_table.column(explode_column_idx).type().id() == type_id::LIST, @@ -340,11 +341,11 @@ std::unique_ptr
explode_outer(table_view const& input_table, /** * @copydoc cudf::explode_outer_position(table_view const&, size_type, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) */ std::unique_ptr
explode_outer_position(table_view const& input_table, size_type explode_column_idx, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(input_table.column(explode_column_idx).type().id() == type_id::LIST, diff --git a/cpp/src/lists/extract.cu b/cpp/src/lists/extract.cu index 365e9ef8255..c0ce86fb56e 100644 --- a/cpp/src/lists/extract.cu +++ b/cpp/src/lists/extract.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -118,7 +119,7 @@ template std::unique_ptr extract_list_element_impl(lists_column_view lists_column, index_t const& index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_lists = lists_column.size(); if (num_lists == 0) { return empty_like(lists_column.child()); } @@ -174,7 +175,7 @@ std::unique_ptr extract_list_element_impl(lists_column_view lists_column std::unique_ptr extract_list_element(lists_column_view lists_column, size_type const index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::extract_list_element_impl(lists_column, index, stream, mr); } @@ -182,7 +183,7 @@ std::unique_ptr extract_list_element(lists_column_view lists_column, std::unique_ptr extract_list_element(lists_column_view lists_column, column_view const& indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return detail::extract_list_element_impl(lists_column, indices, stream, mr); } @@ -192,12 +193,12 @@ std::unique_ptr extract_list_element(lists_column_view lists_column, /** * @copydoc cudf::lists::extract_list_element(lists_column_view const&, * size_type, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) */ std::unique_ptr extract_list_element(lists_column_view const& lists_column, size_type index, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::extract_list_element(lists_column, index, stream, mr); @@ -206,12 +207,12 @@ std::unique_ptr extract_list_element(lists_column_view const& lists_colu /** * @copydoc cudf::lists::extract_list_element(lists_column_view const&, * column_view const&, - * rmm::mr::device_memory_resource*) + * rmm::device_async_resource_ref) */ std::unique_ptr extract_list_element(lists_column_view const& lists_column, column_view const& indices, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); CUDF_EXPECTS(indices.size() == lists_column.size(), diff --git a/cpp/src/lists/interleave_columns.cu b/cpp/src/lists/interleave_columns.cu index 478b6c9a209..88eccf13f72 100644 --- a/cpp/src/lists/interleave_columns.cu +++ b/cpp/src/lists/interleave_columns.cu @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -51,7 +52,7 @@ std::pair, rmm::device_uvector> generate_list_offsets_and_validities(table_view const& input, bool has_null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_cols = input.num_columns(); auto const num_rows = input.num_rows(); @@ -99,7 +100,7 @@ generate_list_offsets_and_validities(table_view const& input, */ std::unique_ptr concatenate_and_gather_lists(host_span columns_to_concat, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Concatenate all columns into a single (temporary) column. auto const concatenated_col = @@ -218,7 +219,7 @@ struct interleave_list_entries_impl( size_type num_output_entries, bool data_has_null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const noexcept + rmm::device_async_resource_ref mr) const noexcept { auto const num_cols = input.num_columns(); auto const table_dv_ptr = table_device_view::create(input, stream); @@ -329,7 +330,7 @@ struct interleave_list_entries_fn { size_type num_output_entries, bool data_has_null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { return interleave_list_entries_impl{}(input, output_list_offsets, @@ -350,7 +351,7 @@ struct interleave_list_entries_fn { std::unique_ptr interleave_columns(table_view const& input, bool has_null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const entry_type = lists_column_view(*input.begin()).child().type(); for (auto const& col : input) { diff --git a/cpp/src/lists/lists_column_factories.cu b/cpp/src/lists/lists_column_factories.cu index 278e5af07b2..66ad1c35c33 100644 --- a/cpp/src/lists/lists_column_factories.cu +++ b/cpp/src/lists/lists_column_factories.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -36,7 +37,7 @@ namespace detail { std::unique_ptr make_lists_column_from_scalar(list_scalar const& value, size_type size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (size == 0) { return make_lists_column(0, @@ -84,7 +85,7 @@ std::unique_ptr make_lists_column_from_scalar(list_scalar const& v std::unique_ptr make_empty_lists_column(data_type child_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto offsets = make_empty_column(data_type(type_to_id())); auto child = make_empty_column(child_type); @@ -95,7 +96,7 @@ std::unique_ptr make_empty_lists_column(data_type child_type, std::unique_ptr make_all_nulls_lists_column(size_type size, data_type child_type, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto offsets = [&] { auto offsets_buff = @@ -120,7 +121,7 @@ std::unique_ptr make_lists_column(size_type num_rows, size_type null_count, rmm::device_buffer&& null_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (null_count > 0) { CUDF_EXPECTS(null_mask.size() > 0, "Column with nulls must be nullable."); } CUDF_EXPECTS( diff --git a/cpp/src/lists/reverse.cu b/cpp/src/lists/reverse.cu index 6c00f8b64b4..d913ce070ae 100644 --- a/cpp/src/lists/reverse.cu +++ b/cpp/src/lists/reverse.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -36,7 +37,7 @@ namespace detail { std::unique_ptr reverse(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.is_empty()) { return cudf::empty_like(input.parent()); } @@ -88,7 +89,7 @@ std::unique_ptr reverse(lists_column_view const& input, std::unique_ptr reverse(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::reverse(input, stream, mr); diff --git a/cpp/src/lists/segmented_sort.cu b/cpp/src/lists/segmented_sort.cu index 0b70773f4b2..f920fb916eb 100644 --- a/cpp/src/lists/segmented_sort.cu +++ b/cpp/src/lists/segmented_sort.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include +#include #include @@ -43,7 +44,7 @@ namespace { */ std::unique_ptr build_output_offsets(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto output_offset = make_numeric_column( input.offsets().type(), input.size() + 1, mask_state::UNALLOCATED, stream, mr); @@ -63,7 +64,7 @@ std::unique_ptr sort_lists(lists_column_view const& input, order column_order, null_order null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.is_empty()) return empty_like(input.parent()); @@ -91,7 +92,7 @@ std::unique_ptr stable_sort_lists(lists_column_view const& input, order column_order, null_order null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.is_empty()) { return empty_like(input.parent()); } @@ -120,7 +121,7 @@ std::unique_ptr sort_lists(lists_column_view const& input, order column_order, null_order null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sort_lists(input, column_order, null_precedence, stream, mr); @@ -130,7 +131,7 @@ std::unique_ptr stable_sort_lists(lists_column_view const& input, order column_order, null_order null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::stable_sort_lists(input, column_order, null_precedence, stream, mr); diff --git a/cpp/src/lists/sequences.cu b/cpp/src/lists/sequences.cu index f92ba782da7..cb14ae7619b 100644 --- a/cpp/src/lists/sequences.cu +++ b/cpp/src/lists/sequences.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -88,7 +89,7 @@ struct sequences_dispatcher { std::optional const& steps, size_type const* offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sequences_functor::invoke(n_lists, n_elements, starts, steps, offsets, stream, mr); } @@ -108,7 +109,7 @@ struct sequences_functor()>> { std::optional const& steps, size_type const* offsets, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto result = make_fixed_width_column(starts.type(), n_elements, mask_state::UNALLOCATED, stream, mr); @@ -132,7 +133,7 @@ std::unique_ptr sequences(column_view const& starts, std::optional const& steps, column_view const& sizes, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!starts.has_nulls() && !sizes.has_nulls(), "starts and sizes input columns must not have nulls."); @@ -190,7 +191,7 @@ std::unique_ptr sequences(column_view const& starts, std::unique_ptr sequences(column_view const& starts, column_view const& sizes, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sequences(starts, std::nullopt, sizes, stream, mr); } @@ -199,7 +200,7 @@ std::unique_ptr sequences(column_view const& starts, column_view const& steps, column_view const& sizes, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return sequences(starts, std::optional{steps}, sizes, stream, mr); } @@ -209,7 +210,7 @@ std::unique_ptr sequences(column_view const& starts, std::unique_ptr sequences(column_view const& starts, column_view const& sizes, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sequences(starts, sizes, stream, mr); @@ -219,7 +220,7 @@ std::unique_ptr sequences(column_view const& starts, column_view const& steps, column_view const& sizes, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::sequences(starts, steps, sizes, stream, mr); diff --git a/cpp/src/lists/set_operations.cu b/cpp/src/lists/set_operations.cu index 5735c84e3d3..f3352a3a52d 100644 --- a/cpp/src/lists/set_operations.cu +++ b/cpp/src/lists/set_operations.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -62,7 +63,7 @@ std::unique_ptr have_overlap(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { check_compatibility(lhs, rhs); @@ -132,7 +133,7 @@ std::unique_ptr intersect_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { check_compatibility(lhs, rhs); @@ -193,7 +194,7 @@ std::unique_ptr union_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { check_compatibility(lhs, rhs); @@ -214,7 +215,7 @@ std::unique_ptr difference_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { check_compatibility(lhs, rhs); @@ -279,7 +280,7 @@ std::unique_ptr have_overlap(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::have_overlap(lhs, rhs, nulls_equal, nans_equal, stream, mr); @@ -290,7 +291,7 @@ std::unique_ptr intersect_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::intersect_distinct(lhs, rhs, nulls_equal, nans_equal, stream, mr); @@ -301,7 +302,7 @@ std::unique_ptr union_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::union_distinct(lhs, rhs, nulls_equal, nans_equal, stream, mr); @@ -312,7 +313,7 @@ std::unique_ptr difference_distinct(lists_column_view const& lhs, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::difference_distinct(lhs, rhs, nulls_equal, nans_equal, stream, mr); diff --git a/cpp/src/lists/stream_compaction/apply_boolean_mask.cu b/cpp/src/lists/stream_compaction/apply_boolean_mask.cu index ce972d89150..71aafa3ce12 100644 --- a/cpp/src/lists/stream_compaction/apply_boolean_mask.cu +++ b/cpp/src/lists/stream_compaction/apply_boolean_mask.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -39,7 +40,7 @@ namespace detail { std::unique_ptr apply_boolean_mask(lists_column_view const& input, lists_column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(boolean_mask.child().type().id() == type_id::BOOL8, "Mask must be of type BOOL8."); CUDF_EXPECTS(input.size() == boolean_mask.size(), @@ -102,7 +103,7 @@ std::unique_ptr apply_boolean_mask(lists_column_view const& input, std::unique_ptr apply_boolean_mask(lists_column_view const& input, lists_column_view const& boolean_mask, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::apply_boolean_mask(input, boolean_mask, stream, mr); diff --git a/cpp/src/lists/stream_compaction/distinct.cu b/cpp/src/lists/stream_compaction/distinct.cu index c8d9c15706f..40dee010bd5 100644 --- a/cpp/src/lists/stream_compaction/distinct.cu +++ b/cpp/src/lists/stream_compaction/distinct.cu @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -37,7 +38,7 @@ std::unique_ptr distinct(lists_column_view const& input, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Algorithm: // - Generate labels for the child elements. @@ -77,7 +78,7 @@ std::unique_ptr distinct(lists_column_view const& input, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::distinct(input, nulls_equal, nans_equal, stream, mr); diff --git a/cpp/src/lists/utilities.cu b/cpp/src/lists/utilities.cu index 2c4966c969e..7fb960f02ca 100644 --- a/cpp/src/lists/utilities.cu +++ b/cpp/src/lists/utilities.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,14 @@ #include #include +#include + namespace cudf::lists::detail { std::unique_ptr generate_labels(lists_column_view const& input, size_type n_elements, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto labels = make_numeric_column( data_type(type_to_id()), n_elements, cudf::mask_state::UNALLOCATED, stream, mr); @@ -38,7 +40,7 @@ std::unique_ptr generate_labels(lists_column_view const& input, std::unique_ptr reconstruct_offsets(column_view const& labels, size_type n_lists, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto out_offsets = make_numeric_column( @@ -56,7 +58,7 @@ std::unique_ptr reconstruct_offsets(column_view const& labels, std::unique_ptr get_normalized_offsets(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (input.is_empty()) { return empty_like(input.offsets()); } diff --git a/cpp/src/lists/utilities.hpp b/cpp/src/lists/utilities.hpp index c881e828677..218ad7872e9 100644 --- a/cpp/src/lists/utilities.hpp +++ b/cpp/src/lists/utilities.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #include #include +#include namespace cudf::lists::detail { @@ -36,7 +37,7 @@ namespace cudf::lists::detail { std::unique_ptr generate_labels(lists_column_view const& input, size_type n_elements, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Reconstruct an offsets column from the input list labels column. @@ -50,7 +51,7 @@ std::unique_ptr generate_labels(lists_column_view const& input, std::unique_ptr reconstruct_offsets(column_view const& labels, size_type n_lists, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); /** * @brief Generate 0-based list offsets from the offsets of the input lists column. @@ -62,6 +63,6 @@ std::unique_ptr reconstruct_offsets(column_view const& labels, */ std::unique_ptr get_normalized_offsets(lists_column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); } // namespace cudf::lists::detail diff --git a/cpp/src/merge/merge.cu b/cpp/src/merge/merge.cu index 8be503025bd..4463b16df78 100644 --- a/cpp/src/merge/merge.cu +++ b/cpp/src/merge/merge.cu @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -347,7 +348,7 @@ struct column_merger { std::unique_ptr operator()(column_view const&, column_view const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) const + rmm::device_async_resource_ref) const { CUDF_FAIL("Unsupported type for merge."); } @@ -359,7 +360,7 @@ struct column_merger { column_view const& lcol, column_view const& rcol, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto lsz = lcol.size(); auto merged_size = lsz + rcol.size(); @@ -431,7 +432,7 @@ std::unique_ptr column_merger::operator()( column_view const& lcol, column_view const& rcol, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto column = strings::detail::merge(strings_column_view(lcol), strings_column_view(rcol), @@ -453,7 +454,7 @@ std::unique_ptr column_merger::operator()( column_view const& lcol, column_view const& rcol, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { auto result = cudf::dictionary::detail::merge( cudf::dictionary_column_view(lcol), cudf::dictionary_column_view(rcol), row_order_, stream, mr); @@ -473,7 +474,7 @@ std::unique_ptr column_merger::operator()( column_view const& lcol, column_view const& rcol, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { std::vector columns{lcol, rcol}; auto concatenated_list = cudf::lists::detail::concatenate(columns, stream, mr); @@ -501,7 +502,7 @@ std::unique_ptr column_merger::operator()( column_view const& lcol, column_view const& rcol, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { // merge each child. auto const lhs = structs_column_view{lcol}; @@ -550,7 +551,7 @@ table_ptr_type merge(cudf::table_view const& left_table, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // collect index columns for lhs, rhs, resp. // @@ -620,7 +621,7 @@ table_ptr_type merge(std::vector const& tables_to_merge, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (tables_to_merge.empty()) { return std::make_unique(); } @@ -702,7 +703,7 @@ std::unique_ptr merge(std::vector const& tables_to_merg std::vector const& key_cols, std::vector const& column_order, std::vector const& null_precedence, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::merge( diff --git a/cpp/src/partitioning/partitioning.cu b/cpp/src/partitioning/partitioning.cu index 0d2daaddb8c..f10388794fc 100644 --- a/cpp/src/partitioning/partitioning.cu +++ b/cpp/src/partitioning/partitioning.cu @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -413,7 +414,7 @@ struct copy_block_partitions_dispatcher { size_type const* scanned_block_partition_sizes, size_type grid_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { rmm::device_buffer output(input.size() * sizeof(DataType), stream, mr); @@ -441,7 +442,7 @@ struct copy_block_partitions_dispatcher { size_type const* scanned_block_partition_sizes, size_type grid_size, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Use move_to_output_buffer to create an equivalent gather map auto gather_map = compute_gather_map(input.size(), @@ -471,7 +472,7 @@ std::pair, std::vector> hash_partition_table( size_type num_partitions, uint32_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const num_rows = table_to_hash.num_rows(); @@ -658,7 +659,7 @@ struct dispatch_map_type { column_view const& partition_map, size_type num_partitions, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) const + rmm::device_async_resource_ref mr) const { // Build a histogram of the number of rows in each partition rmm::device_uvector histogram(num_partitions + 1, stream); @@ -761,7 +762,7 @@ std::pair, std::vector> hash_partition( int num_partitions, uint32_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto table_to_hash = input.select(columns_to_hash); @@ -785,7 +786,7 @@ std::pair, std::vector> partition( column_view const& partition_map, size_type num_partitions, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(t.num_rows() == partition_map.size(), "Size mismatch between table and partition map."); @@ -809,7 +810,7 @@ std::pair, std::vector> hash_partition( hash_id hash_function, uint32_t seed, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); @@ -833,7 +834,7 @@ std::pair, std::vector> partition( table_view const& t, column_view const& partition_map, size_type num_partitions, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::partition(t, partition_map, num_partitions, cudf::get_default_stream(), mr); diff --git a/cpp/src/partitioning/round_robin.cu b/cpp/src/partitioning/round_robin.cu index 3283a7c35ee..82b169c78ed 100644 --- a/cpp/src/partitioning/round_robin.cu +++ b/cpp/src/partitioning/round_robin.cu @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -83,7 +84,7 @@ std::pair, std::vector> degenerate cudf::size_type num_partitions, cudf::size_type start_partition, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto nrows = input.num_rows(); @@ -157,7 +158,7 @@ std::pair, std::vector> round_robin_part cudf::size_type num_partitions, cudf::size_type start_partition, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto nrows = input.num_rows(); @@ -270,8 +271,8 @@ std::pair, std::vector> round_robin_part std::pair, std::vector> round_robin_partition( table_view const& input, cudf::size_type num_partitions, - cudf::size_type start_partition = 0, - rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) + cudf::size_type start_partition = 0, + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) { CUDF_FUNC_RANGE(); return detail::round_robin_partition( diff --git a/cpp/src/quantiles/quantile.cu b/cpp/src/quantiles/quantile.cu index cba7203483b..b25254cfe49 100644 --- a/cpp/src/quantiles/quantile.cu +++ b/cpp/src/quantiles/quantile.cu @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -53,7 +54,7 @@ struct quantile_functor { interpolation interp; bool retain_types; rmm::cuda_stream_view stream; - rmm::mr::device_memory_resource* mr; + rmm::device_async_resource_ref mr; template std::enable_if_t and not cudf::is_fixed_point(), @@ -145,7 +146,7 @@ std::unique_ptr quantile(column_view const& input, interpolation interp, bool retain_types, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto functor = quantile_functor{ ordered_indices, size, q, interp, retain_types, stream, mr}; @@ -163,7 +164,7 @@ std::unique_ptr quantile(column_view const& input, column_view const& indices, bool exact, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (indices.is_empty()) { auto begin = thrust::make_counting_iterator(0); @@ -193,7 +194,7 @@ std::unique_ptr quantile(column_view const& input, interpolation interp, column_view const& ordered_indices, bool exact, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::quantile(input, q, interp, ordered_indices, exact, cudf::get_default_stream(), mr); diff --git a/cpp/src/quantiles/quantiles.cu b/cpp/src/quantiles/quantiles.cu index 8fee821dfc4..c0f536536ce 100644 --- a/cpp/src/quantiles/quantiles.cu +++ b/cpp/src/quantiles/quantiles.cu @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -43,7 +44,7 @@ std::unique_ptr
quantiles(table_view const& input, std::vector const& q, interpolation interp, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto quantile_idx_lookup = cuda::proclaim_return_type( [sortmap, interp, size = input.num_rows()] __device__(double q) { @@ -71,7 +72,7 @@ std::unique_ptr
quantiles(table_view const& input, std::vector const& column_order, std::vector const& null_precedence, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (q.empty()) { return empty_like(input); } @@ -99,7 +100,7 @@ std::unique_ptr
quantiles(table_view const& input, cudf::sorted is_input_sorted, std::vector const& column_order, std::vector const& null_precedence, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::quantiles(input, diff --git a/cpp/src/quantiles/tdigest/tdigest.cu b/cpp/src/quantiles/tdigest/tdigest.cu index 96b0355c6e5..da36b7ab1da 100644 --- a/cpp/src/quantiles/tdigest/tdigest.cu +++ b/cpp/src/quantiles/tdigest/tdigest.cu @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -184,7 +185,7 @@ CUDF_KERNEL void compute_percentiles_kernel(device_span tdigest std::unique_ptr compute_approx_percentiles(tdigest_column_view const& input, column_view const& percentiles, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { tdigest_column_view tdv(input); @@ -259,7 +260,7 @@ std::unique_ptr make_tdigest_column(size_type num_rows, std::unique_ptr&& min_values, std::unique_ptr&& max_values, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(tdigest_offsets->size() == num_rows + 1, "Encountered unexpected offset count in make_tdigest_column"); @@ -291,7 +292,7 @@ std::unique_ptr make_tdigest_column(size_type num_rows, } std::unique_ptr make_empty_tdigest_column(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto offsets = cudf::make_fixed_width_column( data_type(type_id::INT32), 2, mask_state::UNALLOCATED, stream, mr); @@ -334,7 +335,7 @@ std::unique_ptr make_empty_tdigest_column(rmm::cuda_stream_view stream, * @returns An empty tdigest scalar. */ std::unique_ptr make_empty_tdigest_scalar(rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto contents = make_empty_tdigest_column(stream, mr)->release(); return std::make_unique( @@ -346,7 +347,7 @@ std::unique_ptr make_empty_tdigest_scalar(rmm::cuda_stream_view stream, std::unique_ptr percentile_approx(tdigest_column_view const& input, column_view const& percentiles, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { tdigest_column_view tdv(input); CUDF_EXPECTS(percentiles.type().id() == type_id::FLOAT64, @@ -407,7 +408,7 @@ std::unique_ptr percentile_approx(tdigest_column_view const& input, std::unique_ptr percentile_approx(tdigest_column_view const& input, column_view const& percentiles, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return tdigest::percentile_approx(input, percentiles, cudf::get_default_stream(), mr); diff --git a/cpp/src/quantiles/tdigest/tdigest_aggregation.cu b/cpp/src/quantiles/tdigest/tdigest_aggregation.cu index 8544d9caa56..229af89fc46 100644 --- a/cpp/src/quantiles/tdigest/tdigest_aggregation.cu +++ b/cpp/src/quantiles/tdigest/tdigest_aggregation.cu @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -333,7 +334,7 @@ __device__ double scale_func_k1(double quantile, double delta_norm) // convert a single-row tdigest column to a scalar. std::unique_ptr to_tdigest_scalar(std::unique_ptr&& tdigest, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(tdigest->size() == 1, "Encountered invalid tdigest column when converting to scalar"); @@ -517,7 +518,7 @@ generate_group_cluster_info(int delta, CumulativeWeight cumulative_weight, bool has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { constexpr size_type block_size = 256; cudf::detail::grid_1d const grid(num_groups, block_size); @@ -581,7 +582,7 @@ std::unique_ptr build_output_column(size_type num_rows, std::unique_ptr&& max_col, bool has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // whether or not this weight is a stub auto is_stub_weight = [weights = weights->view().begin()] __device__(size_type i) { @@ -732,7 +733,7 @@ std::unique_ptr compute_tdigests(int delta, size_type total_clusters, bool has_nulls, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // the output for each group is a column of data that represents the tdigest. since we want 1 row // per group, each row will be a list the length of the tdigest for that group. so our output @@ -841,7 +842,7 @@ struct typed_group_tdigest { size_type num_groups, int delta, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // first, generate cluster weight information for each input group auto [group_cluster_wl, group_cluster_offsets, total_clusters] = generate_group_cluster_info( @@ -907,7 +908,7 @@ struct typed_reduce_tdigest { std::unique_ptr operator()(column_view const& col, int delta, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // treat this the same as the groupby path with a single group. Note: even though // there is only 1 group there are still multiple keys within the group that represent @@ -1029,7 +1030,7 @@ std::unique_ptr merge_tdigests(tdigest_column_view const& tdv, size_type num_groups, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // thrust::merge and thrust::merge_by_key don't provide what we need. What we would need is an // algorithm like a super-merge that takes two layers of keys: one which identifies the outer @@ -1211,7 +1212,7 @@ std::unique_ptr merge_tdigests(tdigest_column_view const& tdv, std::unique_ptr reduce_tdigest(column_view const& col, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (col.size() == 0) { return cudf::tdigest::detail::make_empty_tdigest_scalar(stream, mr); } @@ -1234,7 +1235,7 @@ struct group_offsets_fn { std::unique_ptr reduce_merge_tdigest(column_view const& input, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { tdigest_column_view tdv(input); @@ -1264,7 +1265,7 @@ std::unique_ptr group_tdigest(column_view const& col, size_type num_groups, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (col.size() == 0) { return cudf::tdigest::detail::make_empty_tdigest_column(stream, mr); } @@ -1287,7 +1288,7 @@ std::unique_ptr group_merge_tdigest(column_view const& input, size_type num_groups, int max_centroids, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { tdigest_column_view tdv(input); diff --git a/cpp/src/reductions/all.cu b/cpp/src/reductions/all.cu index 6cea4e4ada3..11b0e2732fe 100644 --- a/cpp/src/reductions/all.cu +++ b/cpp/src/reductions/all.cu @@ -19,6 +19,8 @@ #include #include +#include + #include #include #include @@ -55,7 +57,7 @@ struct all_fn { template >* = nullptr> std::unique_ptr operator()(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const d_dict = cudf::column_device_view::create(input, stream); auto const iter = [&] { @@ -74,7 +76,7 @@ struct all_fn { template >* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) + rmm::device_async_resource_ref) { CUDF_FAIL("Unexpected key type for dictionary in reduction all()"); } @@ -86,7 +88,7 @@ std::unique_ptr all(column_view const& col, cudf::data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(output_dtype == cudf::data_type(cudf::type_id::BOOL8), "all() operation can be applied with output type `BOOL8` only"); diff --git a/cpp/src/reductions/any.cu b/cpp/src/reductions/any.cu index c0c044a1e6f..0ebeb7a48b9 100644 --- a/cpp/src/reductions/any.cu +++ b/cpp/src/reductions/any.cu @@ -19,6 +19,8 @@ #include #include +#include + #include #include #include @@ -55,7 +57,7 @@ struct any_fn { template >* = nullptr> std::unique_ptr operator()(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const d_dict = cudf::column_device_view::create(input, stream); auto const iter = [&] { @@ -74,7 +76,7 @@ struct any_fn { template >* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, - rmm::mr::device_memory_resource*) + rmm::device_async_resource_ref) { CUDF_FAIL("Unexpected key type for dictionary in reduction any()"); } @@ -86,7 +88,7 @@ std::unique_ptr any(column_view const& col, cudf::data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(output_dtype == cudf::data_type(cudf::type_id::BOOL8), "any() operation can be applied with output type `bool8` only"); diff --git a/cpp/src/reductions/collect_ops.cu b/cpp/src/reductions/collect_ops.cu index 743eddbffaf..c1a1f117ee1 100644 --- a/cpp/src/reductions/collect_ops.cu +++ b/cpp/src/reductions/collect_ops.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ #include #include +#include + namespace cudf { namespace reduction { namespace detail { @@ -45,7 +47,7 @@ bool need_handle_nulls(column_view const& input, null_policy null_handling) std::unique_ptr collect_list(column_view const& col, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (need_handle_nulls(col, null_handling)) { auto d_view = column_device_view::create(col, stream); @@ -61,7 +63,7 @@ std::unique_ptr collect_list(column_view const& col, std::unique_ptr merge_lists(lists_column_view const& col, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto flatten_col = col.get_sliced_child(stream); return make_list_scalar(flatten_col, stream, mr); @@ -72,7 +74,7 @@ std::unique_ptr collect_set(column_view const& col, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // `input_as_collect_list` is the result of the input column that has been processed to obey // the given null handling behavior. @@ -101,7 +103,7 @@ std::unique_ptr merge_sets(lists_column_view const& col, null_equality nulls_equal, nan_equality nans_equal, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto flatten_col = col.get_sliced_child(stream); auto distinct_table = cudf::detail::distinct(table_view{{flatten_col}}, diff --git a/cpp/src/reductions/compound.cuh b/cpp/src/reductions/compound.cuh index 3428130d912..aa71546f049 100644 --- a/cpp/src/reductions/compound.cuh +++ b/cpp/src/reductions/compound.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,8 @@ #include #include +#include + #include namespace cudf { @@ -48,7 +50,7 @@ std::unique_ptr compound_reduction(column_view const& col, data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const valid_count = col.size() - col.null_count(); @@ -101,7 +103,7 @@ struct result_type_dispatcher { cudf::data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return compound_reduction(col, output_dtype, ddof, stream, mr); } @@ -111,7 +113,7 @@ struct result_type_dispatcher { cudf::data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FAIL("Unsupported output data type"); } @@ -134,7 +136,7 @@ struct element_type_dispatcher { cudf::data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return cudf::type_dispatcher( output_dtype, result_type_dispatcher(), col, output_dtype, ddof, stream, mr); @@ -145,7 +147,7 @@ struct element_type_dispatcher { cudf::data_type const output_dtype, size_type ddof, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FAIL( "Reduction operators other than `min` and `max`" diff --git a/cpp/src/reductions/histogram.cu b/cpp/src/reductions/histogram.cu index 3e46a34cc6a..bebb9d14923 100644 --- a/cpp/src/reductions/histogram.cu +++ b/cpp/src/reductions/histogram.cu @@ -21,6 +21,8 @@ #include #include +#include + #include #include #include @@ -114,7 +116,7 @@ auto gather_histogram(table_view const& input, device_span distinct_indices, std::unique_ptr&& distinct_counts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto distinct_rows = cudf::detail::gather(input, distinct_indices, @@ -152,7 +154,7 @@ std::pair>, std::unique_ptr const& partial_counts, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const has_nested_columns = cudf::detail::has_nested_columns(input); @@ -236,7 +238,7 @@ compute_row_frequencies(table_view const& input, std::unique_ptr histogram(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Empty group should be handled before reaching here. CUDF_EXPECTS(input.size() > 0, "Input should not be empty.", std::invalid_argument); @@ -249,7 +251,7 @@ std::unique_ptr histogram(column_view const& input, std::unique_ptr merge_histogram(column_view const& input, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { // Empty group should be handled before reaching here. CUDF_EXPECTS(input.size() > 0, "Input should not be empty.", std::invalid_argument); diff --git a/cpp/src/reductions/max.cu b/cpp/src/reductions/max.cu index 1cf2b6f53b6..682889f0fee 100644 --- a/cpp/src/reductions/max.cu +++ b/cpp/src/reductions/max.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace reduction { @@ -29,7 +30,7 @@ std::unique_ptr max(column_view const& col, cudf::data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const input_type = cudf::is_dictionary(col.type()) ? cudf::dictionary_column_view(col).keys().type() : col.type(); diff --git a/cpp/src/reductions/mean.cu b/cpp/src/reductions/mean.cu index e64660932ce..e8a10f02cc1 100644 --- a/cpp/src/reductions/mean.cu +++ b/cpp/src/reductions/mean.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace reduction { @@ -28,7 +29,7 @@ namespace detail { std::unique_ptr mean(column_view const& col, cudf::data_type const output_dtype, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto col_type = cudf::is_dictionary(col.type()) ? dictionary_column_view(col).keys().type() : col.type(); diff --git a/cpp/src/reductions/min.cu b/cpp/src/reductions/min.cu index 792965e8b99..7986bda5751 100644 --- a/cpp/src/reductions/min.cu +++ b/cpp/src/reductions/min.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ #include #include +#include + namespace cudf { namespace reduction { namespace detail { @@ -26,7 +28,7 @@ std::unique_ptr min(column_view const& col, data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const input_type = cudf::is_dictionary(col.type()) ? cudf::dictionary_column_view(col).keys().type() : col.type(); diff --git a/cpp/src/reductions/minmax.cu b/cpp/src/reductions/minmax.cu index c4eb09110c6..62a1f4aab7c 100644 --- a/cpp/src/reductions/minmax.cu +++ b/cpp/src/reductions/minmax.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -190,7 +191,7 @@ struct minmax_functor { std::enable_if_t() and !std::is_same_v and !cudf::is_dictionary()>* = nullptr> std::pair, std::unique_ptr> operator()( - cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { using storage_type = device_storage_type_t; // compute minimum and maximum values @@ -210,7 +211,7 @@ struct minmax_functor { */ template >* = nullptr> std::pair, std::unique_ptr> operator()( - cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { // compute minimum and maximum values auto dev_result = reduce(col, stream); @@ -229,7 +230,7 @@ struct minmax_functor { */ template ()>* = nullptr> std::pair, std::unique_ptr> operator()( - cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { // compute minimum and maximum values auto dev_result = reduce(col, stream); @@ -246,7 +247,7 @@ struct minmax_functor { template ()>* = nullptr> std::pair, std::unique_ptr> operator()( - cudf::column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) + cudf::column_view const&, rmm::cuda_stream_view, rmm::device_async_resource_ref) { CUDF_FAIL("type not supported for minmax() operation"); } @@ -260,7 +261,7 @@ struct minmax_functor { * @param stream CUDA stream used for device memory operations and kernel launches. */ std::pair, std::unique_ptr> minmax( - cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + cudf::column_view const& col, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { if (col.null_count() == col.size()) { // this handles empty and all-null columns @@ -274,7 +275,7 @@ std::pair, std::unique_ptr> minmax( } // namespace detail std::pair, std::unique_ptr> minmax( - column_view const& col, rmm::mr::device_memory_resource* mr) + column_view const& col, rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::minmax(col, cudf::get_default_stream(), mr); diff --git a/cpp/src/reductions/nth_element.cu b/cpp/src/reductions/nth_element.cu index 88a1778bb7b..e266f477c5d 100644 --- a/cpp/src/reductions/nth_element.cu +++ b/cpp/src/reductions/nth_element.cu @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,7 @@ std::unique_ptr nth_element(column_view const& col, size_type n, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(n >= -col.size() and n < col.size(), "Index out of bounds"); auto wrap_n = [n](size_type size) { return (n < 0 ? size + n : n); }; diff --git a/cpp/src/reductions/product.cu b/cpp/src/reductions/product.cu index 2e483813939..28ff8db3708 100644 --- a/cpp/src/reductions/product.cu +++ b/cpp/src/reductions/product.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include +#include namespace cudf { namespace reduction { @@ -29,7 +30,7 @@ std::unique_ptr product(column_view const& col, cudf::data_type const output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return cudf::type_dispatcher( cudf::is_dictionary(col.type()) ? dictionary_column_view(col).keys().type() : col.type(), diff --git a/cpp/src/reductions/reductions.cpp b/cpp/src/reductions/reductions.cpp index cd1669d1d6b..d764ea7559f 100644 --- a/cpp/src/reductions/reductions.cpp +++ b/cpp/src/reductions/reductions.cpp @@ -30,6 +30,7 @@ #include #include +#include namespace cudf { namespace reduction { @@ -38,14 +39,14 @@ struct reduce_dispatch_functor { column_view const col; data_type output_dtype; std::optional> init; - rmm::mr::device_memory_resource* mr; + rmm::device_async_resource_ref mr; rmm::cuda_stream_view stream; reduce_dispatch_functor(column_view const& col, data_type output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) : col(col), output_dtype(output_dtype), init(init), mr(mr), stream(stream) { } @@ -151,7 +152,7 @@ std::unique_ptr reduce(column_view const& col, data_type output_dtype, std::optional> init, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!init.has_value() || col.type() == init.value().get().type(), "column and initial value must be the same type"); @@ -204,7 +205,7 @@ std::unique_ptr reduce(column_view const& col, std::unique_ptr reduce(column_view const& col, reduce_aggregation const& agg, data_type output_dtype, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return reduction::detail::reduce( @@ -215,7 +216,7 @@ std::unique_ptr reduce(column_view const& col, reduce_aggregation const& agg, data_type output_dtype, std::optional> init, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return reduction::detail::reduce(col, agg, output_dtype, init, cudf::get_default_stream(), mr); diff --git a/cpp/src/reductions/scan/rank_scan.cu b/cpp/src/reductions/scan/rank_scan.cu index 538763099d3..0befb6ac7d7 100644 --- a/cpp/src/reductions/scan/rank_scan.cu +++ b/cpp/src/reductions/scan/rank_scan.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -66,7 +67,7 @@ std::unique_ptr rank_generator(column_view const& order_by, value_resolver resolver, scan_operator scan_op, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { auto const order_by_tview = table_view{{order_by}}; auto comp = cudf::experimental::row::equality::self_comparator(order_by_tview, stream); @@ -105,7 +106,7 @@ std::unique_ptr rank_generator(column_view const& order_by, std::unique_ptr inclusive_dense_rank_scan(column_view const& order_by, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { return rank_generator( order_by, @@ -117,7 +118,7 @@ std::unique_ptr inclusive_dense_rank_scan(column_view const& order_by, std::unique_ptr inclusive_rank_scan(column_view const& order_by, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_EXPECTS(!cudf::structs::detail::is_or_has_nested_lists(order_by), "Unsupported list type in rank scan."); @@ -130,7 +131,7 @@ std::unique_ptr inclusive_rank_scan(column_view const& order_by, } std::unique_ptr inclusive_one_normalized_percent_rank_scan( - column_view const& order_by, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) + column_view const& order_by, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) { auto const rank_column = inclusive_rank_scan(order_by, stream, rmm::mr::get_current_device_resource()); diff --git a/cpp/src/reductions/scan/scan.cpp b/cpp/src/reductions/scan/scan.cpp index 2871ee283ba..b6e8690a6c9 100644 --- a/cpp/src/reductions/scan/scan.cpp +++ b/cpp/src/reductions/scan/scan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,8 @@ #include #include +#include + namespace cudf { namespace detail { @@ -29,7 +31,7 @@ std::unique_ptr scan(column_view const& input, scan_type inclusive, null_policy null_handling, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { if (agg.kind == aggregation::RANK) { CUDF_EXPECTS(inclusive == scan_type::INCLUSIVE, @@ -58,7 +60,7 @@ std::unique_ptr scan(column_view const& input, scan_aggregation const& agg, scan_type inclusive, null_policy null_handling, - rmm::mr::device_memory_resource* mr) + rmm::device_async_resource_ref mr) { CUDF_FUNC_RANGE(); return detail::scan(input, agg, inclusive, null_handling, cudf::get_default_stream(), mr); diff --git a/cpp/src/reductions/scan/scan.cuh b/cpp/src/reductions/scan/scan.cuh index e575bde0ce0..aeb9e516cd4 100644 --- a/cpp/src/reductions/scan/scan.cuh +++ b/cpp/src/reductions/scan/scan.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include +#include #include @@ -33,14 +34,14 @@ namespace detail { std::pair mask_scan(column_view const& input_view, scan_type inclusive, rmm::cuda_stream_view stream, - rmm::mr::device_memory_resource* mr); + rmm::device_async_resource_ref mr); template