interplane.Get Omega
Read in your language

ggml-omega

aien-dev/ggml-omega

Brought by drakestapleton

branch main Branches Tags History

ggml-omega / kernels / bfs.om

11 lines · 443 bytes Raw Blame History
1note bfs_@T@: f32 -> two bf16 planes by truncation (the first two planes of CUDApp gemm_ex's bf16x3 split):
2note h = the top 16 bits of x, l = the top 16 bits of f32(x - f32(h)); for finite x, x - (h + l) < 2^-16 |x|.
3fn bfs_@T@ s view f32 @T@ h edit ushort @T@ l edit ushort @T@ to void
4for i ulong @T@
5x = get s i
6u = bitcast uint x
7r = sub x bitcast f32 and u 4294901760
8put h i ushort shr u 16
9put l i ushort shr bitcast uint r 16
10end
11end