| 24 | } // namespace |
| 25 | |
| 26 | void MegBrainError::init() { |
| 27 | m_msg.append("\n"); |
| 28 | #if MGB_ENABLE_DEBUG_UTIL |
| 29 | debug::backtrace(2).fmt_to_str(m_msg); |
| 30 | static bool print_exc = MGB_GETENV("MGB_PRINT_EXC"); |
| 31 | if (print_exc) { |
| 32 | fprintf(stderr, "mgb: exception occurred: %s\n", m_msg.c_str()); |
| 33 | } |
| 34 | #endif |
| 35 | } |
| 36 | |
| 37 | CudaError::CudaError(const std::string& msg) : SystemError(msg) { |
| 38 | m_msg.append(get_cuda_extra_info()); |
no test coverage detected