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 / components / compose.om

58 lines · 1300 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note cfg16:family1direct/2rowpipe/3staged,K,LB,rows-or-MT,warps,component,mutant0,reserved0.
3note Native component concatenation shares one instruction array and one allocation namespace.
4note No component performs physical allocation. One effect stream covers all boundaries.
5note out8:count,peakGPR,peakUGPR,shared,virtualGPR,virtualUGPR,reserved0,reserved0.
6fn bc_compose cfg view ulong 16 ins edit ulong 8192 m edit ulong 2048 phys edit ulong 288 out edit ulong 8 to uint
7spec = new ulong 16 0
8small = new ulong 8 0
9st = new ulong 4 0
10rs = new ulong 4 0
11for k ulong 8
12put out k 0
13end
14for k ulong 10
15if ne get cfg add k 6 0
16ret 1
17end
18end
19family = get cfg 0
20if or lt family 1 gt family 3
21ret 1
22end
23for k ulong 5
24put spec k get cfg add k 1
25put small k get cfg add k 1
26end
27rc = uint 1
28if eq family 1
29rc = bc_project small ins m st
30end
31if eq family 2
32if ne get cfg 5 0
33ret 1
34end
35rc = bc_rowpipe small ins m st
36end
37if eq family 3
38rc = bc_staged spec ins m st
39end
40if ne rc 0
41ret rc
42end
43rc = bc_ircheck ins get st 0 m
44if ne rc 0
45ret add rc 8
46end
47rc = bc_regalloc ins get st 0 m phys rs 128
48if ne rc 0
49ret add rc 16
50end
51put out 0 get st 0
52put out 1 get rs 1
53put out 2 get rs 2
54put out 3 get st 3
55put out 4 get st 1
56put out 5 get st 2
57ret 0
58end