Replace Do Loop By Forall

Description:  This refactoring is used to substitute DO loops by FORALL, when you have only assignments in the loop body. The user selects the loop to be replaced, and if the loop does not meet the requirements to be a FORALL the operation is aborted. Thus it is possible to have a performance gain in the execution of the application if you are using a parallel platform, as the FORALL makes automatic parallelization of execution of the instructions of your body.

State: Implemeted         Author: Gustavo Rissetti      Version:   Photran 8.0

Code Example:

Program Main
     integer vector(10)

    do i = 1,10
        vector(i) =i
     end do

end program
   
Program Main
     integer vector(10)

    forall (i=1:10)
        vector(i) =i
     end forall

end program

ScreenShots

      

HTML Comment Box is loading comments...