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 / identity_native.om

44 lines · 1051 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Compose cache/digest.om, blackwell/identity.om, blackwell/id_native.om and this file.
3note Run once against pre-rename digest/identity, once against the renamed units; compare complete stdout.
4note 4096 machine-wire states (27 bytes), then 4096 realization-wire states (100 bytes).
5note These are host-generated wire inputs, not hardware identities or authorization evidence.
6fn idn_case state ulong count ulong to int
7data = new uchar 256 0
8dst = new uchar 32 0
9for i ulong 256
10put data i uchar and add state i 255
11end
12put data 0 uchar and state 255
13put data 1 uchar and shr state 8 255
14if ne bw_id_native data count dst 0
15ret 1
16end
17pos = ulong 0
18while lt pos 32 bound 32
19k = write 1 dst pos sub ulong 32 pos
20if le k 0
21ret 2
22end
23pos = add pos ulong k
24end
25if ne bw_id_native data 257 dst long -1
26ret 3
27end
28ret 0
29end
30fn main to int
31for state ulong 4096
32r = idn_case state 27
33if ne r 0
34ret r
35end
36end
37for state ulong 4096
38r = idn_case add state 4096 100
39if ne r 0
40ret r
41end
42end
43ret 0
44end