MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / pci_probe_device

Method pci_probe_device

tinygrad/runtime/support/system.py:83–86  ·  view source on GitHub ↗
(self, device:str, dev_id:int, vendor:int, devices:tuple[tuple[int, tuple[int, ...]], ...], base_class:int|None=None)

Source from the content-addressed store, hash-verified

81 return [(APLRemotePCIDevice if OSX else PCIDevice, x) for x in System.pci_scan_bus(vendor, devices, base_class)]
82
83 def pci_probe_device(self, device:str, dev_id:int, vendor:int, devices:tuple[tuple[int, tuple[int, ...]], ...], base_class:int|None=None):
84 try: cl, pcibus = (ds:=hcq_filter_visible_devices(self.list_devices(vendor, devices, base_class), device))[dev_id]
85 except IndexError: raise RuntimeError(f"{device}:{dev_id} does not exist ({pluralize('device', len(ds))} available)")
86 return cl(device[:2], pcibus)
87
88 def pci_setup_usb_bars(self, usb:CustomASM24Controller|ASM24Controller, gpu_bus:int, mem_base:int, pref_mem_base:int) -> dict[int, tuple[int, int]]:
89 for bus in range(gpu_bus):

Callers 1

__init__Method · 0.80

Calls 4

list_devicesMethod · 0.95
pluralizeFunction · 0.90
clFunction · 0.85

Tested by

no test coverage detected