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 / prefill-shape / workspace.om

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