-
Notifications
You must be signed in to change notification settings - Fork 30
Initial stubs for the error handling overhaul. #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
89f994b
to
daaec1a
Compare
7c75f5d
to
820ba1b
Compare
- A new DPCTLExecState type and associated constructors and destructors are added. - The error_handler_callback is depracated and is superseded by the new error_handler_callback_fn type. The new function type allows passing in both an error code and an error message. - A default error handler function is defined that will print out an error code and optionally an associated error message, file name, func name, line number to std::cerr. - Renamed the dpctl_async_error_handler.{h|cpp} files to dpctl_error_handlers to include an implementation of the default error handler.
820ba1b
to
a592ba8
Compare
@oleksandr-pavlyk I force-pushed again as I cleaned up the interface a bit. Here on, we can have a clean commit log and then chose to squash as desired before merging. I have modified a single function in the |
return nullptr; | ||
} | ||
try { | ||
auto CopiedDevice = new device(*Device); | ||
return wrap(CopiedDevice); | ||
} catch (std::bad_alloc const &ba) { | ||
// \todo log error | ||
std::cerr << ba.what() << '\n'; | ||
handler(-1, ba.what(), __FILE__, __func__, __LINE__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was not aware of __func__
. Cool!
@oleksandr-pavlyk The handler needs to be passed through both error code and error category if we want to properly work with SYCL exceptions. The current design is not quite up to that need. |
* @brief Convenience macro to add deprecation attributes to functions. | ||
* | ||
*/ | ||
#define DEPRACATION_NOTICE(notice, FN) notice " " #FN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define DEPRACATION_NOTICE(notice, FN) notice " " #FN | |
#define DEPRECATION_NOTICE(notice, FN) notice " " #FN |
Subsumed by #683 |
Fixes #35
Does not contain all the changes, more is coming. As of now I only added a new class to capture an "execution state" that for now is just an error handler. The next set of changes will include updating the API of all interfaces.
Fixes #330
Since we are changing the functions anyway, might as well implement the new naming convention proposed in #330.