forked from tinygrad/tinygrad
metal: workaround for transfers sync issue (#11622)
* metal: workaround for transfers sync issue * metal tracsfer sync is broken * hm * rm it? * keep it
This commit is contained in:
@@ -221,6 +221,9 @@ class MetalAllocator(LRUAllocator[MetalDevice]):
|
||||
msg("setLabel:")(src_command_buffer, to_ns_str(f"COPY {src_dev.device} -> {dest_dev.device}"))
|
||||
msg("commit")(src_command_buffer)
|
||||
src_dev.mtl_buffers_in_flight.append(src_command_buffer)
|
||||
# Transfers currently synchronize the completion. Otherwise, copies can sometimes lead to incorrect values.
|
||||
# There is no real metal multidevice support for now, so transfer is used only for tests.
|
||||
src_dev.synchronize()
|
||||
def _cp_mv(self, dst, src, prof_desc):
|
||||
with cpu_profile(prof_desc, self.dev.device, is_copy=True): dst[:] = src
|
||||
def _as_buffer(self, src:MetalBuffer) -> memoryview:
|
||||
|
||||
Reference in New Issue
Block a user