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 / tests / components / direct-caller.om

66 lines · 1372 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Concatenate allocator,effect,project,repaired bw_enc_sm121,then this host caller.
3global CTIn uchar 64
4global CTOut uchar 8
5fn ct_word v ulong to bool
6for j ulong 8
7put CTOut j uchar and shr v mul j 8 255
8end
9ret eq write 1 CTOut 0 8 8
10end
11fn ct_parse spec edit ulong 8 to void
12for k ulong 8
13v = ulong 0
14for j ulong 8
15v = or v shl ulong get CTIn add mul k 8 j mul j 8
16end
17put spec k v
18end
19end
20fn ct_frame ins view ulong 8192 meta view ulong 2048 phys view ulong 288 st view ulong 4 rs view ulong 4 to void
21for k ulong 4
22ok = ct_word get st k
23end
24ok = ct_word get rs 1
25ok = ct_word get rs 2
26for k ulong get st 1
27ok = ct_word get meta k
28ok = ct_word get phys k
29end
30for k ulong get st 2
31ok = ct_word get meta add k 256
32ok = ct_word get phys add k 256
33end
34for k ulong mul get st 0 8
35ok = ct_word get ins k
36end
37end
38fn main to int
39spec = new ulong 8 0
40ins = new ulong 8192 0
41meta = new ulong 2048 0
42phys = new ulong 288 0
43st = new ulong 4 0
44rs = new ulong 4 0
45code = new uchar 16384 0
46if ne read 0 CTIn 0 64 64
47ret 65
48end
49ct_parse spec
50rc = bc_project spec ins meta st
51if ne rc 0
52ret 66
53end
54if ne bc_regalloc ins get st 0 meta phys rs 128 0
55ret 67
56end
57nbytes = bc_encode ins phys get st 0 1 code
58if eq nbytes 0
59ret 68
60end
61ct_frame ins meta phys st rs
62if ne write 1 code 0 nbytes long nbytes
63ret 74
64end
65ret 0
66end