partitioning.hpp
转到此文件的文档。
1 /*
2  * Copyright (c) 2020-2024, 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  * https://apache.ac.cn/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 #include <cudf/utilities/export.hpp>
23 
24 #include <rmm/cuda_stream_view.hpp>
25 
26 #include <memory>
27 #include <vector>
28 
29 namespace CUDF_EXPORT cudf {
40 enum class hash_id {
41  HASH_IDENTITY = 0,
43 };
44 
79 std::pair<std::unique_ptr<table>, std::vector<size_type>> partition(
80  table_view const& t,
81  column_view const& partition_map,
82  size_type num_partitions,
85 
106 std::pair<std::unique_ptr<table>, std::vector<size_type>> hash_partition(
107  table_view const& input,
108  std::vector<size_type> const& columns_to_hash,
109  int num_partitions,
110  hash_id hash_function = hash_id::HASH_MURMUR3,
111  uint32_t seed = DEFAULT_HASH_SEED,
114 
253 std::pair<std::unique_ptr<cudf::table>, std::vector<cudf::size_type>> round_robin_partition(
254  table_view const& input,
255  cudf::size_type num_partitions,
256  cudf::size_type start_partition = 0,
259  // 组结束
261 } // namespace CUDF_EXPORT cudf
对设备数据作为元素列的非拥有、不可变视图,其中一些元素可能为null,如同...
一组相同大小的 cudf::column_view。
rmm::cuda_stream_view const get_default_stream()
获取当前默认流。
rmm::device_async_resource_ref get_current_device_resource_ref()
获取当前设备内存资源引用。
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
hash_id
标识哈希分区中使用的哈希函数。
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::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
将输入表的行分区到多个输出表中。
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::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
轮询分区。
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::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
根据 partition_map 指定的映射对表 t 的行进行分区。
@ HASH_IDENTITY
标识哈希函数,仅返回要哈希的键。
@ HASH_MURMUR3
Murmur3 哈希函数。
int32_t size_type
列和表的行索引类型。
定义: types.hpp:95
cuDF 接口
定义: host_udf.hpp:37