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 / runtime / apiplan.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note gpu/runtime/apiplan.om: rewrite of CUDApp src/omega_api_plan.h (ap_plan and ap_om). One family number picks |
| 3 | note one of the six plan units of gpu/nvidia/om/components (0 api_mm_plan, 1 api_at_plan, 2 api_ew_plan, |
| 4 | note 3 api_bf_plan, 4 api_da_plan, 5 api_rt_plan); a[0..7] are its inputs and a[8..15] its outputs. The result is |
| 5 | note what the C returns to its caller: 0, or minus the plan's refusal 1..3; -1 for a family the C does not know |
| 6 | note or a refusal above 3. Composed after those six units. The C plans of the header (ap_c) are the old |
| 7 | note implementation kept as the reference; gpu/runtime/check/apiplan-check.om compares the two. |
| 8 | fn ap_plan f ulong mode ulong a edit ulong 16 to long |
| 9 | rc = ulong 4 |
| 10 | if eq f 0 |
| 11 | rc = api_mm_plan mode a |
| 12 | end |
| 13 | if eq f 1 |
| 14 | rc = api_at_plan mode a |
| 15 | end |
| 16 | if eq f 2 |
| 17 | rc = api_ew_plan mode a |
| 18 | end |
| 19 | if eq f 3 |
| 20 | rc = api_bf_plan mode a |
| 21 | end |
| 22 | if eq f 4 |
| 23 | rc = api_da_plan mode a |
| 24 | end |
| 25 | if eq f 5 |
| 26 | rc = api_rt_plan mode a |
| 27 | end |
| 28 | if le rc 3 |
| 29 | ret neg long rc |
| 30 | end |
| 31 | ret long -1 |
| 32 | end |