Skip to content

Commit

Permalink
Removed bad constraint that is not in sycl spec.
Browse files Browse the repository at this point in the history
There is no reason to not allow waits from native hip/cuda events in different sycl "contexts".

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
  • Loading branch information
JackAKirk committed Mar 1, 2024
1 parent 8499b57 commit 29ac4c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 2 additions & 6 deletions source/adapters/cuda/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventSetCallback(ur_event_handle_t,
UR_APIEXPORT ur_result_t UR_APICALL
urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) {
try {
auto Context = phEventWaitList[0]->getContext();
ScopedContext Active(Context);

auto WaitFunc = [Context](ur_event_handle_t Event) -> ur_result_t {
auto WaitFunc = [](ur_event_handle_t Event) -> ur_result_t {
UR_ASSERT(Event, UR_RESULT_ERROR_INVALID_EVENT);
UR_ASSERT(Event->getContext() == Context,
UR_RESULT_ERROR_INVALID_CONTEXT);
ScopedContext Active(Event->getQueue()->getDevice());

return Event->wait();
};
Expand Down
10 changes: 2 additions & 8 deletions source/adapters/hip/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,10 @@ ur_result_t ur_event_handle_t_::release() {
UR_APIEXPORT ur_result_t UR_APICALL
urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) {
UR_ASSERT(numEvents > 0, UR_RESULT_ERROR_INVALID_VALUE);

try {

auto Context = phEventWaitList[0]->getContext();
ScopedContext Active(phEventWaitList[0]->getDevice());

auto WaitFunc = [Context](ur_event_handle_t Event) -> ur_result_t {
auto WaitFunc = [](ur_event_handle_t Event) -> ur_result_t {
UR_ASSERT(Event, UR_RESULT_ERROR_INVALID_EVENT);
UR_ASSERT(Event->getContext() == Context,
UR_RESULT_ERROR_INVALID_CONTEXT);
ScopedContext Active(Event->getDevice());

return Event->wait();
};
Expand Down

0 comments on commit 29ac4c7

Please sign in to comment.