libcudf  24.04.00
partitioning.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cudf/hashing.hpp>
21 
22 #include <rmm/cuda_stream_view.hpp>
23 #include <rmm/mr/device/per_device_resource.hpp>
24 
25 #include <memory>
26 #include <vector>
27 
28 namespace cudf {
69 std::pair<std::unique_ptr<table>, std::vector<size_type>> partition(
70  table_view const& t,
71  column_view const& partition_map,
72  size_type num_partitions,
73  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
74 
95 std::pair<std::unique_ptr<table>, std::vector<size_type>> hash_partition(
96  table_view const& input,
97  std::vector<size_type> const& columns_to_hash,
98  int num_partitions,
99  hash_id hash_function = hash_id::HASH_MURMUR3,
100  uint32_t seed = DEFAULT_HASH_SEED,
101  rmm::cuda_stream_view stream = cudf::get_default_stream(),
102  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
103 
241 std::pair<std::unique_ptr<cudf::table>, std::vector<cudf::size_type>> round_robin_partition(
242  table_view const& input,
243  cudf::size_type num_partitions,
244  cudf::size_type start_partition = 0,
245  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
246  // end of group
248 } // namespace cudf
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:187
hash_id
Identifies the hash function to be used.
Definition: hashing.hpp:41
@ HASH_MURMUR3
Murmur3 hash function.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
std::pair< std::unique_ptr< table >, std::vector< size_type > > hash_partition(table_view const &input, std::vector< size_type > 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())
Partitions rows from the input table into multiple output tables.
std::pair< std::unique_ptr< cudf::table >, std::vector< cudf::size_type > > 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())
Round-robin partition.
std::pair< std::unique_ptr< table >, std::vector< size_type > > 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())
Partitions rows of t according to the mapping specified by partition_map.
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:93
cuDF interfaces
Definition: aggregation.hpp:34