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 / device-trace / guard-test.om

56 lines · 831 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Compose after trace-emit.om. Noncanonical enable/check values cannot bypass refusal.
3note Refusal preserves every output byte and its old length, not only a chosen prefix.
4
5fn gprepare to void
6for i ulong 8192
7put gbout i 165
8end
9put gboutlen 0 7
10put gbinlen 0 0
11end
12
13fn gunchanged to bool
14if ne get gboutlen 0 7
15ret false
16end
17for i ulong 8192
18if ne get gbout i 165
19ret false
20end
21end
22ret true
23end
24
25fn main to int
26vals = new ulong 4 0
27put vals 1 1
28put vals 2 2
29put vals 3 18446744073709551615
30for i ulong 4
31for j ulong 4
32gprepare
33on = get vals i
34checks = get vals j
35put gtchecks 0 checks
36ok = gtewrap on 2
37if and ne on 0 ne checks 1
38if ok
39ret 1
40end
41if ne get gterr 0 4
42ret 2
43end
44same = gunchanged
45if not same
46ret 3
47end
48else
49if not ok
50ret 4
51end
52end
53end
54end
55ret 0
56end