Skip to content

Conversation

raaiq1
Copy link
Contributor

@raaiq1 raaiq1 commented Jul 25, 2022

The default constructed sycl::event would emit a misleading message when querying profiling information. The message would assume a queue is attached to such sycl::event, even if it's not the case. Added a condition to handle such case, and emit a more proper message, and updated appropriate unit test.

raaiq1 and others added 12 commits June 17, 2022 14:56
[SYCL][ABI-break] Remove kernel::get_work_group_info (intel#6414)
The default constructed sycl::event would emit a misleading message when querying profiling information.The message would assume a queue is attached to such sycl::event, even if it's not the case. Added a condition to handle such case, and emit a more proper message.

Signed-off-by: Rauf, Rana <[email protected]>
@raaiq1 raaiq1 requested a review from a team as a code owner July 25, 2022 21:40
@raaiq1 raaiq1 requested a review from v-klochkov July 25, 2022 21:40
Copy link
Contributor

@v-klochkov v-klochkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional field is added solely for the purpose of slightly more clear exception message....
I do not object, but also do not support the idea.
Would be useful to hear from @bader and @steffenlarsen

@v-klochkov v-klochkov requested review from a team, steffenlarsen and bader July 26, 2022 04:03
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clearer error message is definitely a great addition, but I think it can be done without the new member. Sadly we cannot base it on whether the weak_ptr has expired, as we could have an event for which the associated queue had profiling info but has since been destroyed. However, std::weak_ptr::owner_before specifies that

The order is such that two smart pointers compare equivalent only if they are both empty or if they both own the same object ...

Using this, we can determine if there was a (potentially now expired) queue associated with event. See https://godbolt.org/z/3v8144j1o for an example of this. Of the top of my head, the only potential problem I could see here would be if at some point reset is called on the weak_ptr, but I don't see why we would ever need that.

On a different note, could you please add a test-case to GetProfilingInfo for the new exception message?

@bader bader changed the title [SYCL] Improved sycl::event::get_profiling_info exception message if default constructed [SYCL] Improve sycl::event::get_profiling_info exception message if default constructed Jul 26, 2022
steffenlarsen
steffenlarsen previously approved these changes Jul 27, 2022
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Rauf, Rana <[email protected]>
raaiq1 added 5 commits August 3, 2022 06:45
The default constructed sycl::event would emit a misleading message when querying profiling information.The message would assume a queue is attached to such sycl::event, even if it's not the case. Added a condition to handle such case, and emit a more proper message.

Signed-off-by: Rauf, Rana <[email protected]>
Signed-off-by: Rauf, Rana <[email protected]>
@raaiq1
Copy link
Contributor Author

raaiq1 commented Aug 3, 2022

\verify with intel/llvm-test-suite#1120

@bader
Copy link
Contributor

bader commented Aug 3, 2022

I think it should be forward slash i.e. /verify, not \verify.

@raaiq1
Copy link
Contributor Author

raaiq1 commented Aug 3, 2022

Thanks for pointing that out

@raaiq1
Copy link
Contributor Author

raaiq1 commented Aug 3, 2022

/verify with intel/llvm-test-suite#1120

@raaiq1
Copy link
Contributor Author

raaiq1 commented Aug 3, 2022

/verify with intel/llvm-test-suite#1120

raaiq1 added 8 commits August 4, 2022 13:10
The default constructed sycl::event would emit a misleading message when querying profiling information.The message would assume a queue is attached to such sycl::event, even if it's not the case. Added a condition to handle such case, and emit a more proper message.

Signed-off-by: Rauf, Rana <[email protected]>
Signed-off-by: Rauf, Rana <[email protected]>
The default constructed sycl::event would emit a misleading message when querying profiling information.The message would assume a queue is attached to such sycl::event, even if it's not the case. Added a condition to handle such case, and emit a more proper message.

Signed-off-by: Rauf, Rana <[email protected]>
@raaiq1
Copy link
Contributor Author

raaiq1 commented Aug 10, 2022

@intel/llvm-gatekeepers ping to merge commit

@againull againull merged commit 2e86cd4 into intel:sycl Aug 10, 2022
@raaiq1 raaiq1 deleted the event_exception branch August 10, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants