[all-commits] [llvm/llvm-project] 8322fe: Adding support for target in_reduction

RitanyaB via All-commits all-commits at lists.llvm.org
Mon Jun 27 09:36:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8322fe200d60919bcf19700138f04f9fdc909360
      https://github.com/llvm/llvm-project/commit/8322fe200d60919bcf19700138f04f9fdc909360
  Author: Ritanya B Bharadwaj <ritanya-b.bharadwaj at hpe.com>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/Sema/SemaOpenMP.cpp
    A clang/test/OpenMP/target_in_reduction_codegen.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMP.td

  Log Message:
  -----------
  Adding support for target in_reduction

Implementing target in_reduction by wrapping target task with host task with in_reduction and if clause. This is in compliance with OpenMP 5.0 section: 2.19.5.6.
So, this

```
  for (int i=0; i<N; i++) {
    res = res+i
  }
```

will become

```

   #pragma omp task in_reduction(+:res) if(0)
   #pragma omp target map(res)
   for (int i=0; i<N; i++) {
     res = res+i
   }
```

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D125669




More information about the All-commits mailing list