2017-05-24 Thomas Schwinge <thomas@codesourcery.com>
+ * openacc_lib.h (acc_pcopyin, acc_pcreate): Route to
+ acc_present_or_copyin and acc_present_or_create procedures,
+ respectively.
+ * testsuite/libgomp.oacc-fortran/lib-32-1.f: Exercise these, and
+ generally different variants of OpenACC Runtime Library functions.
+ * testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.
+
* testsuite/libgomp.oacc-fortran/lib-32-1.f: New file.
* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.
end interface
interface acc_pcopyin
- subroutine acc_pcopyin_32_h (a, len)
- use iso_c_binding, only: c_int32_t
- !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
- type (*), dimension (*) :: a
- integer (c_int32_t) len
- end subroutine
-
- subroutine acc_pcopyin_64_h (a, len)
- use iso_c_binding, only: c_int64_t
- !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
- type (*), dimension (*) :: a
- integer (c_int64_t) len
- end subroutine
-
- subroutine acc_pcopyin_array_h (a)
- type (*), dimension (..), contiguous :: a
- end subroutine
+ procedure :: acc_present_or_copyin_32_h
+ procedure :: acc_present_or_copyin_64_h
+ procedure :: acc_present_or_copyin_array_h
end interface
interface acc_create
end interface
interface acc_pcreate
- subroutine acc_pcreate_32_h (a, len)
- use iso_c_binding, only: c_int32_t
- !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
- type (*), dimension (*) :: a
- integer (c_int32_t) len
- end subroutine
-
- subroutine acc_pcreate_64_h (a, len)
- use iso_c_binding, only: c_int64_t
- !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
- type (*), dimension (*) :: a
- integer (c_int64_t) len
- end subroutine
-
- subroutine acc_pcreate_array_h (a)
- type (*), dimension (..), contiguous :: a
- end subroutine
+ procedure :: acc_present_or_create_32_h
+ procedure :: acc_present_or_create_64_h
+ procedure :: acc_present_or_create_array_h
end interface
interface acc_copyout
! acc_map_data: Only available in C/C++
! acc_unmap_data: Only available in C/C++
! acc_deviceptr: Only available in C/C++
- ! acc_ostptr: Only available in C/C++
+ ! acc_hostptr: Only available in C/C++
interface acc_is_present
function acc_is_present_32_h (a, len)
SHARED_MEM = ACC_IS_PRESENT (H)
- CALL ACC_PRESENT_OR_CREATE (H)
- IF (.NOT. ACC_IS_PRESENT (H)) CALL ABORT
+ CALL ACC_PRESENT_OR_CREATE (H, INT (SIZEOF (H), 4))
+ IF (.NOT. ACC_IS_PRESENT (H, INT (SIZEOF (H), 8))) CALL ABORT
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 4
END DO
-! CALL ACC_PCREATE (H)
- CALL ACC_PRESENT_OR_CREATE (H)
+ CALL ACC_PCREATE (H, INT (SIZEOF (H), 4))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 6
END DO
- CALL ACC_PRESENT_OR_COPYIN (H)
+ CALL ACC_PRESENT_OR_COPYIN (H, INT (SIZEOF (H), 8))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 8
END DO
-! CALL ACC_PCOPYIN (H)
- CALL ACC_PRESENT_OR_COPYIN (H)
+ CALL ACC_PCOPYIN (H, INT (SIZEOF (H), 4))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 10
END DO
- CALL ACC_COPYOUT (H)
+ CALL ACC_COPYOUT (H, INT (SIZEOF (H), 4))
IF (.NOT. SHARED_MEM) THEN
- IF (ACC_IS_PRESENT (H)) CALL ABORT
+ IF (ACC_IS_PRESENT (H, INT (SIZEOF (H), 8))) CALL ABORT
ENDIF
DO I = 1, N
IF (H(I) .NE. I + MERGE (10, 9, SHARED_MEM)) CALL ABORT
END DO
-! CALL ACC_PCOPYIN (H)
- CALL ACC_PRESENT_OR_COPYIN (H)
- IF (.NOT. ACC_IS_PRESENT (H)) CALL ABORT
+ CALL ACC_PCOPYIN (H)
+ IF (.NOT. ACC_IS_PRESENT (H, INT (SIZEOF (H), 4))) CALL ABORT
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 12
END DO
-! CALL ACC_PCOPYIN (H)
- CALL ACC_PRESENT_OR_COPYIN (H)
+ CALL ACC_PCOPYIN (H, INT (SIZEOF (H), 8))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 14
END DO
-! CALL ACC_PCREATE (H)
- CALL ACC_PRESENT_OR_CREATE (H)
+ CALL ACC_PCREATE (H)
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 16
END DO
-! CALL ACC_PCREATE (H)
- CALL ACC_PRESENT_OR_CREATE (H)
+ CALL ACC_PCREATE (H, INT (SIZEOF (H), 8))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 18
END DO
- CALL ACC_UPDATE_SELF (H)
- IF (.NOT. ACC_IS_PRESENT (H)) CALL ABORT
+ CALL ACC_UPDATE_SELF (H, INT (SIZEOF (H), 4))
+ IF (.NOT. ACC_IS_PRESENT (H, INT (SIZEOF (H), 8))) CALL ABORT
DO I = 1, N
IF (H(I) .NE. I + MERGE (18, 17, SHARED_MEM)) CALL ABORT
CALL ACC_DELETE (H)
IF (.NOT. SHARED_MEM) THEN
- IF (ACC_IS_PRESENT (H)) CALL ABORT
+ IF (ACC_IS_PRESENT (H, INT (SIZEOF (H), 4))) CALL ABORT
ENDIF
DEALLOCATE (H)
SHARED_MEM = ACC_IS_PRESENT (H)
- CALL ACC_PRESENT_OR_CREATE (H)
- IF (.NOT. ACC_IS_PRESENT (H)) CALL ABORT
+ CALL ACC_PRESENT_OR_CREATE (H, INT (SIZEOF (H), 4))
+ IF (.NOT. ACC_IS_PRESENT (H, INT (SIZEOF (H), 8))) CALL ABORT
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 4
END DO
- CALL ACC_PCREATE (H)
+ CALL ACC_PCREATE (H, INT (SIZEOF (H), 4))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 6
END DO
- CALL ACC_PRESENT_OR_COPYIN (H)
+ CALL ACC_PRESENT_OR_COPYIN (H, INT (SIZEOF (H), 8))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 8
END DO
- CALL ACC_PCOPYIN (H)
+ CALL ACC_PCOPYIN (H, INT (SIZEOF (H), 4))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 10
END DO
- CALL ACC_COPYOUT (H)
+ CALL ACC_COPYOUT (H, INT (SIZEOF (H), 4))
IF (.NOT. SHARED_MEM) THEN
- IF (ACC_IS_PRESENT (H)) CALL ABORT
+ IF (ACC_IS_PRESENT (H, INT (SIZEOF (H), 8))) CALL ABORT
ENDIF
DO I = 1, N
END DO
CALL ACC_PCOPYIN (H)
- IF (.NOT. ACC_IS_PRESENT (H)) CALL ABORT
+ IF (.NOT. ACC_IS_PRESENT (H, INT (SIZEOF (H), 4))) CALL ABORT
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 12
END DO
- CALL ACC_PCOPYIN (H)
+ CALL ACC_PCOPYIN (H, INT (SIZEOF (H), 8))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 16
END DO
- CALL ACC_PCREATE (H)
+ CALL ACC_PCREATE (H, INT (SIZEOF (H), 8))
!$ACC PARALLEL LOOP DEFAULT (PRESENT)
DO I = 1, N
H(I) = I + 18
END DO
- CALL ACC_UPDATE_SELF (H)
- IF (.NOT. ACC_IS_PRESENT (H)) CALL ABORT
+ CALL ACC_UPDATE_SELF (H, INT (SIZEOF (H), 4))
+ IF (.NOT. ACC_IS_PRESENT (H, INT (SIZEOF (H), 8))) CALL ABORT
DO I = 1, N
IF (H(I) .NE. I + MERGE (18, 17, SHARED_MEM)) CALL ABORT
CALL ACC_DELETE (H)
IF (.NOT. SHARED_MEM) THEN
- IF (ACC_IS_PRESENT (H)) CALL ABORT
+ IF (ACC_IS_PRESENT (H, INT (SIZEOF (H), 4))) CALL ABORT
ENDIF
DEALLOCATE (H)