Load and validate the profile report JSON. Returns None on failure.
(path: str)
| 390 | # --------------------------------------------------------------------------- |
| 391 | |
| 392 | def load_profile_report(path: str) -> Optional[Dict[str, Any]]: |
| 393 | """Load and validate the profile report JSON. Returns None on failure.""" |
| 394 | if not os.path.exists(path): |
| 395 | return None |
| 396 | try: |
| 397 | with open(path, "r", encoding="utf-8") as f: |
| 398 | data = json.load(f) |
| 399 | return data |
| 400 | except (json.JSONDecodeError, IOError) as e: |
| 401 | print(f"ERROR: Failed to read profile report: {e}") |
| 402 | return None |
| 403 | |
| 404 | |
| 405 | def get_supported_kernels(report: Dict[str, Any]) -> List[Dict[str, Any]]: |