Event - Extensions#

oneAPI Level Zero Specification - Version 1.18.31

Event - Extension Functions#

zeEventQueryKernelTimestampsExt#

Added in version 1.6

ZE_APIEXPORT ze_result_t ZE_APICALL zeEventQueryKernelTimestampsExt(ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t *pCount, ze_event_query_kernel_timestamps_results_ext_properties_t *pResults)#

Query an event’s timestamp value on the host, with domain preference.

  • For collecting only kernel timestamps, the application must ensure the event was created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag.

  • For collecting synchronized timestamps, the application must ensure the event was created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps are also available from this type of event pool, but there is a performance cost.

  • The destination memory will be unmodified if the event has not been signaled.

  • The application may call this function from simultaneous threads.

  • The implementation of this function must be thread-safe.

  • The implementation must support ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME extension.

  • The implementation must return all timestamps for the specified event and device pair.

  • The implementation must return all timestamps for all sub-devices when device handle is parent device.

  • The implementation may return all timestamps for sub-devices when device handle is sub-device or may return 0 for count.

Parameters:
  • hEvent – [in] handle of the event

  • hDevice – [in] handle of the device to query

  • pCount – [in,out] pointer to the number of event packets available.

    • This value is implementation specific.

    • if *pCount is zero, then the driver shall update the value with the total number of event packets available.

    • if *pCount is greater than the number of event packets available, the driver shall update the value with the correct value.

    • Buffer(s) for query results must be sized by the application to accommodate a minimum of *pCount elements.

  • pResults – [in,out][optional][range(0, *pCount)] pointer to event query properties structure(s).

    • This parameter may be null when *pCount is zero.

    • if *pCount is less than the number of event packets available, the driver may only update *pCount elements, starting at element zero.

    • if *pCount is greater than the number of event packets available, the driver may only update the valid elements.

Returns:

Event - Extension Enums#

ze_event_query_kernel_timestamps_ext_flags_t#

Added in version 1.6

enum ze_event_query_kernel_timestamps_ext_flag_t#

Values:

enumerator ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_KERNEL#

Kernel timestamp results.

enumerator ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_SYNCHRONIZED#

Device event timestamps synchronized to the host time domain.

enumerator ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32#

Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_* ENUMs.

Event - Extension Structures#

ze_synchronized_timestamp_data_ext_t#

Added in version 1.6

struct ze_synchronized_timestamp_data_ext_t#

Kernel timestamp clock data synchronized to the host time domain.

Public Members

uint64_t kernelStart#

[out] start of kernel execution in nanoseconds, on the host time domain.

uint64_t kernelEnd#

[out] end of kernel execution in nanoseconds, on the host time domain.

ze_synchronized_timestamp_result_ext_t#

Added in version 1.6

struct ze_synchronized_timestamp_result_ext_t#

Synchronized kernel timestamp result.

Public Members

ze_synchronized_timestamp_data_ext_t global#

[out] wall-clock data; free running device clock when device was active,on the host time domain

ze_synchronized_timestamp_data_ext_t context#

[out] context specific active data; only includes clocks while context was actively executing on the device, on the host time domain