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 / tests / pipeline / graph-caller.om

152 lines · 2940 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Reuses exact Composer+Quant fixture. Synthetic identities do not qualify code.
3fn pl_hword h view uchar 32 i ulong to ulong
4v = ulong 0
5for j ulong 8
6v = or v shl ulong get h add mul i 8 j mul j 8
7end
8ret v
9end
10fn pl_zero out view ulong 32 to bool
11for j ulong 32
12if ne get out j 0
13ret false
14end
15end
16ret true
17end
18fn pl_bind q edit ulong 64 a edit ulong 1024 real view uchar 4096 to int
19h = new uchar 32 0
20if ne kc_sha real 1152 h 0
21ret 1
22end
23put a 0 compose_word real 19
24put a 12 compose_word real 22
25put a 13 compose_word real 21
26put a 14 compose_word real 25
27put a 15 compose_word real 3
28for i ulong 4
29v = pl_hword h i
30put a add 21 i v
31put a add 49 i v
32put q add 30 i v
33put a add 57 i compose_word real add 84 i
34put a add 25 i compose_word real add 88 i
35end
36ret 0
37end
38fn pl_make want edit uchar 4096 real edit uchar 4096 to int
39launch = new ulong 32 0
40if ne compose_fixture want launch 0
41ret 1
42end
43for j ulong 4096
44put real j get want j
45end
46ret int compose_launch real launch
47end
48fn pl_resident q edit ulong 64 a edit ulong 1024 p edit ulong 528 real view uchar 4096 to int
49req = new ulong 16 0
50pl_fixture q a
51put q 1 1
52put q 10 256
53put q 11 0
54if ne pl_bind q a real 0
55ret 3
56end
57if ne kc_init p 1 1 128 1 0
58ret 4
59end
60put req 0 1
61put req 1 1
62put req 2 1
63put req 7 1
64for j ulong 4
65put req add 3 j get a add 21 j
66end
67if ne kc_prepare p req 1
68ret 5
69end
70ret kc_commit p 0 1 1
71end
72fn main to int
73q = new ulong 64 0
74a = new ulong 1024 0
75p = new ulong 528 0
76want = new uchar 4096 0
77real = new uchar 4096 0
78out = new ulong 32 0
79if ne pl_make want real 0
80ret 1
81end
82if ne pl_resident q a p real 0
83ret 2
84end
85if ne pl_graph q a p want real out 0
86ret 7
87end
88if ne get out 16 1
89ret 8
90end
91if ne kc_unpin p get out 17 get out 18 get out 19 0
92ret 9
93end
94note Target, shape, tail, alias and pin mutations cannot reuse original artifact.
95old = get real 16
96put real 16 xor old uchar 1
97if ne pl_graph q a p want real out 69
98ret 10
99end
100if not pl_zero out
101ret 11
102end
103put real 16 old
104old = get real 32
105put real 32 xor old uchar 1
106if ne pl_graph q a p want real out 69
107ret 10
108end
109if not pl_zero out
110ret 11
111end
112put real 32 old
113old = get real 96
114put real 96 xor old uchar 1
115if ne pl_graph q a p want real out 69
116ret 10
117end
118if not pl_zero out
119ret 11
120end
121put real 96 old
122old = get real 104
123put real 104 xor old uchar 1
124if ne pl_graph q a p want real out 69
125ret 10
126end
127if not pl_zero out
128ret 11
129end
130put real 104 old
131old = get real 544
132put real 544 xor old uchar 1
133if ne pl_graph q a p want real out 69
134ret 10
135end
136if not pl_zero out
137ret 11
138end
139put real 544 old
140note Resource declarations must match exact canonical metadata, not only fit ceiling.
141put a 12 1
142if ne pl_graph q a p want real out 69
143ret 12
144end
145put a 12 compose_word real 22
146note Missing native staged composer is an explicit refusal, never shape-based inference.
147compose_put real 19 3
148if ne pl_graph q a p want real out 69
149ret 13
150end
151ret 0
152end