[SYCL] Fast launch of kernels that have no dependencies #4188
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.
This patch aims to reduce the time for the specific case when the kernel doesn't have any dependencies.
If the kernel doesn't use accessors, then the vector
MRequirements
is empty.If the kernel doesn't depend on other events, then the vector
MEvents
is empty.In most cases this is the kernel that uses USM memory only, for such cases, the patch is intended.
Since the vectors
MRequirements
andMEvents
are empty forExecCGCommand
,ExecCGCommand
of such kernel doesn't affect the command graph and is not added as a node.Since this command doesn't depend on the graph in any way, it can be safely executed independently, without going through the mechanism of placing it into the queue, which in this case is meaningless. Thus, the command can be executed instantly.
This significantly saves time that could be wasted in:
Here
printGraphAsDot
is useless because the graph isn't changed and this is used only to support the old behavior, and this can be removed if desired.Signed-off-by: Alexander Flegontov [email protected]