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 / attention-mirror / step.om

42 lines · 731 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Step 0 starts; actions 1 allocate, 2 prep, 3 copy, 4 attend, 5 complete; 0 refuses.
3note Caller reports completion only after each synchronous operation succeeds.
4note A failed allocation or copy cannot advance to attention. No trusted-prefix state exists.
5fn native_attnmirnext phase ulong need ulong have ulong ok ulong to ulong
6if ne ok 1
7ret 0
8end
9if ne need 0
10if or lt need 20608 or gt need 536887424 ne rem need 16 0
11ret 0
12end
13end
14if eq phase 0
15if gt need have
16ret 1
17end
18ret 2
19end
20if eq phase 1
21if lt have need
22ret 0
23end
24ret 2
25end
26if eq phase 2
27if ne need 0
28ret 3
29end
30ret 4
31end
32if eq phase 3
33if eq need 0
34ret 0
35end
36ret 4
37end
38if eq phase 4
39ret 5
40end
41ret 0
42end