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 / nvidia / om / dnn-rows / plan.om

34 lines · 620 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Shape rows,length,dtype,op,epsilon_bits. Plan input bytes,output bytes,rows,threads.
3fn dr_plan s view ulong 8 p edit ulong 16 to ulong
4for i ulong 16
5put p i 0
6end
7if or eq get s 0 0 gt get s 0 65535
8ret 1
9end
10if or eq get s 1 0 gt get s 1 65535
11ret 1
12end
13if or gt get s 2 2 gt get s 3 2
14ret 1
15end
16if ne get s 3 0
17if or lt get s 4 8388608 ge get s 4 2139095040
18ret 1
19end
20end
21n = mul get s 0 get s 1
22if gt n 1073741824
23ret 1
24end
25bytes = ulong 4
26if ne get s 2 0
27bytes = ulong 2
28end
29put p 0 mul n bytes
30put p 1 mul n 4
31put p 2 get s 0
32put p 3 32
33ret 0
34end