Method: ComputeUnit::Device.vendor_lookup

Defined in:
lib/compute_unit/device.rb

.vendor_lookup(vendor_id) ⇒ String

Returns - the name of the subsystem vendor with a possible translation.

Returns:

  • (String)
    • the name of the subsystem vendor with a possible translation



365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/compute_unit/device.rb', line 365

def self.vendor_lookup(vendor_id)
  # "1002  Advanced Micro Devices, Inc. [AMD/ATI]\n"
  re = Regexp.new(/\A#{vendor_id}/)
  d = pci_database.find do |line|
    re.match(line)
  rescue ArgumentError
    next
  end
  return manual_vendor_lookup(vendor_id) unless d

  name = d[/\w+\s+(.*)\n/, 1]
  name_translation(name)
end