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/ldg_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 / ldg_spec_test.om` 56 lines · 1010 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note Compose bw_enc_sm121.om, bw_spec_sm121.om, then this file. 3 note Constants are the nine accepted/refused offset cases of ldg_offset_test.om. 4 note A second argument removes the spec offset field: byte parity must fail. 5 fn ls_same a view ulong 4 b view ulong 4 to bool 6 for k ulong 4 7 if ne get a k get b k 8 ret false 9 end 10 end 11 ret true 12 end 13 fn main to int 14 state = new ulong 3001 0 15 o = new ulong 16 0 16 w = new ulong 4 0 17 ref = new ulong 4 0 18 cases = new ulong 9 0 19 put cases 1 64 20 put cases 2 `4293918720` 21 put cases 3 `8388607` 22 put cases 4 `4286578688` 23 put cases 5 `8388608` 24 put cases 6 `4286578687` 25 put cases 7 `2147483647` 26 put cases 8 `2147483648` 27 sp_init state 28 if gt argcnt 1 29 set_hdr state 14 11 0 991744 3 30 end 31 put o 0 11 32 put o 1 2 33 put o 2 30 34 put o 5 8 35 put o 12 1 36 put o 14 1 37 put o 15 1 38 for i ulong 9 39 put o 6 get cases i 40 a = enc1 o ref 41 b = sp_enc state o w 42 if eq a 0 43 if ne b E_OK 44 ret 1 45 end 46 if not ls_same w ref 47 ret 1 48 end 49 else 50 if ne b E_RANGE 51 ret 1 52 end 53 end 54 end 55 ret 0 56 end