[SYCL] Record submit time for shortcut operations #18455
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We record submission time for commands submitted via handler, but this was missing for shortcut commands.
Also this PR changes the values returned by
command_submit
,command_start
,command_end
for non-host events without UR event handle - such events may appear if command is nop, for example, USM operations for 0 bytes.Such scenario is not explicitly specified in SYCL spec. Before changes, we used to return 0 for all three quieries. But for consistency,I believe it makes sense to return the same recorded submit time for all three:
command_submit = command_start = command_end
. It seems more convenient from user's perspective, for example if user submits sequence set of commands and there is some nop command in the middle of sequence:command1
command2 (nop)
command3
and user calculates wants to calculate differences between submission time (or start time) of
command2
andcommand1
, then he will get negative value:0 - submit_time_of_command2
(if we return0
).And there can be more nop operations (if SYCL runtime optimizes out something), so if we return
0
, user always has to check if the returned timestamp is 0 or not before using it in any calculations. So returning non-zero submit time seems better.