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

27 lines · 617 bytes Raw Blame History
1om2
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Runtime extents are exact live windows, never padded caller allocations.
4note Inner traversal blocks preserve the checked one-million-iteration guard.
5fn vc_buf s view uchar * d edit uchar * q view ulong 4 to ulong
6for zzj ulong get q 1
7i = add get q 0 zzj
8put d i get s i
9end
10ret 0
11end
12
13fn av_copy s view uchar * d edit uchar * 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_buf s d q
24r = rr
25end
26ret r
27end