This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Make isDone lightweight without calling synchronize
ClosedPublic

Authored by ye-luo on Feb 17 2023, 6:31 PM.

Details

Summary

~TaskAsyncInfoWrapperTy() calls isDone. With synchronize inside isDone, we need to handle the error return from synchronize in the destructor.
The consumers of TaskAsyncInfoWrapperTy, targetDataMapper and targetKernel, both call AsyncInfo.synchronize() before exiting.
For this reason in ~TaskAsyncInfoWrapperTy(), calling synchronize() via isDone() is redundant.
This patch removes synchronize() call inside isDone() and makes it a lightweight check.
__tgt_target_nowait_query needs to call synchronize() before checking isDone().

Diff Detail

Event Timeline

ye-luo created this revision.Feb 17 2023, 6:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 6:31 PM
ye-luo requested review of this revision.Feb 17 2023, 6:31 PM
Herald added a project: Restricted Project. · View Herald Transcript
jhuber6 accepted this revision.Feb 17 2023, 6:39 PM

The better solution, makes the error patch more explicit and removes a redundant sync. Thanks.

This revision is now accepted and ready to land.Feb 17 2023, 6:39 PM