[PATCH] D91879: [Flang][OpenMP 4.5] Add semantic check for OpenMP Schedule Clause - chunk size

Yashaswini Hegde via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 04:12:42 PST 2020


yhegde added a comment.

In D91879#2424968 <https://reviews.llvm.org/D91879#2424968>, @kiranchandramohan wrote:

> I only saw the following one which puts some conditions for using the same assignment of logical iteration numbers to threads for two loops. If these conditions are not met it is just that the implementation can use a different assignment. Are you referring to something else?
>
> "A compliant implementation of the static schedule must ensure that the same assignment of logical iteration numbers to threads will be used in two loop regions if the following conditions are satisfied: 1) both loop regions have the same number of loop iterations, 2) both loop regions have the same value of chunk_size specified, or both loop regions have no chunk_size specified, 3) both loop regions bind to the same parallel region,

and 4) neither loop is associated with a SIMD construct. A data dependence between the same logical iterations in two such loops is guaranteed to be satisfied allowing safe use of the nowait clause."

Yes was referring to the 2), second one actually. So probably what check introduced in this patch is applicable as a semantic check. And I suppose the one which you  were suggesting - 
subroutine fn(a,b,c,N)

  integer :: i
  integer :: a(:), b(:), c(:)
  integer :: chunk
  !$omp parallel
  chunk = 1 + omp_get_thread_num()
  !$omp do schedule(static, chunk)
  do i=1,N
    a(i) = b(i) + c(i)
  end do
  !$omp end do
  !$omp end parallel

end subroutine

- can be done at runtime.  Also kindly suggest how I can go ahead with this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91879/new/

https://reviews.llvm.org/D91879



More information about the llvm-commits mailing list