acc_stream_wait_event Subroutine

public subroutine acc_stream_wait_event(stream, event)

Fortran-wrapper for making a GPU compute stream wait on an event. Because of fortran circular dependency restriction this can not go into acc_stream.F

Arguments

TypeIntentOptionalAttributesName
type(acc_stream_type), intent(in) :: stream
type(acc_event_type), intent(in) :: event

Contents

Source Code


Source Code

   SUBROUTINE acc_stream_wait_event(stream, event)
      !! Fortran-wrapper for making a GPU compute stream wait on an event.
      !! Because of fortran circular dependency restriction this can not go into acc_stream.F

      TYPE(acc_stream_type), INTENT(IN) :: stream
      TYPE(acc_event_type), INTENT(IN)  :: event

#if ! defined (__DBCSR_ACC)
      MARK_USED(stream)
      MARK_USED(event)
      DBCSR_ABORT("__DBCSR_ACC not compiled in.")
#else
      INTEGER                                  :: istat
      TYPE(C_PTR)                              :: stream_cptr

      stream_cptr = acc_stream_cptr(stream)
      IF (.NOT. C_ASSOCIATED(event%cptr)) &
         DBCSR_ABORT("acc_stream_wait_event: event not allocated")
      IF (.NOT. C_ASSOCIATED(stream_cptr)) &
         DBCSR_ABORT("acc_stream_wait_event: stream not allocated")
      istat = acc_interface_stream_wait_event(stream_cptr, event%cptr)
      IF (istat /= 0) &
         DBCSR_ABORT("acc_stream_wait_event failed")
#endif
   END SUBROUTINE acc_stream_wait_event