Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/om/prefill-shape/workspace.om # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / om / prefill-shape / workspace.om` 22 lines · 565 bytes Raw Blame History 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