1 import pycuda.driver as drv
   2 
   3 
   4 drv.init()
   5 print "%d device(s) found." % drv.Device.count()
   6 
   7 for ordinal in range(drv.Device.count()):
   8     dev = drv.Device(ordinal)
   9     print("Device #%d: %s" % (ordinal, dev.name()))
  10     print("  Compute Capability: %d.%d" % dev.compute_capability())
  11     print("  Total Memory: %s KB" % (dev.total_memory()//(1024)))
  12     atts = [(str(att), value)
  13             #Python 3.1 and 2.7
  14             for att, value in dev.get_attributes().items()]
  15             #Python 2.7
  16             #for att, value in dev.get_attributes().iteritems()]
  17     atts.sort()
  18     
  19     for att, value in atts:
  20         print("  %s: %s" % (att, value))


CategoryPyCuda

PyCuda/Examples/DumpProperties (last edited 2014-09-26 13:46:31 by 2001:67c:10ec:52c7:8000::1503)