metal : create autorelease pool during library build (llama/4970)

* metal : create autorelease pool during library build

ggml-ci

* test : simplify

ggml-ci
pull/1785/head
Georgi Gerganov 2024-01-17 18:38:39 +02:00
parent 01637e1a4c
commit 2fe5fbfcc2
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
1 changed files with 9 additions and 10 deletions

View File

@ -306,6 +306,7 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) {
return NULL;
}
@autoreleasepool {
// dictionary of preprocessor macros
NSMutableDictionary * prep = [NSMutableDictionary dictionary];
@ -319,9 +320,7 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) {
//[options setFastMathEnabled:false];
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
[options release];
[prep release];
}
}
if (error) {