Skip to content

Commit 7fb39e3

Browse files
committed
metal : restore commandBufferWithUnretainedReferences calls [no ci]
1 parent 2674f02 commit 7fb39e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml-metal/ggml-metal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,7 +4155,7 @@ static enum ggml_status ggml_metal_graph_compute(
41554155
// the main thread commits the first few commands immediately
41564156
// command_buffer[n_cb]
41574157
{
4158-
id<MTLCommandBuffer> command_buffer = [ctx->queue commandBuffer];
4158+
id<MTLCommandBuffer> command_buffer = [ctx->queue commandBufferWithUnretainedReferences];
41594159
ctx->command_buffers[n_cb] = command_buffer;
41604160

41614161
[command_buffer enqueue];
@@ -4165,7 +4165,7 @@ static enum ggml_status ggml_metal_graph_compute(
41654165
// prepare the rest of the command buffers asynchronously
41664166
// command_buffer[0.. n_cb)
41674167
for (int cb_idx = 0; cb_idx < n_cb; ++cb_idx) {
4168-
id<MTLCommandBuffer> command_buffer = [ctx->queue commandBuffer];
4168+
id<MTLCommandBuffer> command_buffer = [ctx->queue commandBufferWithUnretainedReferences];
41694169
ctx->command_buffers[cb_idx] = command_buffer;
41704170

41714171
// always enqueue the first two command buffers

0 commit comments

Comments
 (0)