MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / compare_dump_direct

Function compare_dump_direct

tests/test_metal_python_ref_compare.cpp:296–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static 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
316static backend_run run_backend(const std::string & backend_name,
317 bool use_gpu,

Callers 1

run_backendFunction · 0.85

Calls 4

load_ref_f32Function · 0.85
shape_to_stringFunction · 0.85
compute_metricsFunction · 0.85
numelMethod · 0.45

Tested by

no test coverage detected