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 / idparse.om

60 lines · 838 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Copyright 2026 Drake Stapleton
3fn chex c ulong to ulong
4if and ge c 48 le c 57
5ret sub c 48
6end
7if and ge c 65 le c 70
8ret sub c 55
9end
10if and ge c 97 le c 102
11ret sub c 87
12end
13ret 256
14end
15fn cidparse s view uchar 65 d edit uchar 32 to ulong
16if ne ulong get s 64 0
17ret 1
18end
19for i ulong 32
20a = ulong get s mul i 2
21b = chex ulong get s add mul i 2 1
22if eq b 256
23ret 1
24end
25x = chex a
26if ne x 256
27put d i uchar add mul x 16 b
28else
29if eq a 45
30put d i uchar and sub 0 b 255
31else
32if or eq a 43 or eq a 32 and ge a 9 le a 13
33put d i uchar b
34else
35ret 1
36end
37end
38end
39end
40ret 0
41end
42fn cversion kind ulong ver ulong to ulong
43want = ulong 1
44if eq kind 8
45want = 2
46if eq ver 1
47ret 2
48end
49end
50if ne ver want
51ret 1
52end
53ret 0
54end
55fn cver kind ulong to ulong
56if eq kind 8
57ret 2
58end
59ret 1
60end