diff --git a/src/hip_hcc.cpp b/src/hip_hcc.cpp index 8c47f54cf6..dcfdfb6137 100644 --- a/src/hip_hcc.cpp +++ b/src/hip_hcc.cpp @@ -2494,6 +2494,8 @@ namespace hip_impl { [[noreturn]] void hip_throw(const std::exception& ex) { #if defined(__cpp_exceptions) + if (auto rte = dynamic_cast(&ex)) throw *rte; + if (auto lge = dynamic_cast(&ex)) throw *lge; throw ex; #else std::cerr << ex.what() << std::endl;