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 / codegen / cg_budget.om

17 lines · 408 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Declared GPR launch budget. Zero result refuses budget; all-ones refuses zero threads.
3fn cg_budget peak ulong decl ulong threads ulong to ulong
4if eq threads 0
5ret 18446744073709551615
6end
7if lt decl 64
8decl = ulong 64
9end
10if or gt peak 128 or ne rem decl 8 0 lt decl add peak 2
11ret 0
12end
13if gt mul decl threads 65536
14ret 0
15end
16ret decl
17end