-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
As noted in the README, the experimental support for the kernels directive currently produces empty target regions that need to be manually corrected. In the code I'm working with, it seems like it would be possible to map kernels to target enter/target exit regions instead. I think this transformation might be safer.
Original
subroutine foo(a, b, n)
implicit none
integer :: a(:)
integer :: b(:)
integer :: n
integer :: i
!$acc kernels copyin(a)
!$acc loop
do i=1,n
b(i) = a(i) + 1
enddo
!$acc end kernels
end subroutine fooMigrated
subroutine foo(a, b, n)
implicit none
integer :: a(:)
integer :: b(:)
integer :: n
integer :: i
!$omp target map(to:a)
!$omp end target
!$omp target teams loop
do i=1,n
b(i) = a(i) + 1
enddo
end subroutine fooExpected
subroutine foo(a, b, n)
implicit none
integer :: a(:)
integer :: b(:)
integer :: n
integer :: i
!$omp target enter data map(to:a)
!$omp target teams loop
do i=1,n
b(i) = a(i) + 1
enddo
!$omp end target teams loop
!$omp target exit data map(release:a)
end subroutine fooMetadata
Metadata
Assignees
Labels
No labels