fix allocator ut,test=develop (#19945)

expand_as_op_1
Zeng Jinle 5 years ago committed by GitHub
parent bdb3e376d0
commit 80e0f547bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);

Loading…
Cancel
Save