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
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
might as well use assumed-shaped arrays which stores the size of the arrays of the arguments:
SUBROUTINE example( a, b, result )
IMPLICIT NONE
INTEGER, INTENT(IN), contiguous :: a(:), b(:)
INTEGER, INTENT(OUT), contiguous :: result(:)
INTEGER :: i, lower, upper
lower = lbound( a, 1 )
upper = ubound( a, 1 )
! Array bounds should be specified
!$omp target map(to: a, b) map(from: result)
!$omp parallel do default(none) shared(a, b, result)
DO i = lower, upper
result(i) = a(i) + b(i)
END DO
!$omp end target
END SUBROUTINE example
Assumed-size arrays (the previous code) loses the lower bound, upper bound and size.
The text was updated successfully, but these errors were encountered:
Hi Wadud, thank you for your suggestion, we will consider extending PWD003 by covering assumed-size arrays as well as assumed-shaped arrays. We will keep you posted!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, the code example that uses assumed-size arrays:
https://github.com/codee-com/check-examples/blob/master/PWD003/example-omp.f90
might as well use assumed-shaped arrays which stores the size of the arrays of the arguments:
Assumed-size arrays (the previous code) loses the lower bound, upper bound and size.
The text was updated successfully, but these errors were encountered: