Fortran-wrapper for querying a CUDA/HIP event's status.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(acc_event_type), | intent(in) | :: | this |
true if event has occurred, false otherwise
FUNCTION acc_event_query(this) RESULT(res) !! Fortran-wrapper for querying a CUDA/HIP event's status. TYPE(acc_event_type), INTENT(IN) :: this LOGICAL :: res !! true if event has occurred, false otherwise #if ! defined (__DBCSR_ACC) res = .FALSE. MARK_USED(this) DBCSR_ABORT("__DBCSR_ACC not compiled in.") #else INTEGER :: istat, has_occurred IF (.NOT. C_ASSOCIATED(this%cptr)) & DBCSR_ABORT("acc_event_query: event not allocated") CALL dbcsr_acc_set_active_device(get_accdrv_active_device_id()) istat = acc_interface_event_query(this%cptr, has_occurred) IF (istat /= 0) & DBCSR_ABORT("acc_event_query failed") res = (has_occurred == 1) #endif END FUNCTION acc_event_query