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

Method wreg

tinygrad/runtime/ops_amd.py:62–69  ·  view source on GitHub ↗
(self, reg:AMDReg, *args:sint, **kwargs:int)

Source from the content-addressed store, hash-verified

60 def pkt3(self, cmd, *vals): self.q(self.pm4.PACKET3(cmd, len(vals) - 1), *vals)
61
62 def wreg(self, reg:AMDReg, *args:sint, **kwargs:int):
63 if bool(args) == bool(kwargs): raise RuntimeError('One (and only one) of *args or **kwargs must be specified')
64 if self.pm4.PACKET3_SET_SH_REG_START <= reg.addr[0] < self.pm4.PACKET3_SET_SH_REG_END:
65 set_packet, set_packet_start = self.pm4.PACKET3_SET_SH_REG, self.pm4.PACKET3_SET_SH_REG_START
66 elif self.pm4.PACKET3_SET_UCONFIG_REG_START <= reg.addr[0] < self.pm4.PACKET3_SET_UCONFIG_REG_START + 2**16-1:
67 set_packet, set_packet_start = self.pm4.PACKET3_SET_UCONFIG_REG, self.pm4.PACKET3_SET_UCONFIG_REG_START
68 else: raise RuntimeError(f'Cannot set {reg.name} ({reg.addr[0]}) via pm4 packet')
69 self.pkt3(set_packet, reg.addr[0] - set_packet_start, *(args or (reg.encode(**kwargs),)))
70
71 @contextlib.contextmanager
72 def pred_exec(self, xcc_mask:int):

Callers 11

set_grbmMethod · 0.95
spi_configMethod · 0.95
pmc_reset_countersMethod · 0.95
pmc_startMethod · 0.95
pmc_readMethod · 0.95
sqtt_setup_execMethod · 0.95
sqtt_userdataMethod · 0.95
sqtt_configMethod · 0.95
sqtt_startMethod · 0.95
sqtt_stopMethod · 0.95
execMethod · 0.95

Calls 2

pkt3Method · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected