[llvm-bugs] [Bug 47230] New: Question about several ordered directives in the single region

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 19 00:40:57 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47230

            Bug ID: 47230
           Summary: Question about several ordered directives in the
                    single region
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yangzh.fnst at cn.fujitsu.com
                CC: llvm-bugs at lists.llvm.org

Follow the Restrictions in OpenMP 5.0, 2.17.9:
During execution of an iteration of a worksharing-loop or a loop nest within a
worksharing-loop, simd, or worksharing-loop SIMD region, a thread must not
execute more than one ordered region corresponding to an ordered construct
without a depend clause.

I think the following case should be ok although several ordered directives in
the single region.

void work(int i) {}
void ordered_good(int n)
{
  int i;
#pragma omp for ordered
  for (i=0; i<n; i++) {
    if (i <= 10) {
      #pragma omp ordered
         work(i);
    }
    if (i > 10) {
      #pragma omp ordered
        work(i+1);
    }
  }
}

int main() {
    ordered_good(100);

    return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200819/6374bab1/attachment.html>


More information about the llvm-bugs mailing list