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-check.py # 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-check.py` 20 lines · 1182 bytes Raw Blame History 1 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 # Independent capacity oracle, not production. 3 import ctypes,sys,random 4 lib=ctypes.CDLL(sys.argv[1]);f=lib.omega_native_qgworkspace 5 f.argtypes=[ctypes.POINTER(ctypes.c_uint64)]+[ctypes.c_uint64]*5;f.restype=ctypes.c_uint32 6 cases=[] 7 for rows in [0,1,3,30,63,64,65,128,129,512,4096,2**32-1,2**32,2**64-1]: 8 for bm in [0,32,64,128,2**32-1,2**32,2**64-1]: 9 for delta in [-1,0,1]: 10 cap=max(0,rows+delta);pad=min(2**64-1,rows+bm+delta);tiles=(rows+bm-1)//bm+1 if bm else 0 11 if cap<2**64 and pad>=0:cases += [(cap,pad,tiles,rows,bm),(cap,pad,max(0,tiles-1),rows,bm)] 12 cases += [(4096,4224,33,30,64),(4096,4224,33,4096,128),(4096,4224,33,4096,64)] 13 rng=random.Random(710) 14 for _ in range(1000):cases.append(tuple(rng.randrange(8193) for _ in range(5))) 15 for args in cases: 16 capacity,padded,tiles,rows,bm=args 17 want=int(0