MCPcopy
hub / github.com/tinygrad/tinygrad / nimm_set

Function nimm_set

tinygrad/renderer/nir.py:70–72  ·  view source on GitHub ↗
(imm:mesa.nir_def, x, dtype:DType)

Source from the content-addressed store, hash-verified

68 return mov
69
70def nimm_set(imm:mesa.nir_def, x, dtype:DType):
71 instr = ctypes.cast(imm.parent_instr, ctypes.POINTER(mesa.nir_load_const_instr))
72 struct.pack_into(unwrap(dtype.fmt), (ctypes.c_ubyte * dtype.itemsize).from_address(ctypes.addressof(instr.contents.value)), 0, truncate[dtype](x))
73
74@nir_instr(nc=1, bs=lambda dtype: dtype.bitsize)
75def nimm(b:mesa.nir_builder, x, dtype:DType) -> mesa.nir_def:

Callers 2

nimmFunction · 0.85
postrenderMethod · 0.85

Calls 2

unwrapFunction · 0.90
castMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…