Skip to content

Commit

Permalink
Remove dependence on managed memory for multimap test (#7451)
Browse files Browse the repository at this point in the history
Removes managed memory from the `HASH_MAP_TEST` to allow the test to work on systems that don't support managed memory.

Authors:
  - Jake Hemstad (@jrhemstad)

Approvers:
  - Ram (Ramakrishna Prabhu) (@rgsl888prabhu)
  - Mark Harris (@harrism)

URL: #7451
  • Loading branch information
jrhemstad authored Mar 3, 2021
1 parent c25b728 commit 8341db4
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions cpp/tests/hash_map/multimap_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <hash/concurrent_unordered_multimap.cuh>
#include <hash/hash_allocator.cuh>

#include <cudf_test/base_fixture.hpp>

Expand Down Expand Up @@ -46,11 +47,15 @@ class MultimapTest : public cudf::test::BaseFixture {
using value_type = typename T::value_type;
using size_type = int;

using multimap_type = concurrent_unordered_multimap<key_type,
value_type,
size_type,
std::numeric_limits<key_type>::max(),
std::numeric_limits<value_type>::max()>;
using multimap_type =
concurrent_unordered_multimap<key_type,
value_type,
size_type,
std::numeric_limits<key_type>::max(),
std::numeric_limits<value_type>::max(),
default_hash<key_type>,
equal_to<key_type>,
default_allocator<thrust::pair<key_type, value_type>>>;

std::unique_ptr<multimap_type, std::function<void(multimap_type*)>> the_map;

Expand Down Expand Up @@ -91,12 +96,3 @@ TYPED_TEST(MultimapTest, InitialState)
auto end = this->the_map->end();
EXPECT_NE(begin, end);
}

TYPED_TEST(MultimapTest, CheckUnusedValues)
{
EXPECT_EQ(this->the_map->get_unused_key(), this->unused_key);

auto begin = this->the_map->begin();
EXPECT_EQ(begin->first, this->unused_key);
EXPECT_EQ(begin->second, this->unused_value);
}

0 comments on commit 8341db4

Please sign in to comment.