ggml-omega
aien-dev/ggml-omega
Brought by drakestapleton
ggml-omega / kernels / scl.om
| 1 | note scl_@T@: d = x*s + b on @T@ f32 lanes (s, b f32 bits); b 0 gives the plain x*s of ggml_vec_scale_f32. |
| 2 | fn scl_@T@ x view f32 @T@ d edit f32 @T@ s ulong b ulong to void |
| 3 | sf = bitcast f32 uint s |
| 4 | bf = bitcast f32 uint b |
| 5 | for i ulong @T@ |
| 6 | v = mul get x i sf |
| 7 | if ne b 0 |
| 8 | v = add v bf |
| 9 | end |
| 10 | put d i v |
| 11 | end |
| 12 | end |