Skip to content

Commit 5ee2f88

Browse files
committed
Actually throw bad_alloc from cuda_cub::malloc.
Bug 2813126 Bug 2808654 Reviewed-by: Michał 'Griwes' Dominiak <[email protected]>
1 parent 6278b2e commit 5ee2f88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

thrust/system/cuda/detail/malloc_and_free.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void *malloc(execution_policy<DerivedPolicy> &, std::size_t n)
6363
if(status != cudaSuccess)
6464
{
6565
cudaGetLastError(); // Clear global CUDA error state.
66-
thrust::system::detail::bad_alloc(thrust::cuda_category().message(status).c_str());
66+
throw thrust::system::detail::bad_alloc(thrust::cuda_category().message(status).c_str());
6767
}
6868
#else
6969
result = thrust::raw_pointer_cast(thrust::malloc(thrust::seq, n));

0 commit comments

Comments
 (0)