-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1400 from steffenlarsen/steffen/record_event
[UR][L0][CUDA][HIP] Add enqueue timestamp recording extension
- Loading branch information
Showing
41 changed files
with
1,027 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<% | ||
OneApi=tags['$OneApi'] | ||
x=tags['$x'] | ||
X=x.upper() | ||
%> | ||
|
||
.. _experimental-enqueue-timestamp-recording: | ||
|
||
================================================================================ | ||
Enqueue Timestamp Recording | ||
================================================================================ | ||
|
||
.. warning:: | ||
|
||
Experimental features: | ||
|
||
* May be replaced, updated, or removed at any time. | ||
* Do not require maintaining API/ABI stability of their own additions over | ||
time. | ||
* Do not require conformance testing of their own additions. | ||
|
||
|
||
Motivation | ||
-------------------------------------------------------------------------------- | ||
Currently, the only way to get timestamp information is through enabling | ||
profiling on a queue and retrieving the information from events coming from | ||
commands submitted to it. However, not all systems give full control of the | ||
queue construction to the programmer wanting the profiling information. To amend | ||
this, this extension adds the ability to enqueue a timestamp recording on any | ||
queue, with or without profiling enabled. This event can in turn be queried for | ||
the usual profiling information. | ||
|
||
|
||
API | ||
-------------------------------------------------------------------------------- | ||
|
||
Enums | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* ${x}_device_info_t | ||
* ${X}_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP | ||
|
||
* ${x}_command_t | ||
* ${X}_COMMAND_TIMESTAMP_RECORDING_EXP | ||
|
||
Functions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
* ${x}EnqueueTimestampRecordingExp | ||
|
||
Changelog | ||
-------------------------------------------------------------------------------- | ||
|
||
+-----------+------------------------+ | ||
| Revision | Changes | | ||
+===========+========================+ | ||
| 1.0 | Initial Draft | | ||
+-----------+------------------------+ | ||
|
||
|
||
Support | ||
-------------------------------------------------------------------------------- | ||
|
||
Adapters which support this experimental feature *must* return true for the new | ||
`${X}_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP` device info query. | ||
|
||
|
||
Contributors | ||
-------------------------------------------------------------------------------- | ||
|
||
* Steffen Larsen `steffen.larsen@intel.com <steffen.larsen@intel.com>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# | ||
# Copyright (C) 2024 Intel Corporation | ||
# | ||
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. | ||
# See LICENSE.TXT | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# See YaML.md for syntax definition | ||
# | ||
--- #-------------------------------------------------------------------------- | ||
type: header | ||
desc: "Intel $OneApi Unified Runtime Experimental APIs for enqueuing timestamp recordings" | ||
ordinal: "99" | ||
--- #-------------------------------------------------------------------------- | ||
type: enum | ||
extend: true | ||
typed_etors: true | ||
desc: "Extension enums to $x_device_info_t to support timestamp recordings." | ||
name: $x_device_info_t | ||
etors: | ||
- name: TIMESTAMP_RECORDING_SUPPORT_EXP | ||
value: "0x2018" | ||
desc: "[$x_bool_t] returns true if the device supports timestamp recording" | ||
--- #-------------------------------------------------------------------------- | ||
type: enum | ||
extend: true | ||
desc: "Command Type experimental enumerations." | ||
name: $x_command_t | ||
etors: | ||
- name: TIMESTAMP_RECORDING_EXP | ||
value: "0x2002" | ||
desc: Event created by $xEnqueueTimestampRecordingExp | ||
--- #-------------------------------------------------------------------------- | ||
type: function | ||
desc: "Enqueue a command for recording the device timestamp" | ||
class: $xEnqueue | ||
name: TimestampRecordingExp | ||
params: | ||
- type: $x_queue_handle_t | ||
name: hQueue | ||
desc: "[in] handle of the queue object" | ||
- type: bool | ||
name: blocking | ||
desc: | | ||
[in] indicates whether the call to this function should block until | ||
until the device timestamp recording command has executed on the | ||
device. | ||
- type: uint32_t | ||
name: numEventsInWaitList | ||
desc: "[in] size of the event wait list" | ||
- type: "const $x_event_handle_t*" | ||
name: phEventWaitList | ||
desc: | | ||
[in][optional][range(0, numEventsInWaitList)] pointer to a list of events that must be complete before the kernel execution. | ||
If nullptr, the numEventsInWaitList must be 0, indicating no wait events. | ||
- type: $x_event_handle_t* | ||
name: phEvent | ||
desc: | | ||
[in,out] return an event object that identifies this particular kernel execution instance. Profiling information can be queried | ||
from this event as if `hQueue` had profiling enabled. Querying `UR_PROFILING_INFO_COMMAND_QUEUED` or `UR_PROFILING_INFO_COMMAND_SUBMIT` | ||
reports the timestamp at the time of the call to this function. Querying `UR_PROFILING_INFO_COMMAND_START` or `UR_PROFILING_INFO_COMMAND_END` | ||
reports the timestamp recorded when the command is executed on the device. | ||
returns: | ||
- $X_RESULT_ERROR_INVALID_NULL_HANDLE | ||
- $X_RESULT_ERROR_INVALID_NULL_POINTER | ||
- $X_RESULT_ERROR_INVALID_EVENT_WAIT_LIST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.