On Fri, Oct 17, 2014 at 06:58:17PM +0400, Ilya Verbin wrote:
> Here in the original test you have:
> 
>   #pragma omp target if (v <= 1)
>   if (omp_get_level () != 0 || (f && !omp_is_initial_device ()))
>     abort ();
>   #pragma omp target device (d) if (v <= 1)
>   if (omp_get_level () != 0 || (f && !omp_is_initial_device ()))
>     abort ();
> 
> There are 2 same if-statements, but target pragmas have different clauses.
> The second depends on device (d), and (f && !omp_is_initial_device ()) works
> fine.  But the first one doesn't depend on 'f', and if we have offload device,
> this check will fail.
> 
> So, to have this test working both with offloading and fallback, we need to
> remove all pragmas without device-clause.

Well, there is no need to remove them, just the " || (f && 
!omp_is_initial_device ())"
should be dropped from target regions without device (d) on them.
Where there is no f && guard, the condition should stay.
Do you agree?

        Jakub

Reply via email to