Skip to content

Commit 9eb27d3

Browse files
author
malixian
authored
[SYCL] Support lowerWGScope and fix hip event (#4951)
1 parent 39056ea commit 9eb27d3

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

sycl/plugins/hip/pi_hip.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,23 @@ pi_result _pi_event::start() {
424424
return result;
425425
}
426426

427+
bool _pi_event::is_completed() const noexcept {
428+
if (!isRecorded_) {
429+
return false;
430+
}
431+
if (!isCompleted_) {
432+
const hipError_t ret = hipEventQuery(evEnd_);
433+
if (ret != hipSuccess && ret != hipErrorNotReady) {
434+
PI_CHECK_ERROR(ret);
435+
return false;
436+
}
437+
if (ret == hipErrorNotReady) {
438+
return false;
439+
}
440+
}
441+
return true;
442+
}
443+
427444
pi_uint64 _pi_event::get_queued_time() const {
428445
float miliSeconds = 0.0f;
429446
assert(is_started());

sycl/plugins/hip/pi_hip.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ struct _pi_event {
423423

424424
bool is_started() const noexcept { return isStarted_; }
425425

426-
bool is_completed() const noexcept { return isCompleted_; };
426+
bool is_completed() const noexcept;
427427

428428
pi_int32 get_execution_status() const noexcept {
429429

0 commit comments

Comments
 (0)