[Flang][OpenMP] Support for scope construct
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Scope construct was introduced in OpenMP 5.1 and is not yet supported in Flang OpenMP. It is a structured block that every thread executes redundantly while also providing a dedicated environment for reductions, private variables, and synchronization.
Example:
```fortran
!$omp parallel private(thread_val)
! Each thread gets a unique value (its ID + 1)
thread_val = omp_get_thread_num() + 1
! The scope construct allows a reduction without a 'do' loop
!$omp scope reduction(+:total_sum)
total_sum = total_sum + thread_val
!$omp end scope
!$omp end parallel
```
Error:
```
llvm-project/flang/lib/Lower/OpenMP/OpenMP.cpp:2719: not yet implemented: Scope construct
LLVM ERROR: aborting
```
Contributor guide
Assessment
This issue has not been assessed yet.