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/codegen/cg_gdn_shape.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 / codegen / cg_gdn_shape.om` 65 lines · 1028 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note GDN shape (omega_gdn_shape), shared by the builder unit cg_gdn and the policy unit cg_gdn_policy. 3 fn omega_gd_pick c bool a ulong b ulong to ulong 4 if c 5 ret a 6 end 7 ret b 8 end 9 note The shape: ratio 0 means 3; 1..3 are valid; 0 returned for an invalid ratio. 10 fn omega_gd_rr ra ulong to ulong 11 r = ra 12 if eq r 0 13 r = 3 14 end 15 if or lt r 1 gt r 3 16 ret 0 17 end 18 ret r 19 end 20 note Queries: 0 valid 1 r 2 vh 3 vdim 4 conv 5 par_scal 6 par_norm 7 par_bytes 8 tail_bytes 9 state_bytes 10 post_grid_y. 21 fn omega_gd_shq q ulong ra ulong bf ulong to ulong 22 r = omega_gd_rr ra 23 if eq r 0 24 ret 0 25 end 26 if eq q 0 27 ret 1 28 end 29 vh = mul 16 r 30 vdim = mul 128 vh 31 conv = add 4096 vdim 32 ps = mul 16 conv 33 pn = add ps mul 8 vh 34 if eq q 1 35 ret r 36 end 37 if eq q 2 38 ret vh 39 end 40 if eq q 3 41 ret vdim 42 end 43 if eq q 4 44 ret conv 45 end 46 if eq q 5 47 ret ps 48 end 49 if eq q 6 50 ret pn 51 end 52 if eq q 7 53 ret add pn 512 54 end 55 if eq q 8 56 ret mul 6144 vh 57 end 58 if eq q 9 59 ret mul omega_gd_pick ne bf 0 32768 65536 vh 60 end 61 if eq q 10 62 ret div vh 8 63 end 64 ret 0 65 end