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

Function dot_x4_kernel

engine/src/quant/dispatch.cpp:66–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64const DotKernel* dot_kernel(Type w, Arith a) noexcept { return dot_kernel(w, a, best_isa()); }
65
66const DotX4Kernel* dot_x4_kernel(Type w, Arith a, Isa max_isa) noexcept {
67#ifdef STRATA_QUANT_X86_TIERS
68 const DotX4Table tables[] = {avx512_dot_x4_table(), avx2_dot_x4_table()};
69 const DotX4Kernel* best = nullptr;
70 for (const DotX4Table& tb : tables) {
71 for (int i = 0; i < tb.n; ++i) {
72 const DotX4Kernel& k = tb.v[i];
73 if (k.weight == w && k.arith == a && (int) k.isa <= (int) max_isa && isa_ok(k.isa)) {
74 if (!best || (int) k.isa > (int) best->isa) best = &k;
75 }
76 }
77 }
78 return best;
79#else
80 (void) w; (void) a; (void) max_isa;
81 return nullptr;
82#endif
83}
84
85const DotX4Kernel* dot_x4_kernel(Type w, Arith a) noexcept { return dot_x4_kernel(w, a, best_isa()); }
86

Callers 6

gguf_dot_forFunction · 0.85
native_gu_rows_implFunction · 0.85
native_down_rows_implFunction · 0.85
bench_typeFunction · 0.85
verify_x4_typeFunction · 0.85

Calls 4

avx512_dot_x4_tableFunction · 0.85
avx2_dot_x4_tableFunction · 0.85
isa_okFunction · 0.70
best_isaFunction · 0.70

Tested by 2

bench_typeFunction · 0.68
verify_x4_typeFunction · 0.68