ggml-omega
aien-dev/ggml-omega
Brought by drakestapleton
ggml-omega / kernels / bin.om
| 1 | note bin_@T@: d = a op b on @T@ f32 lanes; op 0 add, 1 sub, 2 mul, 3 div (one rounding each, as ggml-cpu). |
| 2 | fn bin_@T@ op ulong a view f32 @T@ b view f32 @T@ d edit f32 @T@ to void |
| 3 | for i ulong @T@ |
| 4 | x = get a i |
| 5 | y = get b i |
| 6 | if eq op 0 |
| 7 | put d i add x y |
| 8 | else |
| 9 | if eq op 1 |
| 10 | put d i sub x y |
| 11 | else |
| 12 | if eq op 2 |
| 13 | put d i mul x y |
| 14 | else |
| 15 | put d i div x y |
| 16 | end |
| 17 | end |
| 18 | end |
| 19 | end |
| 20 | end |