While working on PR #3213 I encountered the following loop that I thought DependencyTools would be able to parallelise, but was surprised to find it couldn't:
module subroutine_example
contains
subroutine main()
integer :: i
real :: re_m(10)
real :: im_m(10)
do i = 1, 10
call sub(re_m(i), im_m(i))
end do
end subroutine
pure subroutine sub(a, b)
real, intent(inout) :: a
real, intent(inout) :: b
end subroutine
end module
Here's a small PSyclone script to try to parallelise it:
from psyclone.psyir.transformations import OMPLoopTrans, TransformationError
from psyclone.psyir.nodes import Loop, Routine
def trans(psyir):
for loop in psyir.walk(Loop):
OMPLoopTrans(omp_directive="paralleldo").apply(loop)
@hiker may be interested in this.