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

34 lines · 611 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Copyright 2026 Drake Stapleton
3fn omnum bits ulong base ulong signed ulong buf edit uchar 24 to ulong
4x = bits
5minus = and ne signed 0 ge bits 9223372036854775808
6if minus
7x = sub ulong 0 bits
8end
9tmp = new uchar 24 0
10n = ulong 0
11while ne x 0 bound 24
12r = rem x base
13if lt r 10
14put tmp n uchar add r 48
15else
16put tmp n uchar add r 87
17end
18n = add n 1
19x = div x base
20end
21if eq n 0
22put tmp 0 uchar 48
23n = 1
24end
25start = ulong 0
26if minus
27put buf 0 uchar 45
28start = 1
29end
30for i ulong n
31put buf add start i get tmp sub sub n i 1
32end
33ret add start n
34end