import { arraysClose as p } from "../utilities/arrayClose.js";
async function d(c, o, n) {
  const u = n ?? ["cpu", "webgl", "webgpu"], t = [];
  for (const e of u)
    try {
      const r = await c(e);
      t.push({ backend: e, result: r, passed: !0 });
    } catch (r) {
      t.push({ backend: e, error: r.message, result: [], passed: !1 });
    }
  const s = await Promise.all(t), l = s[0].result;
  for (let e = 1; e < s.length; e++) {
    const r = s[e].result, a = p(l, r);
    s[e].passed = a <= (o ?? 1e-6), s[e].maxError = a;
  }
  return s;
}
export {
  d as default
};
