Skip to content

Commit

Permalink
Use percent_of_free_device_memory in arena test
Browse files Browse the repository at this point in the history
Rather than hand-coding a fraction of the device memory use the
utility routine.

- Closes #1674
  • Loading branch information
wence- committed Sep 30, 2024
1 parent b514473 commit f93e235
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/mr/device/arena_mr_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,7 @@ TEST_F(ArenaTest, SizeSmallerThanSuperblockSize) // NOLINT
TEST_F(ArenaTest, AllocateNinetyPercent) // NOLINT
{
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
auto const free = rmm::available_device_memory().first;
auto const ninety_percent = rmm::align_up(
static_cast<std::size_t>(static_cast<double>(free) * 0.9), rmm::CUDA_ALLOCATION_ALIGNMENT);
auto const ninety_percent = rmm::percent_of_free_device_memory(90);
arena_mr mr(rmm::mr::get_current_device_resource_ref(), ninety_percent);
}());
}
Expand Down

0 comments on commit f93e235

Please sign in to comment.