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/api/attn_scalar.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 / api / attn_scalar.om` 34 lines · 662 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note Decode uses the kernel's raw rounding for nonfinite values, unlike gx_f2bf NaN quieting. 3 fn av_drnd u uint to uint 4 if gx_fin u 5 ret gx_f2bf u 6 end 7 ret shr add add u 32767 and shr u 16 1 16 8 end 9 fn av_perm i uint r uint to uint 10 p = div r 2 11 if lt i 128 12 if lt i p 13 ret i 14 end 15 ret add r sub i p 16 end 17 j = sub i 128 18 if lt j p 19 ret add p j 20 end 21 ret i 22 end 23 fn av_permf s view f32 256 d edit f32 256 r uint to ulong 24 for i ulong 256 25 put d i get s ulong av_perm uint i r 26 end 27 ret 0 28 end 29 fn av_permb s view ushort 256 d edit ushort 256 r uint to ulong 30 for i ulong 256 31 put d i get s ulong av_perm uint i r 32 end 33 ret 0 34 end