MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / print_property

Function print_property

python/1_GettingStarted/deviceQuery/deviceQuery.py:47–62  ·  view source on GitHub ↗

Helper function to print device properties with aligned formatting. Parameters ---------- label : str Property label value : any Property value indent : int Number of spaces for indentation (default: 2)

(label, value, indent=2)

Source from the content-addressed store, hash-verified

45
46
47def print_property(label, value, indent=2):
48 """
49 Helper function to print device properties with aligned formatting.
50
51 Parameters
52 ----------
53 label : str
54 Property label
55 value : any
56 Property value
57 indent : int
58 Number of spaces for indentation (default: 2)
59 """
60 field_width = 47
61 spaces = " " * indent
62 print(f"{spaces}{label:<{field_width}}{value}")
63
64
65def fmt_bytes(size_in_bytes):

Callers 1

print_device_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected