| 157 | return "\n".join(lines) |
| 158 | |
| 159 | def run(self) -> None: |
| 160 | self.logger.info("Parsing GGML operation support files...") |
| 161 | self.parse_support_files() |
| 162 | |
| 163 | if not self.all_operations: |
| 164 | self.logger.error( |
| 165 | "No operations found. Make sure to run test-backend-ops support --output csv > docs/ops/file.csv first." |
| 166 | ) |
| 167 | return |
| 168 | |
| 169 | self.logger.info( |
| 170 | f"Found {len(self.all_operations)} operations across {len(self.all_backends)} backends" |
| 171 | ) |
| 172 | |
| 173 | self.logger.info("Generating markdown...") |
| 174 | markdown_content = self.generate_markdown() |
| 175 | |
| 176 | docs_dir = self.ggml_root / "docs" |
| 177 | docs_dir.mkdir(exist_ok=True) |
| 178 | |
| 179 | ops_file = docs_dir / self.output_filename |
| 180 | with open(ops_file, "w") as f: |
| 181 | f.write(markdown_content) |
| 182 | |
| 183 | self.logger.info(f"Generated: {ops_file}") |
| 184 | self.logger.info(f"Operations: {len(self.all_operations)}") |
| 185 | self.logger.info(f"Backends: {len(self.all_backends)}") |
| 186 | |
| 187 | |
| 188 | def main(): |