Skip to content

Commit

Permalink
Add stream to public API for hash and test the output.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Feb 11, 2023
1 parent 8f3686b commit 14dce92
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions cpp/include/cudf/hashing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ std::unique_ptr<column> hash(
table_view const& input,
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());

/** @} */ // end of group
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/hash/hashing.cu
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ std::unique_ptr<column> hash(table_view const& input,
std::unique_ptr<column> hash(table_view const& input,
hash_id hash_function,
uint32_t seed,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr)
{
CUDF_FUNC_RANGE();
return detail::hash(input, hash_function, seed, cudf::get_default_stream(), mr);
return detail::hash(input, hash_function, seed, stream, mr);
}

} // namespace cudf
8 changes: 6 additions & 2 deletions cpp/tests/hashing/hash_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ TEST_F(HashTest, MultiValue)
auto const input1 = cudf::table_view({strings_col, ints_col, bools_col1, secs_col});
auto const input2 = cudf::table_view({strings_col, ints_col, bools_col2, secs_col});

auto const output1 = cudf::hash(input1);
auto const output2 = cudf::hash(input2);
printf("\n\nAbout to call hash. Everything before this doesn't matter\n\n\n.");
auto const output1 = cudf::hash(
input1, cudf::hash_id::HASH_MURMUR3, cudf::DEFAULT_HASH_SEED, cudf::test::get_default_stream());
auto const output2 = cudf::hash(
input2, cudf::hash_id::HASH_MURMUR3, cudf::DEFAULT_HASH_SEED, cudf::test::get_default_stream());
printf("\n\nDone with hash\n\n\n.");

EXPECT_EQ(input1.num_rows(), output1->size());
CUDF_TEST_EXPECT_COLUMNS_EQUAL(output1->view(), output2->view());
Expand Down

0 comments on commit 14dce92

Please sign in to comment.