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 / apiviews / gdnpt.om

40 lines · 969 bytes Raw Blame History
1om2
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Pack reference tail [3][conv] into per-head slots of 384 by 4.
4note Channel: s<128 q, s<256 k, else v. Slot 3 is 0. 384 is OMEGA_GDN_SLOTS.
5note Unsized views take two parameter slots, so the loops stay in the export.
6fn av_ch hh ulong ss ulong vh ulong to ulong
7hk = div hh div vh 16
8if lt ss 128
9ret add mul hk 128 ss
10end
11if lt ss 256
12ret add 2048 add mul hk 128 sub ss 128
13end
14ret add 4096 add mul hh 128 sub ss 256
15end
16fn av_base hh ulong ss ulong to ulong
17ret mul add mul hh 384 ss 4
18end
19fn av_gdnpt tail view f32 * dst edit f32 * vh ulong conv ulong to ulong
20if eq div vh 16 0
21ret 1
22end
23if ne len dst mul mul vh 384 4
24ret 1
25end
26if ne len tail mul conv 3
27ret 1
28end
29for hh ulong vh
30for ss ulong 384
31ch = av_ch hh ss vh
32base = av_base hh ss
33put dst base get tail ch
34put dst add base 1 get tail add ch conv
35put dst add base 2 get tail add ch mul conv 2
36put dst add base 3 0.0f32
37end
38end
39ret 0
40end