MCPcopy Create free account
hub / github.com/Niko1221/Strata / checked_dot_kernel

Function checked_dot_kernel

engine/src/quant/selfcheck.cpp:176–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174bool selfcheck(const ActKernel& k, std::string* why) { return check_act(k, why); }
175
176const 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
202const ActKernel* checked_act_kernel(Type act, Arith a) noexcept {
203 const Isa top = best_isa();

Callers 2

mainFunction · 0.85
traitsFunction · 0.85

Calls 4

dot_kernelsFunction · 0.85
check_dotFunction · 0.85
isa_okFunction · 0.70
keyFunction · 0.70

Tested by 1

mainFunction · 0.68