Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/tests/speculation/native-memory-test.om # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / tests / speculation / native-memory-test.om` 82 lines · 1773 bytes Raw Blame History 1 note Physical RM/UVM buffer lifecycle and CPU access. No kernel or GPU coherence claim. 2 global payload uchar 256 3 global readback uchar 256 4 global diag uchar 24 5 text ok "NATIVE_DEVICE_MEMORY_PASS\n" 6 text bad "NATIVE_DEVICE_MEMORY_FAIL\n" 7 fn pack off ulong v long to void 8 for i ulong 8 9 put diag add off i uchar and shr v mul i 8 255 10 end 11 end 12 fn ck yes bool to void 13 if not yes 14 pack 0 long get nvstage 0 15 pack 8 get nverr 0 16 closed = nvstop 17 pack 16 long get nvfault 0 18 r = write 2 bad 0 len bad 19 r = write 1 diag 0 len diag 20 exit int 80 21 end 22 end 23 fn checkmem m long size ulong salt uint to void 24 ck gt m 0 25 ck eq and mapaddr m 4095 0 26 ck eq mapget m 0 8 0 27 ck eq mapget m sub size 8 8 0 28 for i ulong 256 29 put payload i uchar and add uint i salt 255 30 end 31 off = ulong 0 32 while lt off size 33 ck eq mapwrite m off payload 0 256 256 34 off = add off 256 35 end 36 off = ulong 0 37 while lt off size 38 ck eq mapread m off readback 0 256 256 39 for i ulong 256 40 ck eq get readback i get payload i 41 end 42 off = add off 256 43 end 44 end 45 fn main to int 46 ck nvstop 47 for attempt uint 3 48 ck nvfull 49 ck not nvstart 50 ck eq get nverr 0 neg long 16 51 put nverr 0 0 52 a = nvalloc 4096 true 53 checkmem a 4096 attempt 54 b = nvalloc 65536 false 55 checkmem b 65536 add attempt 17 56 ck ne mapaddr a mapaddr b 57 ck eq mapget a 0 4 ulong add uint `50462976` mul attempt `16843009` 58 ck nvdrop a 59 ck not nvdrop a 60 ck eq get nverr 0 neg long 22 61 put nverr 0 0 62 c = nvalloc `1048576` true 63 checkmem c `1048576` add attempt 31 64 ck ne c a 65 ck nvdrop b 66 ck nvdrop c 67 d = nvalloc 4097 true 68 checkmem d 8192 add attempt 47 69 note The final live buffer is intentionally released by context shutdown. 70 ck nvstop 71 ck nvstop 72 for i ulong len nvmflag 73 ck eq get nvmflag i 0 74 end 75 for i ulong len nvfd 76 ck eq get nvfd i neg int 1 77 end 78 ck eq get nvfault 0 0 79 end 80 ck eq write 1 ok 0 len ok long len ok 81 ret 0 82 end