-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Fix depends_on with default-constructed events #6630
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
[SYCL] Fix depends_on with default-constructed events #6630
Conversation
Using depends_on with default constructed events caused commands to incorrectly expect the events to have associated PI events. Since default-constructed events are automatically considered finished, they can be ignored if they do not have an associated native event. These changes allows commands to ignore uninitialized events in dependency events. Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
/verify with intel/llvm-test-suite#1172 |
Can't they be un-signaled/reset before appearing in the dependencies to other commands? |
They could be associated with a PI event after this, if that is what you're thinking of. However, this event would be set to completed immediately, as is the SYCL 2020 behavior of default-constructed events. Do you think that would be a problem? |
My thinking is that even if it is constructed immediately completed, it is not necessarily so throughout its lifetime, and then it cannot be ignored. |
The default-constructed event should only be used by the user and not inside the runtime. From a user's perspective it should not ever have another underlying event than one that is trivially complete. We do run the risk of someone inadvertently using the default-constructor event in the runtime in the future. If they try to set the handle-ref of one that is not fully initialized, then this could become a problem. An option for avoiding this would be to have an assert in the non-const |
Could you point to the SYCL spec that is saying so? |
In 4.6.6 it specifies that for the only user-facing event constructor:
I do not see how the user could use the created event in a way that will change this. |
I think we should at least force this somehow. What does get_native() call on such an event? |
Either way, once |
I don't think you can change the status by SYCL API directly, but one could use get_native() and reset the underlying L0 native event handle with a direct L0 API.
I think this resolves my concern. |
Using depends_on with default constructed events caused commands to incorrectly expect the events to have associated PI events. Since default-constructed events are automatically considered finished, they can be ignored if they do not have an associated native event. These changes allows commands to ignore uninitialized events in dependency events.