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 / shader-pilot / export.om

50 lines · 766 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Offline stdout exporter: exactly [CUL1 catalog ID, selector], then EOF.
3note Selector1 emits the task; selector2 emits the unchanged vector code.
4global spin uchar 3
5fn main to int
6pos = ulong 0
7done = false
8while not done bound 4
9r = read 0 spin pos sub 3 pos
10if lt r 0
11ret 74
12end
13if eq r 0
14done = true
15else
16pos = add pos ulong r
17if eq pos 3
18ret 65
19end
20end
21end
22if ne pos 2
23ret 65
24end
25mode = get spin 1
26if and ne mode 1 ne mode 2
27ret 77
28end
29n = spload ulong get spin 0
30if eq n 0
31ret 77
32end
33if eq mode 2
34n = 512
35end
36pos = 0
37while lt pos n bound 513
38w = long 0
39if eq mode 1
40w = write 1 kt pos sub n pos
41else
42w = write 1 gbcode pos sub n pos
43end
44if le w 0
45ret 74
46end
47pos = add pos ulong w
48end
49ret 0
50end