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

27 lines · 528 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_any s view uint * q view ulong 4 to ulong
5r = ulong 0
6for zzj ulong get q 1
7i = add get q 0 zzj
8r = or r ulong get s i
9end
10ret r
11end
12
13fn av_any s view uint * n ulong to ulong
14q = new ulong 4 0
15r = ulong 0
16for zzb ulong add div n 1000000 1
17put q 0 mul zzb 1000000
18zzn = sub n get q 0
19if gt zzn 1000000
20zzn = ulong 1000000
21end
22put q 1 zzn
23rr = vc_any s q
24r = or r rr
25end
26ret r
27end