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/om/encoder/bw_spec_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 / om / encoder / bw_spec_test.om` 95 lines · 1348 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note Standalone checks for bw_spec_sm121.om; the reusable module has no entrypoint. 3 fn main to int 4 sp_tbl = new ulong 3001 0 5 sp_init sp_tbl 6 o = new ulong 16 0 7 w = new ulong 4 0 8 dec = new ulong 16 0 9 10 note Test 1: NOP encode and decode 11 for i ulong 16 12 put o i 0 13 end 14 st = sp_enc sp_tbl o w 15 if ne st 0 16 ret 10 17 end 18 if ne get w 0 31000 19 ret 11 20 end 21 dst = sp_dec sp_tbl w dec 22 if ne dst 0 23 ret 12 24 end 25 if ne get dec 0 0 26 ret 13 27 end 28 29 note Test 2: IMAD encode and decode 30 for i ulong 16 31 put o i 0 32 end 33 put o 0 8 34 put o 1 10 35 put o 2 11 36 put o 3 12 37 put o 4 13 38 put o 13 1 39 st = sp_enc sp_tbl o w 40 if ne st 0 41 ret 20 42 end 43 dst = sp_dec sp_tbl w dec 44 if ne dst 0 45 ret 21 46 end 47 if ne get dec 0 8 48 ret 22 49 end 50 if ne get dec 1 10 51 ret 23 52 end 53 if ne get dec 2 11 54 ret 24 55 end 56 if ne get dec 3 12 57 ret 25 58 end 59 if ne get dec 4 13 60 ret 26 61 end 62 63 note Test 3: Out-of-range register refusal (register 256) 64 for i ulong 16 65 put o i 0 66 end 67 put o 0 1 68 put o 1 256 69 st2 = sp_enc sp_tbl o w 70 if ne st2 E_RANGE 71 ret 30 72 end 73 74 note Test 4: Unsupported opcode refusal 75 for i ulong 16 76 put o i 0 77 end 78 put o 0 99 79 st3 = sp_enc sp_tbl o w 80 if ne st3 E_UNSUP 81 ret 40 82 end 83 84 note Test 5: Refusal of unmatched bit pattern on decode 85 put w 0 `4294967295` 86 put w 1 `4294967295` 87 put w 2 `4294967295` 88 put w 3 `4294967295` 89 dst = sp_dec sp_tbl w dec 90 if ne dst E_NOMAT 91 ret 50 92 end 93 94 ret 0 95 end