interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / components / cm_route.om

34 lines · 854 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Residual model routing and SHA block planning. Sizes are supplied by the C ABI shell.
3note Binary64 prediction, fit, tables and admission already live in cm_* units from CUDApp#291.
4fn cm_route mode ulong data edit ulong 16 to ulong
5if eq mode 0
6note SHA256 block cursor; floor division and remainder preserve every size_t input.
7nbytes = get data 0
8put data 1 div nbytes 64
9put data 2 rem nbytes 64
10put data 3 mul div nbytes 64 64
11ret 1
12end
13if eq mode 1
14note Blob body size is a sum of ABI object sizes, not a reimplementation of their layouts.
15total = ulong 0
16for i ulong 6
17total = add total get data i
18end
19ret total
20end
21if eq mode 2
22if lt get data 0 get data 1
23ret 1
24end
25ret 0
26end
27if eq mode 3
28ret add get data 0 get data 1
29end
30if eq mode 4
31ret sub get data 0 get data 1
32end
33ret 0
34end