mxnet
|
Error handling for C API. More...
Go to the source code of this file.
Namespaces | |
mxnet | |
namespace of mxnet | |
Macros | |
#define | MX_API_BEGIN() try { on_enter_api(__FUNCTION__); |
Macros to guard beginning and end section of all functions every function starts with API_BEGIN() and finishes with API_END() or API_END_HANDLE_ERROR() The finally clause contains procedure to cleanup states when an error happens. More... | |
#define | MX_API_END() } catch(dmlc::Error &_except_) { on_exit_api(); return MXAPIHandleException(_except_); } on_exit_api(); return 0; |
#define | MX_API_END_HANDLE_ERROR(Finalize) } catch(dmlc::Error &_except_) { Finalize; on_exit_api(); return MXAPIHandleException(_except_); } on_exit_api(); return 0; |
Functions | |
void | MXAPISetLastError (const char *msg) |
Set the last error message needed by C API. More... | |
int | MXAPIHandleException (const dmlc::Error &e) |
handle exception throwed out More... | |
void | mxnet::on_enter_api (const char *function) |
void | mxnet::on_exit_api () |
Error handling for C API.
Copyright (c) 2018 by Contributors
#define MX_API_BEGIN | ( | ) | try { on_enter_api(__FUNCTION__); |
Macros to guard beginning and end section of all functions every function starts with API_BEGIN() and finishes with API_END() or API_END_HANDLE_ERROR() The finally clause contains procedure to cleanup states when an error happens.
#define MX_API_END | ( | ) | } catch(dmlc::Error &_except_) { on_exit_api(); return MXAPIHandleException(_except_); } on_exit_api(); return 0; |
#define MX_API_END_HANDLE_ERROR | ( | Finalize | ) | } catch(dmlc::Error &_except_) { Finalize; on_exit_api(); return MXAPIHandleException(_except_); } on_exit_api(); return 0; |
|
inline |
handle exception throwed out
e | the exception |
void MXAPISetLastError | ( | const char * | msg | ) |
Set the last error message needed by C API.
msg | The error message to set. |