mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
nv sync before free for binded commands (#4759)
* nv sync before free for binded commands * shorter comment
This commit is contained in:
parent
e614b7c696
commit
fe26d3fefe
1 changed files with 3 additions and 1 deletions
|
|
@ -86,7 +86,9 @@ class NVCompiler(Compiler):
|
|||
class HWQueue:
|
||||
def __init__(self): self.q, self.binded_device, self.next_cmd_index = [], None, 0
|
||||
def __del__(self):
|
||||
if self.binded_device is not None: self.binded_device._gpu_free(self.hw_page)
|
||||
if self.binded_device is not None:
|
||||
self.binded_device.synchronize() # Synchronize to ensure the buffer is no longer in use.
|
||||
self.binded_device._gpu_free(self.hw_page)
|
||||
|
||||
def ptr(self) -> int: return self.next_cmd_index
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue