parameters: ()
return_statement: return supported_count > 0
docstring: Detect supported CUDA hardware and print a summary of the detected hardware.
  
      Returns a boolean indicating whether any supported devices were detected.
docstring_summary: Detect supported CUDA hardware and print a summary of the detected hardware.
docstring_tokens: Detect supported CUDA hardware and print a summary of the detected hardware .
function: def detect():
      """
      Detect supported CUDA hardware and print a summary of the detected hardware.
  
      Returns a boolean indicating whether any supported devices were detected.
      """
      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('\t%d/%d devices are supported' % (supported_count, len(devlist)))
      return supported_count > 0
function_tokens: 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 ( '\t%d/%d devices are supported' % ( supported_count , len ( devlist ) ) ) return supported_count > 0