interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / gpu / runtime / apiplan.om

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