omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / gpu / nvidia / om / api / attn_args.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Attention-family launch records: address pairs followed by scalar words. |
| 3 | fn av_pack p view ulong 32 a edit uint 32 na ulong nw ulong to ulong |
| 4 | if or gt na 16 or gt nw 32 gt mul na 2 nw |
| 5 | ret 1 |
| 6 | end |
| 7 | for i ulong 32 |
| 8 | put a i uint 0 |
| 9 | end |
| 10 | for i ulong na |
| 11 | v = get p i |
| 12 | put a mul i 2 uint and v 4294967295 |
| 13 | put a add mul i 2 1 uint shr v 32 |
| 14 | end |
| 15 | for i ulong sub nw mul na 2 |
| 16 | v = get p add na i |
| 17 | v = and v 4294967295 |
| 18 | put a add mul na 2 i uint v |
| 19 | end |
| 20 | ret 0 |
| 21 | end |
| 22 |