This commit is contained in:
kchro3 2023-09-07 22:46:56 -07:00
parent 89a96fdb2b
commit ce92d754a3

View file

@ -141,9 +141,6 @@ struct ggml_metal_context * ggml_metal_init(int n_cb) {
ctx->d_queue = dispatch_queue_create("llama.cpp", DISPATCH_QUEUE_CONCURRENT); ctx->d_queue = dispatch_queue_create("llama.cpp", DISPATCH_QUEUE_CONCURRENT);
MTLCompileOptions* options = [MTLCompileOptions new];
options.preprocessorMacros = @{ @"QK_K" : @(64) };
#ifdef GGML_SWIFT #ifdef GGML_SWIFT
// load the default.metallib file // load the default.metallib file
{ {
@ -181,6 +178,8 @@ struct ggml_metal_context * ggml_metal_init(int n_cb) {
} }
#ifdef GGML_QKK_64 #ifdef GGML_QKK_64
MTLCompileOptions* options = [MTLCompileOptions new];
options.preprocessorMacros = @{ @"QK_K" : @(64) };
ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error]; ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
#else #else
ctx->library = [ctx->device newLibraryWithSource:src options:nil error:&error]; ctx->library = [ctx->device newLibraryWithSource:src options:nil error:&error];