This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC][OpenMP] Forbid target* pragmas in target regions
- From: Martin Jambor <mjambor at suse dot cz>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Tue, 10 Feb 2015 11:16:22 +0100
- Subject: Re: [PATCH][RFC][OpenMP] Forbid target* pragmas in target regions
- Authentication-results: sourceware.org; auth=none
- References: <20150111212244 dot GD30445 at msticlxl57 dot ims dot intel dot com>
Hi,
On Mon, Jan 12, 2015 at 12:22:44AM +0300, Ilya Verbin wrote:
> Hi!
>
> Currently if a target* pragma appears within a target region, GCC successfully
> compiles such code (with a warning). But the binary fails at run-time, since it
> tries to call GOMP_target* functions on target.
>
> The spec says: "If a target, target update, or target data construct appears
> within a target region then the behavior is unspecified."
>
> I see 2 options to make the behavior more user-friendly:
> 1. To return an error at compile-time.
> 2. To check at run-time in libgomp whether GOMP_target* is called on target, and
> perform target-fallback if so.
>
What actually happens when an accelerator calls a libgomp function?
Is a target libgomp port invoked? If so, it should easily know it
runs on a target even without a run-time check, I suppose. Or do you
somehow bring that call back to the host?
Thanks,
Martin