On Sun, Sep 4, 2011 at 10:47 AM, Tobias Burnus <bur...@net-b.de> wrote:
> Hi,
>
> Fortran 2008 has a do concurrent construct, where the programmer guarantees
> that the result is independent of the order; e.g.
>  do concurrent (i = 1:10:2)  ! from, to, step/stride
>     A(i) = sin(B(i))
>  end do
> can be run as i = 1, 3, 5, 7, 9; in any permutation or in parallel.
>
> The plan is to translate it as normal loop; however, it would be useful if
> this non-order-dependence could be used by the middle end (general
> optimization or at least for -floop-parallelize-all /
> -ftree-parallelize-loops). Is there a way to tell the middle-end about this
> property?

Other than inserting OMP directives no, there is no way at the moment.
If middle-end arrays materialize you could translate the loop back to
array form.

Richard.

> Tobias
>
> PS: By default, do concurrent loops will run consecutively, but I was
> thinking of optionally using OpenMP parallelization for those by explicitly
> adding an OMP directive. The do-concurrent parsing/resolving patch is at
> http://gcc.gnu.org/ml/fortran/2011-09/msg00002.html. The tree-generating
> part still needs to be written, but should be simple (for the serial case).
>

Reply via email to