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 / codegen / cg_budget.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Declared GPR launch budget. Zero result refuses budget; all-ones refuses zero threads. |
| 3 | fn cg_budget peak ulong decl ulong threads ulong to ulong |
| 4 | if eq threads 0 |
| 5 | ret 18446744073709551615 |
| 6 | end |
| 7 | if lt decl 64 |
| 8 | decl = ulong 64 |
| 9 | end |
| 10 | if or gt peak 128 or ne rem decl 8 0 lt decl add peak 2 |
| 11 | ret 0 |
| 12 | end |
| 13 | if gt mul decl threads 65536 |
| 14 | ret 0 |
| 15 | end |
| 16 | ret decl |
| 17 | end |