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

refine system_allocator.cc, test=release/1.6 (#20805)

上级 828fbd57
...@@ -120,7 +120,16 @@ void* GPUAllocator::Alloc(size_t* index, size_t size) { ...@@ -120,7 +120,16 @@ void* GPUAllocator::Alloc(size_t* index, size_t size) {
gpu_alloc_size_ += size; gpu_alloc_size_ += size;
return p; return p;
} else { } else {
PADDLE_ENFORCE_NE(cudaGetLastError(), cudaSuccess); if (result == cudaErrorMemoryAllocation) {
result = cudaSuccess;
}
PADDLE_ENFORCE_CUDA_SUCCESS(result);
result = cudaGetLastError();
if (result == cudaErrorMemoryAllocation) {
result = cudaSuccess;
}
PADDLE_ENFORCE_CUDA_SUCCESS(result);
size_t avail, total; size_t avail, total;
platform::GpuMemoryUsage(&avail, &total); platform::GpuMemoryUsage(&avail, &total);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册