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/tests/amd-exec/log.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 / tests / amd-exec / log.py` 35 lines · 1581 bytes Raw Blame History 1 #!/usr/bin/env python3 2 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 """Test instrument: CDNA3 V_LOG_F32 base2, 1ULP, FTZ (ISA p187).""" 4 from decimal import Decimal, localcontext 5 from fractions import Fraction 6 from functools import lru_cache 7 import pathlib 8 import random 9 import runpy 10 import struct 11 import subprocess 12 import sys 13 ref=runpy.run_path(str(pathlib.Path(__file__).with_name('attention.py'))) 14 finite,enclosure,ftz= (ref[n] for n in ('finite','enclosure','ftz')) 15 @lru_cache(None) 16 def logbound(bits): 17 x=finite(ftz(bits)) 18 assert x>0 19 if x==1: return Fraction(0),Fraction(0) 20 with localcontext() as ctx: 21 ctx.prec=120 22 value=(Decimal(x.numerator)/Decimal(x.denominator)).ln()/Decimal(2).ln() 23 return enclosure(Fraction(value)) 24 def suite(exe): 25 rng=random.Random(942033) 26 values=list(range(0x3f7fff00,0x3f800100))+[rng.randrange(0x800000,0x7f800000) for _ in range(4096)] 27 result=subprocess.run([exe],input=b''.join(struct.pack('