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/formats.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 / formats.py` 34 lines · 1452 bytes Raw Blame History 1 #!/usr/bin/env python3 2 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 """Test-only growable format registry checks; no producer implementation here.""" 4 import pathlib 5 import subprocess 6 import sys 7 8 producer, source, expected, output = sys.argv[1:] 9 text = pathlib.Path(source).read_text() 10 out = pathlib.Path(output) 11 reference = pathlib.Path(expected).read_bytes() 12 # The SOPP branch-reference format remains ID4 by schema; all other IDs are names, not indexes. 13 rows = [] 14 for line in text.splitlines(): 15 cells = line.split() 16 if cells and cells[0] in ('F', 'B', 'D', 'I') and cells[1] != '4': 17 cells[1] = str(int(cells[1])+`1000000`) 18 line = ' '.join(cells) 19 rows.append(line) 20 variants = { 21 'sparse-format-ids': '\n'.join(rows)+'\n', 22 'growing-format-count': text + ''.join(f'F {i} 1\nB {i} 0 0 32 0\n' for i in range(11, 35)), 23 'undefined-format': text + 'I `1000002`\n', 24 } 25 for name, body in variants.items(): 26 table = out/(name+'.isa') 27 table.write_text(body) 28 result = subprocess.run([producer, str(table)], capture_output=True, timeout=60) 29 if name == 'undefined-format': 30 assert result.returncode == 4 and not result.stdout, result 31 print('CONTROL undefined-format CAUGHT exit=4 no object') 32 else: 33 assert result.returncode == 0 and not result.stderr and result.stdout == reference, (name, result) 34 print(f'PASS {name} byte-identical FP8 object (no capacity ceiling)')