This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomptarget] Remove error data member from AsyncInfoWrapperTy
ClosedPublic

Authored by kevinsala on Apr 11 2023, 9:51 AM.

Details

Summary

This patch removes the Err data member from the AsyncInfoWrapperTy class. Now the error is stored externally, in the caller side, and it is explicitly passed to the AsyncInfoWrapperTy::finalize() function as a reference.

Proposed by @ye-luo in D142850

Diff Detail

Event Timeline

kevinsala created this revision.Apr 11 2023, 9:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2023, 9:51 AM
kevinsala requested review of this revision.Apr 11 2023, 9:51 AM
This revision is now accepted and ready to land.Apr 11 2023, 10:47 AM
ye-luo added inline comments.Apr 12 2023, 9:10 PM
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
208

Could you remove the return?

kevinsala updated this revision to Diff 514635.Apr 18 2023, 6:47 AM

Updated patch removing the error return from AsyncInfoWrapperTy::finalize().

kevinsala marked an inline comment as done.Apr 18 2023, 6:48 AM
jhuber6 added inline comments.Apr 18 2023, 6:49 AM
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
208

We need to explicitly discard this error now, otherwise it will abort the program when its destructor is called.

kevinsala added inline comments.Apr 18 2023, 6:50 AM
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
208

But the error now is directly returned by each caller (e.g., GenericDeviceTy::dataSubmit()). Isn't that enough?

jhuber6 accepted this revision.Apr 18 2023, 6:53 AM
jhuber6 added inline comments.
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
208

Oh, I see this is a reference to an Error presumably someone else handles its destruction? Guess that's allowed. Didn't read it fully, sorry.