MCPcopy
hub / github.com/tinygrad/tinygrad / emit

Method emit

docs/abstractions4.py:110–114  ·  view source on GitHub ↗
(self, inst, target=None)

Source from the content-addressed store, hash-verified

108 def __init__(self): self.instructions, self.labels, self.pos = [], {}, 0
109 def label(self, name): self.labels[name] = self.pos
110 def emit(self, inst, target=None):
111 self.instructions.append(inst)
112 inst._target, inst._pos = target, self.pos
113 self.pos += inst.size()
114 return inst
115 def waitcnt(self, lgkm=None, vm=None):
116 # Wait for memory operations. lgkm=N waits until N lgkm ops remain, vm=N waits until N vmem ops remain.
117 vmcnt, lgkmcnt, expcnt = vm if vm is not None else 63, lgkm if lgkm is not None else 63, 7

Callers 15

test_simpleMethod · 0.95
test_diamondMethod · 0.95
test_loopMethod · 0.95
test_loop_branchMethod · 0.95
test_loop_breakMethod · 0.95
test_switchMethod · 0.95
test_ping_pongMethod · 0.95
test_colored_blocksMethod · 0.95
test_jump_back_to_endMethod · 0.95
custom_handwrittenFunction · 0.95
custom_data_depsFunction · 0.95
waitcntMethod · 0.95

Calls 2

appendMethod · 0.80
sizeMethod · 0.45

Tested by 11

test_simpleMethod · 0.76
test_diamondMethod · 0.76
test_loopMethod · 0.76
test_loop_branchMethod · 0.76
test_loop_breakMethod · 0.76
test_switchMethod · 0.76
test_ping_pongMethod · 0.76
test_colored_blocksMethod · 0.76
test_jump_back_to_endMethod · 0.76
custom_handwrittenFunction · 0.76
custom_data_depsFunction · 0.76