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/notebook_section.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 / notebook_section.py` 216 lines · 11036 bytes Raw Blame History 1 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 """Test-only notebook instrument. token_ref.py exports this with generated fixtures. 3 No production dependency; the numerical intervals come from the host oracle. 4 """ 5 def run_section(ctx): 6 import base64 7 import ctypes as C 8 import math 9 import struct 10 import time 11 from fractions import Fraction 12 13 p = _make_payload() 14 name = p['name'] 15 say, put, get = (ctx[k] for k in ('say', 'put', 'get')) 16 load, Params, launch = (ctx[k] for k in ('load', 'Params', 'launch')) 17 objects, controls = ctx['objs'], ctx['controls'] 18 fn = load(objects[name], name) 19 owned = [] 20 21 def alloc(data): 22 d = put(data) 23 owned.append(d) 24 return d 25 26 def raw(case): 27 return base64.b64decode(case['memory']) 28 29 def step(case, base, function=fn): 30 vals = [C.c_void_p(base.value+v) if kind == 'ptr' else C.c_uint32(v) 31 for kind, v in case['args']] 32 return function, case['gx'], case['gy'], Params(vals) 33 34 def check(actual, case): 35 before = raw(case) 36 assert len(actual) == len(before), 'notebook memory size mismatch' 37 unchanged = bytearray(actual) 38 widest = Fraction(0) 39 for off in case.get('bf16_outputs',[]): 40 assert struct.unpack_from('