mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-01-31 02:21:31 +01:00
metal : create autorelease pool during library build (llama/4970)
* metal : create autorelease pool during library build ggml-ci * test : simplify ggml-ci
This commit is contained in:
parent
01637e1a4c
commit
2fe5fbfcc2
19
ggml-metal.m
19
ggml-metal.m
@ -306,22 +306,21 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dictionary of preprocessor macros
|
@autoreleasepool {
|
||||||
NSMutableDictionary * prep = [NSMutableDictionary dictionary];
|
// dictionary of preprocessor macros
|
||||||
|
NSMutableDictionary * prep = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
#ifdef GGML_QKK_64
|
#ifdef GGML_QKK_64
|
||||||
prep[@"QK_K"] = @(64);
|
prep[@"QK_K"] = @(64);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MTLCompileOptions* options = [MTLCompileOptions new];
|
MTLCompileOptions* options = [MTLCompileOptions new];
|
||||||
options.preprocessorMacros = prep;
|
options.preprocessorMacros = prep;
|
||||||
|
|
||||||
//[options setFastMathEnabled:false];
|
//[options setFastMathEnabled:false];
|
||||||
|
|
||||||
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
|
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
|
||||||
|
}
|
||||||
[options release];
|
|
||||||
[prep release];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user