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 / host-trace / batch-device.om

40 lines · 952 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Parse actual DMA packet WFI release markers. Host model, NOT GPU execution.
3fn bfdev m long off ulong words uint to bool
4mark = mapaddr get gbmem 3
5pos = off
6last = add off mul ulong words 4
7head = or uint 536870912 shl uint 5 16
8head = or head shr uint 92 2
9while le add pos 24 last
10w = mapget m pos 4
11if eq w ulong head
12va = or mapget m add pos 4 4 shl mapget m add pos 8 4 32
13val = mapget m add pos 12 4
14if and ge va mark lt va add mark 4096
15rel = sub va mark
16if ge rel 32
17note A launch seal must be WFI, followed by the canonical full shader invalidation.
18if ne mapget m add pos 20 4 1048577
19put nverr 0 -22
20ret false
21end
22if ne mapget m add pos 28 4 4113
23put nverr 0 -22
24ret false
25end
26idx = add div sub rel 32 4 1
27if eq idx get bffail 0
28ret true
29end
30end
31r = mapset get gbmem 3 rel 4 val
32end
33pos = add pos 24
34else
35pos = add pos 4
36end
37end
38r = mapset get gbmem 2 8192 4 6
39ret true
40end