-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Implement more verbose error handling. #4013
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
This ensures that no exception is silently ignored by sycl. This also includes API names and error codes in the error messages. Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
I am not sure it is a good idea to show PI API names to the user since they aren't documented anywhere. |
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.
LGTM if comments related to reportPIError
are fixed.
sycl/source/detail/program_impl.cpp
Outdated
@@ -362,7 +362,8 @@ void program_impl::create_cl_program_with_source(const std::string &Source) { | |||
} | |||
|
|||
if (Err != PI_SUCCESS) { | |||
Plugin.reportPiError(Err, "create_cl_program_with_source()"); | |||
std::string CallingFunction = "create_cl_program_with_source()"; | |||
Plugin.reportPiError(Err, CallingFunction); |
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's wrong with prev version?
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.
there were compile errors as std::string &
requires a lvalue
.
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.
Maybe use std::string_view?
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.
it is kind of ugly that you cannot pass C-string directly, either use string_view or just "const char*"
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.
agree. how about using std::string
instead of std::string &
? that will resolve the lvalue issue.
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.
This way there would be a copy made during the call. How about using "std::string &" but passing as string("bla-bla-bla")
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.
this didn't work either. i am using const char*
sycl/source/detail/program_impl.cpp
Outdated
@@ -362,7 +362,8 @@ void program_impl::create_cl_program_with_source(const std::string &Source) { | |||
} | |||
|
|||
if (Err != PI_SUCCESS) { | |||
Plugin.reportPiError(Err, "create_cl_program_with_source()"); | |||
std::string CallingFunction = "create_cl_program_with_source()"; | |||
Plugin.reportPiError(Err, CallingFunction); |
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.
it is kind of ugly that you cannot pass C-string directly, either use string_view or just "const char*"
This ensures that no exception is silently ignored by sycl. This
also includes API names and error codes in the error messages.
Signed-off-by: rehana begam [email protected]