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

36 lines · 649 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2fn vc_range q view ulong 16 d edit uint * zz view ulong 4 to ulong
3r = new ulong 16 0
4for j ulong 5
5put r j get q j
6end
7for jj ulong get zz 1
8i = add get zz 0 jj
9put r 0 add get q 0 i
10rc = api_at_plan 10 r
11if ne rc 0
12ret rc
13end
14put d i uint get r 8
15put d add get zz 2 i uint get r 9
16end
17ret 0
18end
19fn av_range q view ulong 16 d edit uint * n ulong to ulong
20zz = new ulong 4 0
21put zz 2 n
22r = ulong 0
23for bb ulong add div n 1000000 1
24put zz 0 mul bb 1000000
25cnt = sub n get zz 0
26if gt cnt 1000000
27cnt = ulong 1000000
28end
29put zz 1 cnt
30rr = vc_range q d zz
31if ne rr 0
32ret rr
33end
34end
35ret r
36end