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

fix allocator ut,test=develop (#19945)

上级 bdb3e376
......@@ -127,7 +127,7 @@ TEST(RetryAllocator, RetryAllocatorLastAllocFailure) {
{
platform::CUDAPlace p(0);
RetryAllocator allocator(std::make_shared<CUDAAllocator>(p), retry_ms);
size_t allocate_size = -1UL; // Very large number
size_t allocate_size = (static_cast<size_t>(1) << 40); // Very large number
try {
auto allocation = allocator.Allocate(allocate_size);
ASSERT_TRUE(false);
......
......@@ -73,7 +73,7 @@ TEST(CUDAPinnedAllocator, Alloc) {
TEST(GPUAllocator, AllocFailure) {
paddle::memory::detail::GPUAllocator allocator(0);
size_t index;
size_t alloc_size = -1UL; // very large size
size_t alloc_size = (static_cast<size_t>(1) << 40); // Very large number
try {
allocator.Alloc(&index, alloc_size);
ASSERT_TRUE(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册