Skip to content

Commit 612dabb

Browse files
committed
metal : create autorelease pool during library build (llama/4970)
* metal : create autorelease pool during library build ggml-ci * test : simplify ggml-ci
1 parent 006c363 commit 612dabb

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/ggml-metal.m

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,22 +306,21 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
306306
return NULL;
307307
}
308308

309-
// dictionary of preprocessor macros
310-
NSMutableDictionary * prep = [NSMutableDictionary dictionary];
309+
@autoreleasepool {
310+
// dictionary of preprocessor macros
311+
NSMutableDictionary * prep = [NSMutableDictionary dictionary];
311312

312313
#ifdef GGML_QKK_64
313-
prep[@"QK_K"] = @(64);
314+
prep[@"QK_K"] = @(64);
314315
#endif
315316

316-
MTLCompileOptions* options = [MTLCompileOptions new];
317-
options.preprocessorMacros = prep;
317+
MTLCompileOptions* options = [MTLCompileOptions new];
318+
options.preprocessorMacros = prep;
318319

319-
//[options setFastMathEnabled:false];
320+
//[options setFastMathEnabled:false];
320321

321-
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
322-
323-
[options release];
324-
[prep release];
322+
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
323+
}
325324
}
326325

327326
if (error) {

0 commit comments

Comments
 (0)