hashing.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-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  * 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 #pragma once
17 
18 #include <cudf/table/table.hpp>
20 
21 #include <rmm/mr/device/per_device_resource.hpp>
22 #include <rmm/resource_ref.hpp>
23 
24 namespace cudf {
25 
36 using hash_value_type = uint32_t;
37 
41 static constexpr uint32_t DEFAULT_HASH_SEED = 0;
42 
44 namespace hashing {
45 
60 std::unique_ptr<column> murmurhash3_x86_32(
61  table_view const& input,
62  uint32_t seed = DEFAULT_HASH_SEED,
63  rmm::cuda_stream_view stream = cudf::get_default_stream(),
64  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
65 
79 std::unique_ptr<table> murmurhash3_x64_128(
80  table_view const& input,
81  uint64_t seed = DEFAULT_HASH_SEED,
82  rmm::cuda_stream_view stream = cudf::get_default_stream(),
83  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
84 
94 std::unique_ptr<column> md5(
95  table_view const& input,
96  rmm::cuda_stream_view stream = cudf::get_default_stream(),
97  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
98 
108 std::unique_ptr<column> sha1(
109  table_view const& input,
110  rmm::cuda_stream_view stream = cudf::get_default_stream(),
111  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
112 
122 std::unique_ptr<column> sha224(
123  table_view const& input,
124  rmm::cuda_stream_view stream = cudf::get_default_stream(),
125  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
126 
136 std::unique_ptr<column> sha256(
137  table_view const& input,
138  rmm::cuda_stream_view stream = cudf::get_default_stream(),
139  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
140 
150 std::unique_ptr<column> sha384(
151  table_view const& input,
152  rmm::cuda_stream_view stream = cudf::get_default_stream(),
153  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
154 
164 std::unique_ptr<column> sha512(
165  table_view const& input,
166  rmm::cuda_stream_view stream = cudf::get_default_stream(),
167  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
168 
181 std::unique_ptr<column> xxhash_64(
182  table_view const& input,
183  uint64_t seed = DEFAULT_HASH_SEED,
184  rmm::cuda_stream_view stream = cudf::get_default_stream(),
185  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
186 
187 } // namespace hashing
188  // end of group
190 } // namespace cudf
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:200
uint32_t hash_value_type
Type of hash value.
Definition: hashing.hpp:36
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
std::unique_ptr< column > md5(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Computes the MD5 hash value of each row in the given table.
std::unique_ptr< column > sha256(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Computes the SHA-256 hash value of each row in the given table.
std::unique_ptr< column > sha1(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Computes the SHA-1 hash value of each row in the given table.
std::unique_ptr< column > murmurhash3_x86_32(table_view const &input, 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())
Computes the MurmurHash3 32-bit hash value of each row in the given table.
std::unique_ptr< column > sha224(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Computes the SHA-224 hash value of each row in the given table.
std::unique_ptr< table > murmurhash3_x64_128(table_view const &input, 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())
Computes the MurmurHash3 64-bit hash value of each row in the given table.
std::unique_ptr< column > sha384(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Computes the SHA-384 hash value of each row in the given table.
std::unique_ptr< column > xxhash_64(table_view const &input, 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())
Computes the XXHash_64 hash value of each row in the given table.
std::unique_ptr< column > sha512(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
Computes the SHA-512 hash value of each row in the given table.
cuDF interfaces
Definition: aggregation.hpp:34
Class definition for cudf::table.
Class definitions for (mutable)_table_view