Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
RAMitchell committed Oct 13, 2020
1 parent a97b042 commit a9d6135
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common/device_helpers.cuh
Expand Up @@ -412,10 +412,11 @@ struct XGBDefaultDeviceAllocatorImpl : XGBBaseDeviceAllocator<T> {
using other = XGBDefaultDeviceAllocatorImpl<U>; // NOLINT
};
pointer allocate(size_t n) { // NOLINT
pointer ptr = nullptr;
pointer ptr;
try {
ptr = SuperT::allocate(n);
} catch (const std::exception& e) {
dh::safe_cuda(cudaGetLastError());
} catch (const std::exception &e) {
ThrowOOMError(e.what(), n * sizeof(T));
}
GlobalMemoryLogger().RegisterAllocation(ptr.get(), n * sizeof(T));
Expand Down

0 comments on commit a9d6135

Please sign in to comment.