MCPcopy
hub / github.com/tinygrad/tinygrad / AMDIP

Class AMDIP

tinygrad/runtime/support/amd.py:17–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16@dataclass
17class AMDIP:
18 name:str; version:tuple[int, int, int]; bases:dict[int, tuple[int, ...]] # noqa: E702
19
20 @functools.cached_property
21 def regs(self): return import_asic_regs(self.name, self.version, cls=functools.partial(AMDReg, bases=self.bases))
22
23 def __getattr__(self, name:str):
24 if name in self.regs: return self.regs[name]
25 if (name10:=name.replace('reg', 'mm')) in self.regs: return self.regs[name10]
26 raise AttributeError(f"{self.name.upper()} has no register {name}")
27
28# load the greatest module with matching major version that's less than or equal to the target version
29# this is not universally correct, see below for an example, but appears reliable for most recent gpus

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…