intel / intel-application-migration-tool-for-openacc-to-openmp

OpenACC* to OpenMP* API assisting migration tool
BSD 3-Clause "New" or "Revised" License
32 stars 5 forks source link

OpenMP 5.1 tile construct #25

Open Lyphion opened 2 weeks ago

Lyphion commented 2 weeks ago

In OpenMP 5.1 the tile construct for loops was introduced to allow loop tiling. The structure is a bit different from OpenACC and not all compilers support it until now. Some implementation exist.

OpenACC:

!$acc parallel loop tile(BLOCK1,BLOCK2) independent
do j = 1, n
  do i = 1, n
    do k = 1, n
      c(i,j) = c(i,j)+a(i,k)*b(k,j)
    end do
  end do
end do

OpenMP:

!$omp target teams loop 
!$omp tile sizes(BLOCK1,BLOCK2)
do j = 1, n
  do i = 1, n
    do k = 1, n
      c(i,j) = c(i,j)+a(i,k)*b(k,j)
    end do
  end do
end do
!$omp end tile
!$omp end target teams loop

Is it possible to add the functionality for better and easier migration?

hservatg commented 1 week ago

Working on this. Will come back to you when I have some feedback.

hservatg commented 1 week ago

BTW -- just tested in our compilers. The tile construct currently works in ICPX but fails in IFX. I have filed a ticket to our compiler teams so that they take a look at it.

Lyphion commented 6 days ago

Thank for reporting the issue to your compiler team. I reported this issue (https://community.intel.com/t5/Intel-Fortran-Compiler/Internal-Compiler-Error-with-OpenMP-Offloading-and-loop-tiling/td-p/1600780) some weeks ago but didn't received any update on it yet.