Lines Matching refs:event
22 PetscErrorCode construct_(PetscEvent event) const noexcept in construct_()
25 PetscCall(PetscMemzero(event, sizeof(*event))); in construct_()
26 PetscCall(underlying().reset(event)); in construct_()
30 PetscErrorCode destroy_(PetscEvent event) const noexcept in destroy_()
33 PetscCall(underlying().reset(event)); in destroy_()
37 static PetscErrorCode reset_(PetscEvent event) noexcept in reset_() argument
40 if (auto &destroy = event->destroy) { in reset_()
41 PetscCall((*destroy)(event)); in reset_()
44 …PetscAssert(!event->data, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Event failed to destroy its data membe… in reset_()
45 event->dctx_id = 0; in reset_()
46 event->dctx_state = 0; in reset_()
47 event->dtype = PETSC_DEVICE_DEFAULT(); in reset_()
56 …ic PetscErrorCode PetscDeviceContextCreateEvent_Private(PetscDeviceContext dctx, PetscEvent *event) in PetscDeviceContextCreateEvent_Private() argument
60 PetscAssertPointer(event, 2); in PetscDeviceContextCreateEvent_Private()
61 PetscCall(event_pool.allocate(event)); in PetscDeviceContextCreateEvent_Private()
62 PetscCall(PetscDeviceContextGetDeviceType(dctx, &(*event)->dtype)); in PetscDeviceContextCreateEvent_Private()
63 PetscTryTypeMethod(dctx, createevent, *event); in PetscDeviceContextCreateEvent_Private()
67 static PetscErrorCode PetscEventDestroy_Private(PetscEvent *event) in PetscEventDestroy_Private() argument
70 PetscAssertPointer(event, 1); in PetscEventDestroy_Private()
71 if (*event) PetscCall(event_pool.deallocate(event)); in PetscEventDestroy_Private()
75 …tic PetscErrorCode PetscDeviceContextRecordEvent_Private(PetscDeviceContext dctx, PetscEvent event) in PetscDeviceContextRecordEvent_Private() argument
82 PetscAssertPointer(event, 2); in PetscDeviceContextRecordEvent_Private()
87 if ((id == event->dctx_id) && (state <= event->dctx_state)) PetscFunctionReturn(PETSC_SUCCESS); in PetscDeviceContextRecordEvent_Private()
92 if (PetscDefined(USE_DEBUG) && (event->dtype != PETSC_DEVICE_HOST)) { in PetscDeviceContextRecordEvent_Private()
96 …cCheck(event->dtype == dtype, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Event type %s does not match… in PetscDeviceContextRecordEvent_Private()
98 PetscUseTypeMethod(dctx, recordevent, event); in PetscDeviceContextRecordEvent_Private()
100 event->dctx_id = id; in PetscDeviceContextRecordEvent_Private()
101 event->dctx_state = state; in PetscDeviceContextRecordEvent_Private()
105 …ic PetscErrorCode PetscDeviceContextWaitForEvent_Private(PetscDeviceContext dctx, PetscEvent event) in PetscDeviceContextWaitForEvent_Private() argument
109 PetscAssertPointer(event, 2); in PetscDeviceContextWaitForEvent_Private()
111 if (!event->data) PetscFunctionReturn(PETSC_SUCCESS); in PetscDeviceContextWaitForEvent_Private()
113 const auto etype = event->dtype; in PetscDeviceContextWaitForEvent_Private()
119 if (PetscObjectCast(dctx)->id == event->dctx_id) PetscFunctionReturn(PETSC_SUCCESS); in PetscDeviceContextWaitForEvent_Private()
120 PetscTryTypeMethod(dctx, waitforevent, event); in PetscDeviceContextWaitForEvent_Private()
227 PETSC_NODISCARD PetscEvent event() const noexcept { return event_; } in event() function in MarkedObjectMap::snapshot_type
234 …PetscAssertAbort(event(), PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Snapshot %s does not contain… in dctx_id()
235 PetscFunctionReturn(event()->dctx_id); in dctx_id()
301 PetscEvent event = nullptr; in init_event_() local
304 PetscCallAbort(PETSC_COMM_SELF, PetscDeviceContextCreateEvent_Private(dctx, &event)); in init_event_()
305 PetscCallAbort(PETSC_COMM_SELF, PetscDeviceContextRecordEvent_Private(dctx, event)); in init_event_()
306 PetscFunctionReturn(event); in init_event_()
376 for (auto &&dep : it.second.dependencies) (*dependencies)[i][j++] = dep.event(); in PetscGetMarkedObjectMap_Internal()
517 PetscCall(PetscDeviceContextRecordEvent_Private(dctx, it->event())); in MarkFromID_CompatibleModes()
524 …if (const auto event = marked.last_write.event()) PetscCall(PetscDeviceContextWaitForEvent_Private… in MarkFromID_CompatibleModes() local
539 if (last_dep.event()->dtype != dtype) { in MarkFromID_IncompatibleModes_UpdateLastWrite()
547 const auto last_write_was_also_us = last_write.event() && (last_write.dctx_id() == dctx_id); in MarkFromID_IncompatibleModes_UpdateLastWrite()
551 if (last_dep.event()->dctx_id != dctx_id) PetscCall(cxx_data->add_mark(id)); in MarkFromID_IncompatibleModes_UpdateLastWrite()
563 PetscCall(PetscDeviceContextRecordEvent_Private(dctx, last_dep.event())); in MarkFromID_IncompatibleModes_UpdateLastWrite()
583 …o &dep : object_dependencies) PetscCall(PetscDeviceContextWaitForEvent_Private(dctx, dep.event())); in MarkFromID_IncompatibleModes()