metal raise when command queue is not created (#6044)

* metal raise when command queue is not created

* dont do that
This commit is contained in:
nimlgen
2024-08-12 18:30:37 +03:00
committed by GitHub
parent 164ca5632e
commit e9024c691f

View File

@@ -99,6 +99,8 @@ class MetalDevice(Compiled):
def __init__(self, device:str):
self.device = Metal.MTLCreateSystemDefaultDevice()
self.mtl_queue = self.device.newCommandQueueWithMaxCommandBufferCount_(1024)
if self.mtl_queue is None: raise RuntimeError("Cannot allocate a new command queue")
self.mtl_buffers_in_flight: List[Any] = []
self.mv_in_metal: List[memoryview] = []