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 / core / effect.om

65 lines · 920 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Copyright 2026 Drake Stapleton
3fn efsize off ulong to ulong
4if eq off 0
5ret 2
6end
7if eq off 2
8ret 2
9end
10if eq off 4
11ret 4
12end
13if eq off 8
14ret 8
15end
16if eq off 48
17ret 2
18end
19ret 1
20end
21fn omeffect p edit uchar 184 w edit uchar 178 size ulong mode ulong to long
22if eq mode 0
23i = ulong 0
24while lt i 178 bound 178
25n = efsize i
26for j ulong n
27put w add i j uchar ulong get p add i sub sub n j 1
28end
29i = add i n
30end
31ret 0
32end
33for i ulong 184
34put p i uchar 0
35end
36if eq size 176
37ret -3
38end
39if ne size 178
40ret -2
41end
42if eq or ulong get w 0 ulong get w 1 0
43ret -4
44end
45n = add shl ulong get w 48 8 ulong get w 49
46if gt n 128
47ret -5
48end
49i = n
50while lt i 128 bound 128
51if ne ulong get w add 50 i 0
52ret -6
53end
54i = add i 1
55end
56i = ulong 0
57while lt i 178 bound 178
58n = efsize i
59for j ulong n
60put p add i j uchar ulong get w add i sub sub n j 1
61end
62i = add i n
63end
64ret 0
65end