(name:str|TracingKey, device="TINY", display=True)
| 358 | cpu_events:list[ProfileEvent] = [] |
| 359 | @contextlib.contextmanager |
| 360 | def cpu_profile(name:str|TracingKey, device="TINY", display=True) -> Generator[ProfileRangeEvent, None, None]: |
| 361 | res = ProfileRangeEvent(device, name, perf_counter_us()) |
| 362 | try: yield res |
| 363 | finally: |
| 364 | res.en = perf_counter_us() |
| 365 | if PROFILE and display: cpu_events.append(res) |
| 366 | |
| 367 | def profile_marker(name:str, color="gray") -> None: |
| 368 | cpu_events.append(ProfilePointEvent("TINY", "marker", None, {"name":name, "color":color})) |
searching dependent graphs…