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/q38-head/envelope-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 / q38-head / envelope-check.py` 62 lines · 1996 bytes Raw Blame History 1 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 # Independent external numerical verification; not a runtime dependency. 3 import math 4 import random 5 import struct 6 import subprocess 7 import sys 8 from fractions import Fraction 9 10 11 def fbits(f): 12 return struct.unpack(' Fraction(value(0x7f7fffff)): 50 assert r == 0 51 else: 52 assert 0 < r < 0x7f800000 53 assert Fraction(value(r)) >= exact 54 assert Fraction(value(r - 1)) < exact 55 assert value(r) >= math.sqrt(5120) * w 56 checks += 1 57 for b in [0x7f800000, 0xff800000, 0x7fc00000, 0xffc00001]: 58 a = [fbits(1.0)] * 5120 59 a[-1] = b 60 assert run(a) == 0 61 checks += 1 62 print(f'PASS: {checks} envelope cases, exact rational upward rounding, tail invalid-input refusal')