Skip to content
Snippets Groups Projects
Verified Commit f7de0957 authored by Yen-Chen Chen's avatar Yen-Chen Chen
Browse files

Restore present check for set_acc_host_or_device (!100)

The present check in the `set_acc_host_or_device` is heavily used in ICON and cannot be changed easily.
This problem comes from the discussion at https://gitlab.dkrz.de/icon/icon-mpim/-/merge_requests/563#note_276277


Revert the changes.

Approved-by: default avatarMarek Jacob <1129-b380572@users.noreply.gitlab.dkrz.de>
Merged-by: default avatarYen-Chen Chen <yen-chen.chen@kit.edu>
Changelog: bugfix
parent 0fa27b5c
No related branches found
No related tags found
No related merge requests found
Pipeline #89052 passed
......@@ -2326,22 +2326,28 @@ CONTAINS
SUBROUTINE assert_acc_host_only(routine_name, lacc)
CHARACTER(len=*), INTENT(IN) :: routine_name
LOGICAL, INTENT(IN) :: lacc
LOGICAL, INTENT(IN), OPTIONAL :: lacc
#ifdef _OPENACC
IF (lacc) THEN
CALL finish(routine_name, 'not supported on ACC device.')
IF (PRESENT(lacc)) THEN
IF (lacc) THEN
CALL finish(routine_name, ' not supported on ACC device.')
END IF
END IF
#endif
END SUBROUTINE assert_acc_host_only
SUBROUTINE assert_acc_device_only(routine_name, lacc)
CHARACTER(len=*), INTENT(IN) :: routine_name
LOGICAL, INTENT(IN) :: lacc
LOGICAL, INTENT(IN), OPTIONAL :: lacc
#ifdef _OPENACC
IF (.NOT. lacc) THEN
CALL finish(routine_name, 'not supported in ACC host mode.')
IF (.NOT. PRESENT(lacc)) THEN
CALL finish(routine_name, ' must not be called without lacc.')
ELSE
IF (.NOT. lacc) THEN
CALL finish(routine_name, ' not supported in ACC host mode.')
END IF
END IF
#endif
END SUBROUTINE assert_acc_device_only
......@@ -2361,11 +2367,13 @@ CONTAINS
PURE SUBROUTINE set_acc_host_or_device(lzacc, lacc)
LOGICAL, INTENT(OUT) :: lzacc
LOGICAL, INTENT(IN) :: lacc
LOGICAL, INTENT(IN), OPTIONAL :: lacc
lzacc = .FALSE.
#ifdef _OPENACC
lzacc = lacc
IF (PRESENT(lacc)) THEN
lzacc = lacc
END IF
#endif
END SUBROUTINE set_acc_host_or_device
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment