[Openmp-commits] [PATCH] D134845: [OpenMP][libomptarget] Emit runtime message when variable is incorrectly mapped to device

Michael Klemm via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 30 06:46:44 PDT 2022

mjklemm added a comment.

In D134845#3827023 <https://reviews.llvm.org/D134845#3827023>, @trws wrote:

> The message seems useful, accidentally putting x there rather than x[:0] like the user probably intended is likely to be a relatively common mistake unfortunately.  Would it be feasible to, when the message would be printed for a pointer-type variable, check if it's target is accessible and suggest the appropriate fix, or at least say "maybe you meant to use an array section, the array section target is valid"?  That would make it immensely easier for an lower experience user to take action on.

I would agree to that sentiment.  If the runtime can easily detect the issue and report, it should do so.  Just letting the code die with a SEGFAULT is certainly fun for folks who love to debug, but is not really productive.



More information about the Openmp-commits mailing list