File: dump_properties.py

package info (click to toggle)
pycuda 2022.2.2~dfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 1,724 kB
  • sloc: python: 13,136; cpp: 6,952; makefile: 61
file content (19 lines) | stat: -rw-r--r-- 533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pycuda.driver as drv



drv.init()
print("%d device(s) found." % drv.Device.count())

for ordinal in range(drv.Device.count()):
    dev = drv.Device(ordinal)
    print("Device #%d: %s" % (ordinal, dev.name()))
    print("  Compute Capability: %d.%d" % dev.compute_capability())
    print("  Total Memory: %s KB" % (dev.total_memory()//(1024)))
    atts = [(str(att), value) 
            for att, value in list(dev.get_attributes().items())]
    atts.sort()
    
    for att, value in atts:
        print(f"  {att}: {value}")