Skip to content

Commit

Permalink
feature: events deadlock detection in validation layer
Browse files Browse the repository at this point in the history
Related-To: NEO-12810

Signed-off-by: Chandio, Bibrak Qamar <[email protected]>
  • Loading branch information
bibrak committed Nov 5, 2024
1 parent 64ebf67 commit a66309f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 40 deletions.
25 changes: 24 additions & 1 deletion source/layers/validation/checkers/events_deadlock/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ The checker creates an internal Directed Acyclic Graph (DAG) of dependencies bet
## API Implemented
### zeEventCreate
### zeEventDestroy
### zeCommandListAppendMemoryCopy
### zeCommandListAppendWriteGlobalTimestamp
### zeCommandListAppendBarrier
### zeCommandListAppendMemoryRangesBarrier
### zeCommandListAppendMemoryFill
### zeCommandListAppendMemoryCopyRegion
### zeCommandListAppendMemoryCopyFromContext
### zeCommandListAppendImageCopy
### zeCommandListAppendImageCopyRegion
### zeCommandListAppendImageCopyToMemory
### zeCommandListAppendImageCopyFromMemory
### zeCommandListAppendSignalEvent
### zeCommandListAppendWaitOnEvents
### zeEventHostSignal
### zeCommandListAppendEventReset
### zeEventHostReset
### zeCommandListAppendQueryKernelTimestamp
### zeCommandListAppendLaunchKernel
### zeCommandListAppendLaunchCooperativeKernel
### zeCommandListAppendMemoryCopy
### zeCommandListAppendLaunchKernelIndirect
### zeCommandListAppendLaunchMultipleKernelsIndirect
### zeCommandListUpdateMutableCommandSignalEventExp
### zeCommandListUpdateMutableCommandWaitEventsExp
### zeCommandListAppendImageCopyToMemoryExt
### zeCommandListAppendImageCopyFromMemoryExt
### zeCommandListImmediateAppendCommandListsExp
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,13 @@ eventsDeadlockChecker::~eventsDeadlockChecker() {
}
}

ze_result_t
eventsDeadlockChecker::ZEeventsDeadlockChecker::zeInitPrologue(
ze_init_flags_t flags) {

return ZE_RESULT_SUCCESS;
}

ze_result_t eventsDeadlockChecker::ZEeventsDeadlockChecker::zeEventCreatePrologue(ze_event_pool_handle_t hEventPool, const ze_event_desc_t *desc, ze_event_handle_t *phEvent) {

return ZE_RESULT_SUCCESS;
}
ze_result_t eventsDeadlockChecker::ZEeventsDeadlockChecker::zeEventCreateEpilogue(ze_event_pool_handle_t hEventPool, const ze_event_desc_t *desc, ze_event_handle_t *phEvent) {

eventToDagID[*phEvent] = invalidDagID;

return ZE_RESULT_SUCCESS;
}

ze_result_t
eventsDeadlockChecker::ZEeventsDeadlockChecker::zeEventDestroyPrologue(
ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy
) {

return ZE_RESULT_SUCCESS;
}

ze_result_t
eventsDeadlockChecker::ZEeventsDeadlockChecker::zeEventDestroyEpilogue(
ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy
Expand Down Expand Up @@ -93,22 +74,6 @@ eventsDeadlockChecker::ZEeventsDeadlockChecker::zeCommandListAppendMemoryCopyPro
return ZE_RESULT_SUCCESS;
}

ze_result_t
eventsDeadlockChecker::ZEeventsDeadlockChecker::zeCommandListAppendMemoryCopyEpilogue(
ze_command_list_handle_t hCommandList, ///< [in] handle of command list
void *dstptr, ///< [in] pointer to destination memory to copy to
const void *srcptr, ///< [in] pointer to source memory to copy from
size_t size, ///< [in] size in bytes to copy
ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion
uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0
///< if `nullptr == phWaitEvents`
ze_event_handle_t *phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait
///< on before launching
) {

return ZE_RESULT_SUCCESS;
}

ze_result_t
eventsDeadlockChecker::ZEeventsDeadlockChecker::zeCommandListAppendWriteGlobalTimestampPrologue(
ze_command_list_handle_t hCommandList, ///< [in] handle of the command list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ class __zedlllocal eventsDeadlockChecker : public validationChecker {

class ZEeventsDeadlockChecker : public ZEValidationEntryPoints {
public:
ze_result_t zeInitPrologue(ze_init_flags_t flags) override;
ze_result_t zeEventCreatePrologue(ze_event_pool_handle_t hEventPool, const ze_event_desc_t *desc, ze_event_handle_t *phEvent) override;
ze_result_t zeEventCreateEpilogue(ze_event_pool_handle_t hEventPool, const ze_event_desc_t *desc, ze_event_handle_t *phEvent) override;
ze_result_t zeEventDestroyPrologue(ze_event_handle_t hEvent) override;
ze_result_t zeEventDestroyEpilogue(ze_event_handle_t hEvent) override;
ze_result_t zeCommandListAppendMemoryCopyPrologue(ze_command_list_handle_t hCommandList, void *dstptr, const void *srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override;
ze_result_t zeCommandListAppendMemoryCopyEpilogue(ze_command_list_handle_t hCommandList, void *dstptr, const void *srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override;
ze_result_t zeCommandListAppendWriteGlobalTimestampPrologue(ze_command_list_handle_t hCommandList, uint64_t *dstptr, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override;
ze_result_t zeCommandListAppendBarrierPrologue(ze_command_list_handle_t hCommandList, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override;
ze_result_t zeCommandListAppendMemoryRangesBarrierPrologue(ze_command_list_handle_t hCommandList, uint32_t numRanges, const size_t *pRangeSizes, const void **pRanges, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) override;
Expand Down

0 comments on commit a66309f

Please sign in to comment.