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
CUDApp / om / prefill-shape / workspace.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Reuse only when every existing row, padded-row and tile capacity covers the request. |
| 3 | note Rows and height are bounded before the ceiling division, so sums cannot overflow ulong. |
| 4 | fn native_qgworkspace capacity ulong padded ulong tiles ulong rows ulong bm ulong to ulong |
| 5 | if or eq rows 0 gt rows 4294967295 |
| 6 | ret 0 |
| 7 | end |
| 8 | if or eq bm 0 gt bm 4294967295 |
| 9 | ret 0 |
| 10 | end |
| 11 | if gt rows capacity |
| 12 | ret 0 |
| 13 | end |
| 14 | if gt add rows bm padded |
| 15 | ret 0 |
| 16 | end |
| 17 | needed = add div add rows sub bm 1 bm 1 |
| 18 | if gt needed tiles |
| 19 | ret 0 |
| 20 | end |
| 21 | ret 1 |
| 22 | end |