vulkan: combine duplicated fastdiv functions, rename the one optimizing small divs (#27526)

* vulkan: combine duplicated fastdiv functions, rename the one optimizing small divs

* remove one more fastdiv
This commit is contained in:
Jeff Bolz
2026-08-29 10:59:48 +03:00
committed by GitHub
parent 5ea1b124e7
commit c9ca51c1f6
7 changed files with 24 additions and 53 deletions
@@ -19,6 +19,7 @@
#endif
#include "types.glsl"
#include "utils.glsl"
// shape notation: [dim(N), ..., dim(0)] -- stride(dim(j)) >= stride(dim(i)) if i > j
layout(binding = 0) readonly buffer A {
@@ -193,14 +194,6 @@ uint32_t Br = tid / BS_NPQ;
uint32_t Bc = tid % BS_NPQ;
const uint32_t BrpWg = WG_SIZE / BS_NPQ;
// see init_fastdiv_values in ggml-vulkan.cpp
uint fastdiv(uint n, uint mp, uint L) {
uint msbs, lsbs;
// msbs = mulhi(n, mp)
umulExtended(n, mp, msbs, lsbs);
return (msbs + n) >> L;
}
#ifdef COOPMAT2
#define ACC_TYPE float16_t