interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / om / api / attn_scalar.om

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