Lunderberg commented on code in PR #16980: URL: https://github.com/apache/tvm/pull/16980#discussion_r1599038038
########## src/runtime/cuda/cuda_device_api.cc: ########## @@ -142,6 +142,24 @@ class CUDADeviceAPI final : public DeviceAPI { } void FreeDataSpace(Device dev, void* ptr) final { + if (std::uncaught_exceptions() && cudaPeekAtLastError() == cudaErrorIllegalAddress) { Review Comment: Should be minimal compared to the memory allocation/free itself. The exact implementation of `std::uncaught_exceptions()` is compiler-dependent, but it typically is implemented as a read of a static thread-local variable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org