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

Function fmt_bytes

python/1_GettingStarted/deviceQuery/deviceQuery.py:65–67  ·  view source on GitHub ↗

Format bytes to human-readable string with MBytes.

(size_in_bytes)

Source from the content-addressed store, hash-verified

63
64
65def fmt_bytes(size_in_bytes):
66 """Format bytes to human-readable string with MBytes."""
67 return f"{size_in_bytes / (1024 * 1024):.0f} MBytes ({size_in_bytes} bytes)"
68
69
70def fmt_hz(rate_in_khz):

Callers 1

print_device_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected