diff options
author | Georgi Gerganov <ggerganov@gmail.com> | 2024-01-25 11:26:17 +0200 |
---|---|---|
committer | Georgi Gerganov <ggerganov@gmail.com> | 2024-01-25 11:26:17 +0200 |
commit | ddc5a5033f948dc7ab0a3a6ec2d914d13c274077 (patch) | |
tree | 18b3ddb07841f6c2a8919ecb028d1b69f23b5ee2 | |
parent | cd4fddb29f81d6a1f6d51a0c016bc6b486d68def (diff) |
metal : show compile log messages
-rw-r--r-- | ggml-metal.m | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ggml-metal.m b/ggml-metal.m index 4b3eb491..60fef1a1 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -277,6 +277,10 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) { NSURL * libURL = [NSURL fileURLWithPath:libPath]; GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [libPath UTF8String]); ctx->library = [ctx->device newLibraryWithURL:libURL error:&error]; + if (error) { + GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); + return NULL; + } } else { GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__); @@ -315,13 +319,12 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) { //[options setFastMathEnabled:false]; ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error]; + if (error) { + GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); + return NULL; + } } } - - if (error) { - GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); - return NULL; - } } // print MTL GPU family: |