Start interactive session.
(self)
| 39 | self.cache_manager = CacheManager() |
| 40 | |
| 41 | def start(self): |
| 42 | """Start interactive session.""" |
| 43 | # ASCII banner |
| 44 | banner = """ |
| 45 | ██████╗ ██╗ ██████╗ ██╗ ██╗████████╗███╗ ██╗ ██████╗ ██╗ ██╗ |
| 46 | ██╔══██╗██║██╔════╝ ██║ ██║╚══██╔══╝████╗ ██║██╔═══██╗██║ ██║ |
| 47 | ██████╔╝██║██║ ███╗███████║ ██║ ██╔██╗ ██║██║ ██║██║ █╗ ██║ |
| 48 | ██╔══██╗██║██║ ██║██╔══██║ ██║ ██║╚██╗██║██║ ██║██║███╗██║ |
| 49 | ██║ ██║██║╚██████╔╝██║ ██║ ██║ ██║ ╚████║╚██████╔╝╚███╔███╔╝ |
| 50 | ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝ ╚══╝╚══╝ |
| 51 | """ |
| 52 | console.print(f"[bold cyan]{banner}[/bold cyan]") |
| 53 | console.print(f"[dim]CUDA Kernel Optimizer[/dim]") |
| 54 | console.print(f"[dim]📂 {self.current_dir}[/dim]") |
| 55 | console.print(f"[dim]Use ↑↓ arrows, Space to select, Enter to confirm[/dim]\n") |
| 56 | |
| 57 | while True: |
| 58 | try: |
| 59 | choice = self._show_main_menu() |
| 60 | if not choice: |
| 61 | continue |
| 62 | |
| 63 | if choice == "optimize": |
| 64 | self._optimize_workflow() |
| 65 | elif choice == "config": |
| 66 | self._show_config() |
| 67 | elif choice == "exit": |
| 68 | console.print("\n[cyan]👋 Goodbye![/cyan]\n") |
| 69 | break |
| 70 | |
| 71 | except KeyboardInterrupt: |
| 72 | console.print("\n") |
| 73 | break |
| 74 | except Exception as e: |
| 75 | console.print(f"\n[red]Error: {e}[/red]\n") |
| 76 | import traceback |
| 77 | traceback.print_exc() |
| 78 | |
| 79 | def _show_main_menu(self) -> Optional[str]: |
| 80 | """Main menu with arrow keys.""" |
no test coverage detected