-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang][openmp] complains about incorrect OpenMP reduction if variable is used before parallel block #70828
Labels
Comments
github-actions
bot
added
the
flang
Flang issues not falling into any other category
label
Oct 31, 2023
EugeneZelenko
added
flang:ir
and removed
flang
Flang issues not falling into any other category
labels
Oct 31, 2023
@llvm/issue-subscribers-flang-ir Author: None (aitap)
Originally reported at [R-package-devel](https://stat.ethz.ch/pipermail/r-package-devel/2023q4/009787.html) for 092b6c5, here's [the compilation log](http://web.archive.org/web/20231031154710/https://www.stats.ox.ac.uk/pub/bdr/clang17/frailtypack.log) and [the full source code](https://cran.r-project.org/src/contrib/Archive/frailtypack/frailtypack_3.5.0.tar.gz). Can also be reproduced for e107c94 (`main` at the time of writing).
I was able to reduce this to the following example: program main
implicit none
real :: sum = 0
integer :: i, n = 10
sum = sum + 1. ! <-- error here if followed by OpenMP reduction
!$OMP PARALLEL DO default(none) PRIVATE(i) SHARED(n) REDUCTION(+:sum) SCHEDULE(Dynamic,1)
do i=1,n
sum = sum + real(i)
end do
!$OMP END PARALLEL DO
print *, sum
end
|
Thank you. We are working on reduction handling and will come to this soon. |
kiranchandramohan
added
bug
Indicates an unexpected problem or unintended behavior
flang:openmp
labels
Oct 31, 2023
@llvm/issue-subscribers-bug Author: None (aitap)
Originally reported at [R-package-devel](https://stat.ethz.ch/pipermail/r-package-devel/2023q4/009787.html) for 092b6c5, here's [the compilation log](http://web.archive.org/web/20231031154710/https://www.stats.ox.ac.uk/pub/bdr/clang17/frailtypack.log) and [the full source code](https://cran.r-project.org/src/contrib/Archive/frailtypack/frailtypack_3.5.0.tar.gz). Can also be reproduced for e107c94 (`main` at the time of writing).
I was able to reduce this to the following example: program main
implicit none
real :: sum = 0
integer :: i, n = 10
sum = sum + 1. ! <-- error here if followed by OpenMP reduction
!$OMP PARALLEL DO default(none) PRIVATE(i) SHARED(n) REDUCTION(+:sum) SCHEDULE(Dynamic,1)
do i=1,n
sum = sum + real(i)
end do
!$OMP END PARALLEL DO
print *, sum
end
|
clementval
changed the title
flang complains about incorrect OpenMP reduction if variable is used before parallel block
[flang][openmp] complains about incorrect OpenMP reduction if variable is used before parallel block
Nov 3, 2023
This works now with #80019 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Originally reported at R-package-devel for 092b6c5, here's the compilation log and the full source code. Can also be reproduced for e107c94 (
main
at the time of writing).I was able to reduce this to the following example:
The text was updated successfully, but these errors were encountered: