-
Notifications
You must be signed in to change notification settings - Fork 407
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
Add file and line to error message #3985
Conversation
core/src/impl/Kokkos_Error.hpp
Outdated
@@ -47,6 +47,7 @@ | |||
|
|||
#include <string> | |||
#include <iosfwd> | |||
#include <cstdio> |
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.
What do we need stdio for?
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.
Good point, I have remove it.
"Kokkos contract violation:\n " \ | ||
" Expected precondition `" #__VA_ARGS__ "` evaluated false."); \ | ||
} \ | ||
#define KOKKOS_IMPL_STRINGIFY(x) #x |
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.
Is this the right header for KOKKOS_IMPL_STRINGIFY and KOKKOS_IMPL_TOSTRING?
(It might be, because this is the only place it is used, and we can always move it later if we need it again. I'm just asking.)
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.
I had the same dilemma when I wrote this. I've put that here since it's the only place it is used. If it's useful somewhere else later on we can always move it.
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.
Looks good to me.
Add file and line to error message from
KOKKOS_EXPECTS
,KOKKOS_ENSURES
, andKOKKOS_ASSERT
. This makes it a lot simpler to find where the error has been triggered from.