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

31 lines · 655 bytes Raw Blame History
1om2
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Signed int32 input travels as uint bits; nonpositive contexts become empty.
4note Inner traversal blocks preserve the checked one-million-iteration guard.
5fn vc_ctx s view uint * d edit uint * q view ulong 4 to ulong
6for zzj ulong get q 1
7i = add get q 0 zzj
8v = get s i
9if ge v 2147483648
10v = uint 0
11end
12put d i v
13end
14ret 0
15end
16
17fn av_ctx s view uint * d edit uint * n ulong to ulong
18q = new ulong 4 0
19r = ulong 0
20for zzb ulong add div n 1000000 1
21put q 0 mul zzb 1000000
22zzn = sub n get q 0
23if gt zzn 1000000
24zzn = ulong 1000000
25end
26put q 1 zzn
27rr = vc_ctx s d q
28r = rr
29end
30ret r
31end