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 / native / nvrm / uvm_fields.om

75 lines · 1418 bytes Raw Blame History
1om2
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Shared byte bodies for legacy fixed exports and exact-sized struct views.
4fn nv_ustor b edit uchar * off ulong v ulong n ulong to void
5for i ulong n
6put b add off i uchar and shr v mul i 8 255
7end
8end
9fn nv_ubody cmd ulong a view ulong 16 uuid view uchar 16 b edit uchar * to ulong
10for i ulong len b
11put b i 0
12end
13if eq cmd 805306369
14nv_ustor b 0 get a 0 8
15ret 16
16end
17if eq cmd 75
18nv_ustor b 0 get a 0 4
19ret 8
20end
21if or eq cmd 34 eq cmd 73
22nv_ustor b 0 get a 0 8
23nv_ustor b 8 get a 1 8
24ret 24
25end
26for i ulong 16
27put b i get uuid i
28end
29if or eq cmd 26 eq cmd 38
30ret 20
31end
32if eq cmd 37
33nv_ustor b 24 get a 0 4
34nv_ustor b 28 get a 1 4
35nv_ustor b 32 get a 2 4
36ret 40
37end
38if eq cmd 25
39nv_ustor b 16 get a 0 4
40nv_ustor b 20 get a 1 4
41nv_ustor b 24 get a 2 4
42ret 32
43end
44if eq cmd 27
45nv_ustor b 16 get a 0 4
46nv_ustor b 20 get a 1 4
47nv_ustor b 24 get a 2 4
48nv_ustor b 32 get a 3 8
49nv_ustor b 40 get a 4 8
50ret 56
51end
52if eq cmd 28
53nv_ustor b 16 get a 0 4
54nv_ustor b 20 get a 1 4
55ret 28
56end
57ret 0
58end
59fn nv_umap a view ulong 16 uuid view uchar 16 b edit uchar * to ulong
60for i ulong len b
61put b i 0
62end
63nv_ustor b 0 get a 0 8
64nv_ustor b 8 get a 1 8
65nv_ustor b 16 get a 2 8
66for i ulong 16
67put b add 24 i get uuid i
68end
69nv_ustor b 40 get a 7 4
70nv_ustor b 9240 get a 3 8
71nv_ustor b 9248 get a 4 4
72nv_ustor b 9252 get a 5 4
73nv_ustor b 9256 get a 6 4
74ret 9264
75end