| 294 | } |
| 295 | |
| 296 | static metric_row compare_dump_direct(const std::string & name, |
| 297 | const std::string & got_path, |
| 298 | const std::string & ref_path) { |
| 299 | metric_row row; |
| 300 | auto got = load_ref_f32(got_path); |
| 301 | auto ref = load_ref_f32(ref_path); |
| 302 | row.tensor = name; |
| 303 | row.shape = shape_to_string(ref.shape); |
| 304 | |
| 305 | if (got.data.empty() || ref.data.empty()) { |
| 306 | row.note = "missing dump"; |
| 307 | return row; |
| 308 | } |
| 309 | if (got.numel() != ref.numel()) { |
| 310 | row.note = "numel mismatch"; |
| 311 | return row; |
| 312 | } |
| 313 | return compute_metrics(name, got.data.data(), ref.data.data(), ref.numel(), ref.shape); |
| 314 | } |
| 315 | |
| 316 | static backend_run run_backend(const std::string & backend_name, |
| 317 | bool use_gpu, |
no test coverage detected