Skip to content

Commit 49e4765

Browse files
authored
Adding Record and Replay graph APIs (#445)
1 parent 8eb8312 commit 49e4765

4 files changed

Lines changed: 511 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<%
2+
import re
3+
from templates import helper as th
4+
%><%
5+
OneApi=tags['$OneApi']
6+
x=tags['$x']
7+
X=x.upper()
8+
%>
9+
:orphan:
10+
11+
.. _ZE_extension_record_replay_graph:
12+
13+
===================================
14+
Record and Replay Graph Extension
15+
===================================
16+
17+
API
18+
----
19+
20+
* Functions
21+
22+
23+
* ${x}GraphCreateExt
24+
* ${x}CommandListBeginGraphCaptureExt
25+
* ${x}CommandListBeginCaptureIntoGraphExt
26+
* ${x}CommandListIsGraphCaptureEnabledExt
27+
* ${x}CommandListEndGraphCaptureExt
28+
* ${x}CommandListGetGraphExt
29+
* ${x}GraphGetPrimaryCommandListExt
30+
* ${x}GraphSetDestructionCallbackExt
31+
* ${x}GraphInstantiateExt
32+
* ${x}CommandListAppendGraphExt
33+
* ${x}ExecutableGraphGetSourceGraphExt
34+
* ${x}GraphIsEmptyExt
35+
* ${x}GraphDumpContentsExt
36+
* ${x}ExecutableGraphDestroyExt
37+
* ${x}GraphDestroyExt
38+
39+
40+
* Enumerations
41+
42+
43+
* ${x}_record_replay_graph_ext_version_t
44+
* ${x}_record_replay_graph_ext_flags_t
45+
* ${x}_record_replay_graph_ext_dump_mode_t
46+
47+
48+
* Structures
49+
50+
51+
* ${x}_record_replay_graph_ext_properties_t
52+
* ${x}_record_replay_graph_ext_dump_desc_t
53+
54+
Record and Replay Graph
55+
~~~~~~~~~~~~~~~~~~~~~~~
56+
57+
This extension allows applications to capture append operations from immediate command lists into a graph, instantiate that graph, and replay it efficiently.
58+
59+
Applications can query support and capabilities using ${x}_record_replay_graph_ext_properties_t and ${x}_record_replay_graph_ext_flags_t. Captured graphs can be inspected with ${x}GraphDumpContentsExt, and ${x}_record_replay_graph_ext_dump_desc_t controls dump behavior.
60+
61+
Typical Flow
62+
~~~~~~~~~~~~
63+
64+
1. Create a graph with ${x}GraphCreateExt, or begin capture directly on an immediate command list with ${x}CommandListBeginGraphCaptureExt.
65+
2. Record append operations and optionally query capture state via ${x}CommandListIsGraphCaptureEnabledExt and ${x}CommandListGetGraphExt.
66+
3. End capture using ${x}CommandListEndGraphCaptureExt.
67+
4. Instantiate an executable graph with ${x}GraphInstantiateExt.
68+
5. Submit the executable graph using ${x}CommandListAppendGraphExt.
69+
6. Optionally dump graph contents with ${x}GraphDumpContentsExt.
70+
7. Destroy executable and recorded graph objects using ${x}ExecutableGraphDestroyExt and ${x}GraphDestroyExt.

scripts/core/common.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,33 @@ etors:
322322
- name: ERROR_ADDRESS_NOT_FOUND
323323
desc: "[Core] address not found within specified or current context"
324324
version: "1.14"
325+
- name: QUERY_TRUE
326+
desc: "[Core, Extension] query API returned true"
327+
version: "1.17"
328+
- name: QUERY_FALSE
329+
desc: "[Core, Extension] query API returned false"
330+
version: "1.17"
331+
- name: ERROR_INVALID_GRAPH
332+
desc: "[Core, Extension] graph object is invalid"
333+
version: "1.17"
334+
- name: ERROR_GRAPH_CAPTURE_UNSUPPORTED
335+
desc: "[Core, Extension] operation is not supported during graph capture"
336+
version: "1.17"
337+
- name: ERROR_GRAPH_CAPTURE_INVALIDATED
338+
desc: "[Core, Extension] operations failed and invalidated graph capture session"
339+
version: "1.17"
340+
- name: ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT
341+
desc: "[Core, Extension] operation failed because it would merge two graph capture sessions"
342+
version: "1.17"
343+
- name: ERROR_COMMAND_LIST_NOT_CAPTURING
344+
desc: "[Core, Extension] command list is not in graph capture mode"
345+
version: "1.17"
346+
- name: ERROR_GRAPH_UNJOINED_FORKS
347+
desc: "[Core, Extension] graph contains unjoined forks"
348+
version: "1.17"
349+
- name: ERROR_GRAPH_INTERNAL_EVENT
350+
desc: "[Core, Extension] operation failed because it uses a graph-internal counter-based event outside of the graph"
351+
version: "1.17"
325352
- name: ERROR_UNKNOWN
326353
value: "0x7ffffffe"
327354
desc: "[Core] unknown or internal error"
@@ -724,6 +751,14 @@ etors:
724751
desc: $x_validate_runtime_requirements_output_t
725752
version: "1.16"
726753
value: "0x00020046"
754+
- name: RECORD_REPLAY_GRAPH_EXT_PROPERTIES
755+
desc: $x_record_replay_graph_ext_properties_t
756+
version: "1.17"
757+
value: "0x00020047"
758+
- name: RECORD_REPLAY_GRAPH_EXT_DUMP_DESC
759+
desc: $x_record_replay_graph_ext_dump_desc_t
760+
version: "1.17"
761+
value: "0x00020048"
727762
--- #--------------------------------------------------------------------------
728763
type: enum
729764
desc: "External memory type flags"

scripts/core/event.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ etors:
140140
Indicates that event will contain timestamps converted to the host time domain
141141
Cannot be combined with $X_EVENT_COUNTER_BASED_FLAG_DEVICE_TIMESTAMP
142142
It is recommended to use this flag for most users that want to correlate timestamps from the host and device into a single timeline. For host timestamps see $xDeviceGetGlobalTimestamps.
143+
- name: GRAPH_EXTERNAL
144+
value: "$X_BIT(6)"
145+
desc: |
146+
Counter-based event is used for synchronization between recorded graph commands and commands submitted outside the graph (see $xGraphInstantiateExt in $X_RECORD_REPLAY_GRAPH_EXT_NAME for details).
147+
version: "1.17"
143148
--- #--------------------------------------------------------------------------
144149
type: enum
145150
desc: "Supported event sync mode flags"

0 commit comments

Comments
 (0)