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_rpois.om

35 lines · 720 bytes Raw Blame History
1om2
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Inner traversal blocks preserve the checked one-million-iteration guard.
4fn vc_rpois w view f32 * ids view uint * q view ulong 4 poison ulong to ulong
5r = ulong 0
6pv = bitcast f32 uint and poison 4294967295
7pi = uint shr poison 32
8for zzj ulong get q 1
9i = add get q 0 zzj
10if eq get w i pv
11r = add r 1
12else
13if eq get ids i pi
14r = add r 1
15end
16end
17end
18ret r
19end
20
21fn av_rpois w view f32 * ids view uint * n ulong poison ulong to ulong
22q = new ulong 4 0
23r = ulong 0
24for zzb ulong add div n 1000000 1
25put q 0 mul zzb 1000000
26zzn = sub n get q 0
27if gt zzn 1000000
28zzn = ulong 1000000
29end
30put q 1 zzn
31rr = vc_rpois w ids q poison
32r = add r rr
33end
34ret r
35end