[Openmp-commits] [PATCH] D142850: [OpenMP][libomptarget] Do not rely on AsyncInfoWrapperTy's destructor to synchronize queue

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Apr 5 07:37:50 PDT 2023

ye-luo added inline comments.

Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:936
   Err = dataSubmitImpl(TgtPtr, HstPtr, Size, AsyncInfoWrapper);
-  return Err;
+  return AsyncInfoWrapper.finalize();
I feel bad keeping Err as a member of AsyncInfoWrapper.

dataSubmitImpl sees AsyncInfoWrapper and return Err which actually operates on the member of AsyncInfoWrapper.

second issue if error already happened, finalize attempts a synchronization and overwrites the member Err which is bad for both attempting synchronization and overwriting it when there is already an error.

Can we remove the member Err of AsyncInfoWrapper completely and do
AsyncInfoWrapper.finalize(Err); // if Err is already bad, skip synchronization.
return Err;



More information about the Openmp-commits mailing list