未验证 提交 b8aff5e5 编写于 作者: Z Zeng Jinle 提交者: GitHub

fix buddy_allocator_test, test=develop (#19967)

上级 4a5ce4fe
...@@ -220,7 +220,7 @@ TEST(BuddyAllocator, AllocFromAvailableWhenFractionIsOne) { ...@@ -220,7 +220,7 @@ TEST(BuddyAllocator, AllocFromAvailableWhenFractionIsOne) {
FLAGS_reallocate_gpu_memory_in_mb = 0; FLAGS_reallocate_gpu_memory_in_mb = 0;
void* p = nullptr; void* p = nullptr;
EXPECT_TRUE(cudaMalloc(&p, static_cast<size_t>(4) << 30) == cudaSuccess); EXPECT_TRUE(cudaMalloc(&p, static_cast<size_t>(3) << 30) == cudaSuccess);
// BuddyAllocator should be able to alloc the remaining GPU // BuddyAllocator should be able to alloc the remaining GPU
BuddyAllocator buddy_allocator( BuddyAllocator buddy_allocator(
...@@ -228,7 +228,7 @@ TEST(BuddyAllocator, AllocFromAvailableWhenFractionIsOne) { ...@@ -228,7 +228,7 @@ TEST(BuddyAllocator, AllocFromAvailableWhenFractionIsOne) {
platform::GpuMinChunkSize(), platform::GpuMaxChunkSize()); platform::GpuMinChunkSize(), platform::GpuMaxChunkSize());
TestBuddyAllocator(&buddy_allocator, static_cast<size_t>(1) << 30); TestBuddyAllocator(&buddy_allocator, static_cast<size_t>(1) << 30);
TestBuddyAllocator(&buddy_allocator, static_cast<size_t>(5) << 30); TestBuddyAllocator(&buddy_allocator, static_cast<size_t>(2) << 30);
if (p) { if (p) {
EXPECT_TRUE(cudaFree(p) == cudaSuccess); EXPECT_TRUE(cudaFree(p) == cudaSuccess);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册