Jakub Jelinek - Re: [PATCH][RFC][OpenMP] Forbid target* pragmas in target regions (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: Jakub Jelinek
- To: Ilya Verbin
- Cc: gcc-patches at gcc dot gnu dot org, Kirill Yukhin , Thomas Schwinge
- Date: Mon, 2 Feb 2015 13:15:34 +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>
- Reply-to: Jakub Jelinek
On Mon, Jan 12, 2015 at 12:22:44AM +0300, Ilya Verbin wrote:
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:
- To return an error at compile-time.
- To check at run-time in libgomp whether GOMP_target* is called on target, and perform target-fallback if so.
If we will select option #1, the patch is ready.
Option #1 is just wrong. There is nothing wrong with such constructs appearing in #pragma omp declare target functions etc., the problem is if you hit them at runtime. You can very well have say #pragma omp declare target function, that optionally invokes #pragma omp target region e.g. based on its parameters, state of global variables, what other functions return etc. - and the program can be written so that that condition just never happens if the function is already offloaded.
Jakub
- Follow-Ups:
- Re: [PATCH][RFC][OpenMP] Forbid target* pragmas in target regions
* From: Ilya Verbin
- Re: [PATCH][RFC][OpenMP] Forbid target* pragmas in target regions
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |