Skip to content

[SYCL][HIP] Support lowerWGScope and fix hip event #4951

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

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/SYCLLowerIR/LowerWGScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ GlobalVariable *spirv::createWGLocalVariable(Module &M, Type *T,
// Return a value equals to 0 if and only if the local linear id is 0.
Value *spirv::genPseudoLocalID(Instruction &Before, const Triple &TT) {
Module &M = *Before.getModule();
if (TT.isNVPTX()) {
if (TT.isNVPTX() || TT.isAMDGCN()) {
LLVMContext &Ctx = Before.getContext();
Type *RetTy = getSizeTTy(M);

Expand Down
17 changes: 17 additions & 0 deletions sycl/plugins/hip/pi_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,23 @@ pi_result _pi_event::start() {
return result;
}

bool _pi_event::is_completed() const noexcept {
if (!isRecorded_) {
return false;
}
if (!isCompleted_) {
const hipError_t ret = hipEventQuery(evEnd_);
if (ret != hipSuccess && ret != hipErrorNotReady) {
PI_CHECK_ERROR(ret);
return false;
}
if (ret == hipErrorNotReady) {
return false;
}
}
return true;
}

pi_uint64 _pi_event::get_queued_time() const {
float miliSeconds = 0.0f;
assert(is_started());
Expand Down
2 changes: 1 addition & 1 deletion sycl/plugins/hip/pi_hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ struct _pi_event {

bool is_started() const noexcept { return isStarted_; }

bool is_completed() const noexcept { return isCompleted_; };
bool is_completed() const noexcept;

pi_int32 get_execution_status() const noexcept {

Expand Down