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 / apirest / pfratio.om

44 lines · 797 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2fn ar_rs q view ulong 4 t ulong to ulong
3p = mul t 8
4if eq get q 2 1
5p = swsrc uint p uint get q 0
6end
7ret mul div p 128 div get q 1 128
8end
9fn ar_rd q view ulong 4 t ulong to ulong
10b = div t 2
11b = mul b add div get q 1 128 1
12b = mul b 2
13ret add b rem t 2
14end
15fn ar_prw q view ulong 4 sf view f32 * y edit f32 * t ulong to void
16kb = div get q 1 128
17a = ar_rs q t
18b = ar_rd q t
19put y b 1.0f32
20for c ulong 4294967296
21if ge c kb
22break
23end
24if ne c 0
25j = add a c
26v = div get sf sub j 1 get sf j
27j = add b mul c 2
28put y j v
29end
30end
31a = add a sub kb 1
32b = add b mul kb 2
33put y b get sf a
34ret
35end
36fn arpfrat q view ulong 4 sf view f32 * y edit f32 * to ulong
37for t ulong 4294967296
38if ge t div get q 0 8
39break
40end
41ar_prw q sf y t
42end
43ret 0
44end