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 / speculation / vector-checks.om

66 lines · 1448 bytes Raw Blame History
1note Shared whole-vector checks, chunked below the seeded dynamic-loop limit.
2fn aval i ulong salt ulong to ulong
3ret and add mul i 2654435761 salt 4294967295
4end
5fn bval i ulong salt ulong to ulong
6ret and xor add mul i 2246822519 3266489917 salt 4294967295
7end
8fn expect i ulong salt ulong to ulong
9ret and add aval i salt bval i salt 4294967295
10end
11fn putvec i ulong salt ulong to void
12r = mapset get gbmem 5 mul i 4 4 aval i salt
13r = mapset get gbmem 6 mul i 4 4 bval i salt
14r = mapset get gbmem 7 mul i 4 4 xor expect i salt 4294967295
15end
16fn match i ulong salt ulong to bool
17ret eq mapget get gbmem 7 mul i 4 4 expect i salt
18end
19fn prepare n uint salt ulong to void
20base = ulong 0
21while lt base ulong n
22count = sub ulong n base
23if gt count 65536
24count = ulong 65536
25end
26for j ulong count
27putvec add base j salt
28end
29base = add base count
30end
31tail = sub get gbmax 0 n
32if gt tail 64
33tail = uint 64
34end
35for i ulong ulong tail
36r = mapset get gbmem 7 mul add ulong n i 4 4 3735928559
37end
38end
39fn verify n uint salt ulong wrong bool to void
40mism = ulong 0
41base = ulong 0
42while lt base ulong n
43count = sub ulong n base
44if gt count 65536
45count = ulong 65536
46end
47for j ulong count
48if not match add base j salt
49mism = add mism 1
50end
51end
52base = add base count
53end
54if wrong
55ck gt mism 0
56else
57ck eq mism 0
58end
59tail = sub get gbmax 0 n
60if gt tail 64
61tail = uint 64
62end
63for i ulong ulong tail
64ck eq mapget get gbmem 7 mul add ulong n i 4 4 3735928559
65end
66end