MCPcopy
hub / github.com/tinygrad/tinygrad / format_struct

Function format_struct

extra/hip_gpu_driver/test_pm4.py:37–43  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

35CS_W32_EN = 1 << 15
36
37def format_struct(s):
38 sdats = []
39 for field_name, field_type in s._fields_:
40 dat = getattr(s, field_name)
41 if isinstance(dat, int): sdats.append(f"{field_name}:0x{dat:X}")
42 else: sdats.append(f"{field_name}:{dat}")
43 return sdats
44
45if __name__ == "__main__":
46 dev = Device["KFD"]

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…