Skip to content

Commit

Permalink
Use rmm::percent_of_free_device_memory in arena test (#1689)
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

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Rong Ou (https://github.com/rongou)

URL: #1689
  • Loading branch information
wence- authored Sep 30, 2024
1 parent b514473 commit 9e410c0
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 9e410c0

Please sign in to comment.