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

115 lines · 3001 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Concatenate tests/components/proc.om then this file. One argument: pinned omc.
3note Uses the existing checked process helper. All new test/conductor logic is Omega.
4text MGsrc "om/session/reserve.om"
5text MGfx "om/engine/fixture_rest.om"
6text MGeng "om/engine/eng.om"
7text MGslot "om/api/apish_slot.om"
8text MGtest "tests/session_memory_test.om"
9text MGdir "build/session-memory"
10text MGcomp "build/components"
11text MGbin "build/session-memory/check"
12text MGlog "build/session-memory/positive.log"
13text MGl1 "build/session-memory/default.log"
14text MGl2 "build/session-memory/saturation.log"
15text MGl3 "build/session-memory/prefix.log"
16text MGl4 "build/session-memory/sign.log"
17text MGl5 "build/session-memory/end.log"
18text MGl6 "build/session-memory/underflow.log"
19text MGl7 "build/session-memory/capacity.log"
20text MGpass "SESSION_MEMORY_GATE PASS mutants=7/7 KILLED; chip NOT_RUN\n"
21text MGkill "KILLED "
22text MGa "if eq len b 0\nret 4096"
23text MGan "if eq len b 0\nret 4097"
24text MGb "if gt value 17592186044415"
25text MGbn "if ge value 17592186044415"
26text MGc "ret eq get b 12 58"
27text MGcn "ret eq get b 12 59"
28text MGd "put dst 0 sub ulong 0 get dst 0"
29text MGdn "put dst 0 add ulong 0 get dst 0"
30text MGe "if eq get dst 1 len b"
31text MGen "if ne get dst 1 len b"
32text MGf "if or eq get rec 1 0 and eq get rec 5 0 ne get rec 3 ver"
33text MGfn "if or ne get rec 1 0 and eq get rec 5 0 ne get rec 3 ver"
34text MGg "if ge get m 3 get m 4"
35text MGgn "if gt get m 3 get m 4"
36
37fn mg_load to void
38put HUsed 0 0
39hp_cat MGsrc len MGsrc
40hp_cat MGfx len MGfx
41hp_cat MGeng len MGeng
42hp_cat MGslot len MGslot
43hp_cat MGtest len MGtest
44end
45
46fn mg_change old view uchar * next view uchar * to void
47hp_require eq len old len next
48hp_require gt len old 0
49n = get HUsed 0
50hp_require le len old n
51matches = ulong 0
52i = ulong 0
53while le i sub n len old bound 999999
54same = true
55for j ulong len old
56if ne get HSrc add i j get old j
57same = false
58break
59end
60end
61if same
62matches = add matches 1
63for j ulong len next
64put HSrc add i j get next j
65end
66i = add i len old
67else
68i = add i 1
69end
70end
71hp_require eq matches 1
72end
73
74fn mg_run expected long path view uchar * to void
75hp_build MGbin len MGbin
76fd = hp_open path len path or int 577 524288 420
77hp_start MGbin len MGbin
78hp_exec -1 fd expected
79hp_close fd
80end
81
82fn mg_mut old view uchar * next view uchar * path view uchar * to void
83mg_load
84mg_change old next
85mg_run 1 path
86hp_say MGkill
87hp_say old
88hp_say HPNew
89end
90
91fn main to int
92path = new uchar 1024 0
93hp_require eq argcnt 2
94n = argread 1 path 0 1024
95hp_require gt n 0
96put HOn 0 ulong n
97for i ulong ulong n
98put HOm i get path i
99end
100r = makedir MGdir 0 len MGdir 493
101hp_require or eq r 0 eq r -17
102r = makedir MGcomp 0 len MGcomp 493
103hp_require or eq r 0 eq r -17
104mg_load
105mg_run 0 MGlog
106mg_mut MGa MGan MGl1
107mg_mut MGb MGbn MGl2
108mg_mut MGc MGcn MGl3
109mg_mut MGd MGdn MGl4
110mg_mut MGe MGen MGl5
111mg_mut MGf MGfn MGl6
112mg_mut MGg MGgn MGl7
113hp_say MGpass
114ret 0
115end