Skip to content

Commit

Permalink
Move MD5 below the MurmurHash3 family so that it will go next to SHA …
Browse files Browse the repository at this point in the history
…in the future.
  • Loading branch information
bdice committed Mar 16, 2022
1 parent cb80e44 commit 0a430be
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions cpp/benchmarks/hashing/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ static void BM_hash(benchmark::State& state, cudf::hash_id hid, contains_nulls h
#define HASH_BENCHMARK_DEFINE(hid, n) H_BENCHMARK_DEFINE(concat(hid, _, n), hid, n)

HASH_BENCHMARK_DEFINE(HASH_MURMUR3, nulls)
HASH_BENCHMARK_DEFINE(HASH_MD5, nulls)
HASH_BENCHMARK_DEFINE(HASH_SERIAL_MURMUR3, nulls)
HASH_BENCHMARK_DEFINE(HASH_SPARK_MURMUR3, nulls)
HASH_BENCHMARK_DEFINE(HASH_MD5, nulls)

HASH_BENCHMARK_DEFINE(HASH_MURMUR3, no_nulls)
HASH_BENCHMARK_DEFINE(HASH_MD5, no_nulls)
HASH_BENCHMARK_DEFINE(HASH_SERIAL_MURMUR3, no_nulls)
HASH_BENCHMARK_DEFINE(HASH_SPARK_MURMUR3, no_nulls)
HASH_BENCHMARK_DEFINE(HASH_MD5, no_nulls)
8 changes: 4 additions & 4 deletions cpp/include/cudf/detail/hashing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ std::unique_ptr<column> murmur_hash3_32(
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

std::unique_ptr<column> md5_hash(
template <template <typename> class hash_function>
std::unique_ptr<column> serial_murmur_hash3_32(
table_view const& input,
uint32_t seed = 0,
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

template <template <typename> class hash_function>
std::unique_ptr<column> serial_murmur_hash3_32(
std::unique_ptr<column> md5_hash(
table_view const& input,
uint32_t seed = 0,
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/hashing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ namespace cudf {
enum class hash_id {
HASH_IDENTITY = 0, ///< Identity hash function that simply returns the key to be hashed
HASH_MURMUR3, ///< Murmur3 hash function
HASH_MD5, ///< MD5 hash function
HASH_SERIAL_MURMUR3, ///< Serial Murmur3 hash function
HASH_SPARK_MURMUR3 ///< Spark Murmur3 hash function
HASH_SPARK_MURMUR3, ///< Spark Murmur3 hash function
HASH_MD5 ///< MD5 hash function
};

/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/hash/hashing.cu
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ std::unique_ptr<column> hash(table_view const& input,
{
switch (hash_function) {
case (hash_id::HASH_MURMUR3): return murmur_hash3_32(input, stream, mr);
case (hash_id::HASH_MD5): return md5_hash(input, stream, mr);
case (hash_id::HASH_SERIAL_MURMUR3):
return serial_murmur_hash3_32<MurmurHash3_32>(input, seed, stream, mr);
case (hash_id::HASH_SPARK_MURMUR3):
return serial_murmur_hash3_32<SparkMurmurHash3_32>(input, seed, stream, mr);
case (hash_id::HASH_MD5): return md5_hash(input, stream, mr);
default: CUDF_FAIL("Unsupported hash function.");
}
}
Expand Down
6 changes: 3 additions & 3 deletions java/src/main/java/ai/rapids/cudf/HashType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
public enum HashType {
IDENTITY(0),
MURMUR3(1),
HASH_MD5(2),
HASH_SERIAL_MURMUR3(3),
HASH_SPARK_MURMUR3(4);
HASH_SERIAL_MURMUR3(2),
HASH_SPARK_MURMUR3(3),
HASH_MD5(4);

private static final HashType[] HASH_TYPES = HashType.values();
final int nativeId;
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/_lib/cpp/hash.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ cdef extern from "cudf/hashing.hpp" namespace "cudf" nogil:
ctypedef enum hash_id "cudf::hash_id":
HASH_IDENTITY "cudf::hash_id::HASH_IDENTITY"
HASH_MURMUR3 "cudf::hash_id::HASH_MURMUR3"
HASH_MD5 "cudf::hash_id::HASH_MD5"
HASH_SERIAL_MURMUR3 "cudf::hash_id::HASH_SERIAL_MURMUR3"
HASH_SPARK_MURMUR3 "cudf::hash_id::HASH_SPARK_MURMUR3"
HASH_MD5 "cudf::hash_id::HASH_MD5"

cdef unique_ptr[column] hash "cudf::hash" (
const table_view& input,
Expand Down

0 comments on commit 0a430be

Please sign in to comment.