Skip to content

Commit 10f99e8

Browse files
committed
Merge pull request #145 from drnikolaev/caffe-0.15-fix
Fix for OOM when CUB succeeds to free cache and reallocate
2 parents 19492ba + 2dfb3e7 commit 10f99e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/caffe/util/gpu_memory.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ void GPUMemoryManager::allocate(void** ptr, size_t size, cudaStream_t stream) {
8282
}
8383
// Retry once
8484
CUDA_CHECK(cub_allocator->DeviceAllocate(ptr, size, stream));
85-
// If retry succeeds we need to clean up last error
86-
cudaGetLastError();
8785
}
86+
// If retry succeeds we need to clean up last error
87+
cudaGetLastError();
8888
break;
8989
default:
9090
CUDA_CHECK(cudaMalloc(ptr, size));

0 commit comments

Comments
 (0)