You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for atomic operations on scalar complex variables is being added in #92364.
flang also supports atomic operations which read a single element from an array. The openmp standard says that the lhs and rhs of the assignment must be "scalar variables of intrinsic type" (OpenMP 5.2 section 4.3.1.3). The result of the expression on the rhs must be scalar but the expression might involve arrays.
Currently (and after #92364) Flang will crash on an assertion on this code:
program atomic_array
complex :: x(2)
complex :: y
!$omp parallel
!$omp atomic read
y = x(1)
!$omp end parallel
end program
I tested out this issue. Seems like with #111377, the test case works correctly.
program atomic_array
complex :: x(2)
complex :: y
x(1) = (1.0, 1.0)
x(2) = (2.0, 2.0)
!$omp parallel
!$omp atomic read
y = x(1)
!$omp end parallel
print *, y
end program
Gives me (1. , 1.) if I test with #111377, which is ok.
However, there will still be issues with the following test case:
program atomic_array
complex :: x(2)
integer :: y
x(1) = (1.0, 1.0)
x(2) = (2.0, 2.0)
!$omp parallel
!$omp atomic read
y = x(1)
!$omp end parallel
print *, y
end program
Support for atomic operations on scalar complex variables is being added in #92364.
flang also supports atomic operations which read a single element from an array. The openmp standard says that the lhs and rhs of the assignment must be "scalar variables of intrinsic type" (OpenMP 5.2 section 4.3.1.3). The result of the expression on the rhs must be scalar but the expression might involve arrays.
Currently (and after #92364) Flang will crash on an assertion on this code:
Reproduce with
flang -fopenmp file.f90
.CC @NimishMishra
The text was updated successfully, but these errors were encountered: