-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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]Variable used in TASK construct is not implicit firstprivate #64480
Comments
@llvm/issue-subscribers-openmp |
@llvm/issue-subscribers-flang-frontend |
@luporl Are you working on this from the Flang semantics perspective? Or are you working on the end to end flow. If you are working on the end to end flow then please read on, otherwise it is alrite. There are some issues in privatisation/firstprivatisation of tasks. Tasks can have delayed execution. So it is a bit different from the privatization of other constructs. Delayed execution can make things go out of scope. So for firstprivate the host variable from which the privatized variable inside the task should be initialized might have gone out of scope. I think Clang handles this by making a copy of the value and storing it along with task datastructure, and later use it to initialize the privatized variable. The OpenMPIRBuilder for task creates only a task datastructure (%struct.kmp_task_t). Clang creates a private structure along with it.
|
@kiranchandramohan I'm working on the end to end flow. With some changes in semantics and lowering, I was able to make some simple programs using task to firstprivatize implicit variables. But I wasn't aware of this issue with delayed execution. I must have been lucky in my testing so far. |
Yes, this is fine. |
Handle implicit firstprivate DSAs on task generating constructs. Fixes llvm#64480
Handle implicit firstprivate DSAs on task generating constructs. Fixes llvm#64480
Handle implicit firstprivate DSAs on task generating constructs. Fixes #64480
@llvm/issue-subscribers-flang-ir Author: None (ohno-fj)
```
Version of flang-new : 17.0.0(359f170)
```
Variable used in According to the following specification, the variable(a) in the test program is
The following are the test program, results of Flang-new, Gfortran and ifort compilation and execution. omp3_task_024_2.f90: program main
!$omp parallel
call sub()
!$omp end parallel
print *,"pass"
end program main
subroutine sub
integer::a
a=5
!$omp task
write(6,*) "1 a = ", a
if (a.eq.5) then
a=a+10
else
print *,"NG-1:a=",a
end if
write(6,*) "2 a = ", a
!$omp end task
!$omp taskwait
write(6,*) "3 a = ", a
if (a.ne.5) then
print *,"NG-2:a=",a
end if
end subroutine sub
|
Variable used in
TASK
construct is not implicitFIRSTPRIVATE
.According to the following specification, the variable(a) in the test program is
FIRSTPRIVATE
.The following are the test program, results of Flang-new, Gfortran and ifort compilation and execution.
omp3_task_024_2.f90:
The text was updated successfully, but these errors were encountered: