| 174 | bool selfcheck(const ActKernel& k, std::string* why) { return check_act(k, why); } |
| 175 | |
| 176 | const DotKernel* checked_dot_kernel(Type w, Arith a) noexcept { |
| 177 | const DotKernel* v[16]; |
| 178 | const int n = dot_kernels(w, a, v, 16); |
| 179 | for (int i = 0; i < n; ++i) { |
| 180 | const DotKernel* k = v[i]; |
| 181 | if (!isa_ok(k->isa)) continue; |
| 182 | Verdicts& vd = verdicts(); |
| 183 | const uint64_t kk = key(0, w, a, k->isa); |
| 184 | bool known = false, ok = false; |
| 185 | { |
| 186 | std::lock_guard<std::mutex> lk(vd.mu); |
| 187 | for (auto& e : vd.v) |
| 188 | if (e.first == kk) known = true, ok = e.second; |
| 189 | } |
| 190 | if (!known) { |
| 191 | std::string why; |
| 192 | ok = check_dot(*k, &why); |
| 193 | if (!ok) std::fprintf(stderr, "strata: quant self-check failed, kernel dropped: %s\n", why.c_str()); |
| 194 | std::lock_guard<std::mutex> lk(vd.mu); |
| 195 | vd.v.emplace_back(kk, ok); |
| 196 | } |
| 197 | if (ok) return k; |
| 198 | } |
| 199 | return nullptr; |
| 200 | } |
| 201 | |
| 202 | const ActKernel* checked_act_kernel(Type act, Arith a) noexcept { |
| 203 | const Isa top = best_isa(); |