MCPcopy
hub / github.com/tinygrad/tinygrad / append

Method append

extra/hcq2/hcq2.py:170–175  ·  view source on GitHub ↗
(self, *data, dtype=dtypes.uint32)

Source from the content-addressed store, hash-verified

168 return UOp(Ops.GETADDR, dtypes.uint64, src=(uop,)) if unwrap_after(uop).op in (Ops.BUFFER, Ops.BUFFER_VIEW, Ops.BINARY) else uop
169
170 def append(self, *data, dtype=dtypes.uint32):
171 for d in data:
172 if isinstance(d, int): self.blob += struct.pack(f'<{dtype.fmt}', d)
173 else:
174 self.patches.append((len(self.blob), self.get_dev_addr(d), dtype))
175 self.blob += struct.pack(f'<{dtype.fmt}', 0)
176
177 def q(self, *values): self.append(*values)
178

Callers 15

qMethod · 0.95
lower_kernargsFunction · 0.95
gen_statsFunction · 0.80
gen_diffFunction · 0.80
tag_uopFunction · 0.80
finalize_afterFunction · 0.80
replace_input_bufferFunction · 0.80
callify.pyFile · 0.80
add_to_ctxFunction · 0.80
partitionFunction · 0.80
select_first_initedFunction · 0.80

Calls 1

get_dev_addrMethod · 0.95

Tested by 15

test_matmulFunction · 0.64
test_matmulFunction · 0.64
format_structFunction · 0.64
format_structFunction · 0.64
test_free_lastMethod · 0.64
test_diamondMethod · 0.64
_has_metadataMethod · 0.64
fxnMethod · 0.64
bidir_appendFunction · 0.64
track_visitMethod · 0.64
bpm_visitMethod · 0.64