ggerganov HF Staff commited on
Commit
ae08f31
·
unverified ·
1 Parent(s): aadbd67

metal : show compile log messages

Browse files
Files changed (1) hide show
  1. ggml-metal.m +8 -5
ggml-metal.m CHANGED
@@ -277,6 +277,10 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) {
277
  NSURL * libURL = [NSURL fileURLWithPath:libPath];
278
  GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [libPath UTF8String]);
279
  ctx->library = [ctx->device newLibraryWithURL:libURL error:&error];
 
 
 
 
280
  } else {
281
  GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__);
282
 
@@ -315,13 +319,12 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) {
315
  //[options setFastMathEnabled:false];
316
 
317
  ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
 
 
 
 
318
  }
319
  }
320
-
321
- if (error) {
322
- GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]);
323
- return NULL;
324
- }
325
  }
326
 
327
  // print MTL GPU family:
 
277
  NSURL * libURL = [NSURL fileURLWithPath:libPath];
278
  GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [libPath UTF8String]);
279
  ctx->library = [ctx->device newLibraryWithURL:libURL error:&error];
280
+ if (error) {
281
+ GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]);
282
+ return NULL;
283
+ }
284
  } else {
285
  GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__);
286
 
 
319
  //[options setFastMathEnabled:false];
320
 
321
  ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error];
322
+ if (error) {
323
+ GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]);
324
+ return NULL;
325
+ }
326
  }
327
  }
 
 
 
 
 
328
  }
329
 
330
  // print MTL GPU family: