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 / reading-check.py
| 1 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | # External profile oracle, not a production dependency. |
| 3 | import ctypes,sys |
| 4 | lib=ctypes.CDLL(sys.argv[1]) |
| 5 | |
| 6 | # Independent profile table at every small boundary and representative large rows. |
| 7 | r=lib.omega_native_qgreading |
| 8 | r.argtypes=[ctypes.POINTER(ctypes.c_uint64),ctypes.c_uint64,ctypes.c_uint64];r.restype=ctypes.c_uint32 |
| 9 | for rows in list(range(0,258))+[4095,4096,4097,2**32-1,2**32,2**64-1]: |
| 10 | for index in [0,1,2,3,4,2**64-1]: |
| 11 | out=ctypes.c_uint64(123) |
| 12 | assert r(ctypes.byref(out),rows,index)==0 |
| 13 | expected=(4,8,45,0) if 0<rows<65 else (8,8,45,4) |
| 14 | want=expected[index] if 0<rows<2**32 and index<4 else 2**32-1 |
| 15 | assert out.value==want,(rows,index,out.value,want) |
| 16 | assert r(None,64,0)==32 |
| 17 | print('PASS adaptive profile boundaries, option order and refusal controls') |