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 / pipeline / binding.om

103 lines · 2163 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Consume canonical launch; never reconstruct it from incumbent shape knobs.
3note call0kind1gemv2gemm,1M,2N,3K,4groups/segments,5argumentwords,6rowmap,7GEMVinputrows.
4note call8tensorallocationepoch,9currentsessionepoch,10immutableowner generation,11reservedzero.
5note out0..27 exact launch fields;28RG,29gridX*warps are private derived ABI metadata.
6note out is NOT canonical/hashable launch wire. This binding is NOT qualification.
7fn binding_owner call view ulong 12 to bool
8if ne get call 8 get call 9
9ret false
10end
11if eq get call 10 0
12ret false
13end
14ret eq get call 11 0
15end
16fn native_binding real view uchar 4096 launch view uchar 4096 call view ulong 12 out edit ulong 32 to long
17for i ulong 32
18put out i 0
19end
20if not binding_owner call
21ret 69
22end
23if ne compose_launchread real launch 256 0
24ret 69
25end
26if ne compose_word real 4 get call 1
27ret 69
28end
29if ne compose_word real 5 get call 2
30ret 69
31end
32if ne compose_word real 6 get call 3
33ret 69
34end
35if ne compose_word launch 12 get call 5
36ret 69
37end
38if ne compose_word launch 11 896
39ret 69
40end
41if ne compose_word launch 3 1
42ret 69
43end
44if ne compose_word launch 5 1
45ret 69
46end
47if ne compose_word launch 6 1
48ret 69
49end
50gpr = compose_word launch 8
51if or lt gpr 64 ne rem gpr 8 0
52ret 69
53end
54shared = compose_word launch 7
55if or lt shared 1024 ne rem shared 128 0
56ret 69
57end
58if ne compose_word launch 10 1
59ret 69
60end
61if eq get call 0 1
62if and ne get call 7 1 ne get call 7 get call 4
63ret 69
64end
65if or ne get call 1 1 ne get call 6 0
66ret 69
67end
68if ne compose_word launch 2 get call 4
69ret 69
70end
71if gt compose_word real 19 2
72ret 69
73end
74rows = compose_word real 15
75if eq rows 0
76ret 69
77end
78if or ne get call 5 10 ne rem get call 2 rows 0
79ret 69
80end
81else
82if eq get call 0 2
83if ne get call 7 0
84ret 65
85end
86if ne compose_word real 19 3
87ret 69
88end
89if ne compose_word launch 2 get call 4
90ret 69
91end
92else
93ret 69
94end
95end
96for i ulong 32
97put out i compose_word launch i
98end
99note Derived ABI scalars, not serialized launch fields: RG and gridX*warps.
100put out 28 div get call 2 compose_word real 15
101put out 29 mul compose_word launch 1 compose_word real 17
102ret 0
103end