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 / admission / chip_enum.om

37 lines · 557 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note enum: 0 table row identity, 1 raw sysfs vendor, 2 display class, 3 PCI field mask.
3fn ce_eq a ulong b ulong to ulong
4if eq a b
5ret 1
6end
7ret 0
8end
9fn chip_enum mode ulong a ulong b ulong c ulong d ulong to ulong
10if eq mode 0
11ret and ce_eq a c ce_eq b d
12end
13if eq mode 1
14ret ce_eq a 4318
15end
16if eq mode 2
17ret ce_eq shr a 16 3
18end
19if eq mode 4
20if eq c 0
21ret 0
22end
23sa = shr a 63
24sb = shr b 63
25if ne sa sb
26ret sa
27end
28if lt a b
29ret 1
30end
31ret 0
32end
33if eq mode 5
34ret ce_eq a 46
35end
36ret and a b
37end