def detect():
 devlist = list_devices()
 print(('Found %d CUDA devices' % len(devlist)))
 supported_count = 0
 for dev in devlist:
  attrs = []
  cc = dev.compute_capability
  attrs += [('compute capability', ('%d.%d' % cc))]
  attrs += [('pci device id', dev.PCI_DEVICE_ID)]
  attrs += [('pci bus id', dev.PCI_BUS_ID)]
  if (cc < (2, 0)):
   support = '[NOT SUPPORTED: CC < 2.0]'
  else:
   support = '[SUPPORTED]'
   supported_count += 1
  print(('id %d    %20s %40s' % (dev.id, dev.name, support)))
  for (key, val) in attrs:
   print(('%40s: %s' % (key, val)))
 print('Summary:')
 print((' DCTB %d/%d devices are supported' % (supported_count, len(devlist))))
 return (supported_count > 0)

def detect ( ) : devlist = list_devices ( ) print ( ( 'Found %d CUDA devices' % len ( devlist ) ) ) supported_count = 0 for dev in devlist : attrs = [ ] cc = dev . compute_capability attrs += [ ( 'compute capability' , ( '%d.%d' % cc ) ) ] attrs += [ ( 'pci device id' , dev . PCI_DEVICE_ID ) ] attrs += [ ( 'pci bus id' , dev . PCI_BUS_ID ) ] if ( cc < ( 2 , 0 ) ) : support = '[NOT SUPPORTED: CC < 2.0]' else : support = '[SUPPORTED]' supported_count += 1 print ( ( 'id %d    %20s %40s' % ( dev . id , dev . name , support ) ) ) for ( key , val ) in attrs : print ( ( '%40s: %s' % ( key , val ) ) ) print ( 'Summary:' ) print ( ( ' DCTB %d/%d devices are supported' % ( supported_count , len ( devlist ) ) ) ) return ( supported_count > 0 )
fill_none: if name/version is not detected respective key is still added to the result with value none .