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>
20 
21 #include <rmm/cuda_stream_view.hpp>
22 
23 #include <memory>
24 #include <vector>
25 
26 namespace cudf {
67 std::pair<std::unique_ptr<table>, std::vector<size_type>> partition(
68  table_view const& t,
69  column_view const& partition_map,
70  size_type num_partitions,
71  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
72 
93 std::pair<std::unique_ptr<table>, std::vector<size_type>> hash_partition(
94  table_view const& input,
95  std::vector<size_type> const& columns_to_hash,
96  int num_partitions,
97  hash_id hash_function = hash_id::HASH_MURMUR3,
98  uint32_t seed = DEFAULT_HASH_SEED,
99  rmm::cuda_stream_view stream = rmm::cuda_stream_default,
100  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
101 
239 std::pair<std::unique_ptr<cudf::table>, std::vector<cudf::size_type>> round_robin_partition(
240  table_view const& input,
241  cudf::size_type num_partitions,
242  cudf::size_type start_partition = 0,
243  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
244  // end of group
246 } // namespace cudf
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:84
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:300
rmm::cuda_stream_view
hashing.hpp
cudf::table_view
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:154
cudf::hash_id
hash_id
Identifies the hash function to be used.
Definition: hashing.hpp:34
cudf::hash_partition
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=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Partitions rows from the input table into multiple output tables.
cudf
cuDF interfaces
Definition: aggregation.hpp:34
rmm::mr::device_memory_resource
cudf::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.
cudf::round_robin_partition
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.