You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrust::system::cuda::free potentially throws an exception, which can lead to multiple exceptions in flight when this function is called from a destructor. This makes it impossible to do correct exception handling.
We should avoid throwing in functions named free or catch and swallow exceptions in destructors. Not sure what the right thing to do is.
The text was updated successfully, but these errors were encountered:
thrust::system::cuda::free should probably ignore the error returned by cudaFree.
cudaFree will report an error if 1. the error is already set or 2. the pointer given to cudaFree is invalid.
case 1: if the error is already set, the error has probably already been reported via an exception currently in flight.
case 2: if the pointer given to cudaFree is invalid, we can specify that the behavior is undefined, as does std::free.
So it probably makes sense to swallow errors inside of thrust::system::cuda::free. That way, we don't need to try to handle exceptions in every single destructor which may indirectly call this function.
thrust::system::cuda::free
potentially throws an exception, which can lead to multiple exceptions in flight when this function is called from a destructor. This makes it impossible to do correct exception handling.We should avoid throwing in functions named
free
or catch and swallow exceptions in destructors. Not sure what the right thing to do is.The text was updated successfully, but these errors were encountered: