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 / moe / moe_maps32.om

28 lines · 674 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Logical ABI ulong words to the existing GPU u32 maps. Unused output bytes untouched.
3note Validate every active value before writing; caller retains map capacity/generation lease.
4fn moe_m32 out edit uchar 9280 p ulong v ulong to void
5for b ulong 4
6put out add mul p 4 b uchar and shr v mul b 8 255
7end
8end
9fn moe_maps32 m view ulong 8 mp view ulong 2320 out edit uchar 9280 to ulong
10if gt get m 0 1152
11ret 1
12end
13n = add get m 0 8
14for z ulong 2
15for i ulong n
16if gt get mp add mul z 1160 i 4294967295
17ret 2
18end
19end
20end
21for z ulong 2
22for i ulong n
23p = add mul z 1160 i
24moe_m32 out p get mp p
25end
26end
27ret 0
28end