On Fri, Dec 09, 2016 at 07:37:53AM -0800, Cesar Philippidis wrote:
> It was more so to point out that there were cases where OpenACC
> offloaded regions may not have omp target attributes. Referring back to
> case 2 in the original email:
> 
>   2. Nested offloaded regions inside 'omp declare target' functions do
>   not have 'omp target entrypoint' attributes either.
> 
> See the logic in omp-low.c:create_omp_child_function. Therefore,
> something like pr78027.f90 will not work. As I mentioned earlier, this
> probably should be a parser error. Looking back at the spec, it looks
> like omp declare target functions cannot have any nested omp target
> regions in them. A natural extension would be to error on acc parallel
> and kernels regions inside omp declare and omp target regions inside acc
> routines.

#pragma omp target is UB inside of target region, so it is e.g. fine to
turn it into __builtin_trap.  But, rejecting it is problematic.
Warning about it when lexically nested in another #pragma omp target
is fine, when nested in #pragma omp declare target is wrong:
Having a #pragma omp declare target function which contains
#pragma omp target can be valid, as long as you never call the function in
the target region, or as long as when executing that function in the target
region you never invoke the #pragma omp target in there.

        Jakub

Reply via email to