Skip to content

Commit c02fdfc

Browse files
jmahbszingo
andauthored
Arm backend: Improve chain handling (#15738)
Improve chain handling in Model Explorer visualise script. cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai Co-authored-by: Zingo Andersen <[email protected]>
1 parent 8c48a76 commit c02fdfc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/arm/visualize.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,20 @@ def is_end_of_command(qread_offset: int, end_idx: int) -> bool:
9595

9696
qread_offset = 4 * int(event["args"]["qread"])
9797

98+
while (cmd_index + chain_len <= queue_df_len - 1) and queue_df.iloc[
99+
cmd_index + chain_len
100+
]["scheduled_id"] in sub_ops:
101+
chain_len += 1
102+
98103
end_idx = cmd_index + chain_len
99104
if is_end_of_command(qread_offset, end_idx):
100105
end_ts = int(event["ts"]) - 1
101106
queue_df.loc[cmd_index, ["duration"]] = [
102107
end_ts - start_ts,
103108
]
104109
start_ts = end_ts
105-
cmd_index += chain_len
110+
cmd_index = end_idx
106111
chain_len = 1
107-
while (cmd_index + chain_len <= queue_df_len - 1) and queue_df.iloc[
108-
cmd_index + chain_len
109-
]["scheduled_id"] in sub_ops:
110-
chain_len += 1
111112

112113

113114
Agg = Union[str, Callable[[pd.Series], Any]]

0 commit comments

Comments
 (0)