mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	metal : print error of load pipeline state (#2564)
* metal : print error of load pipeline state * metal : return null if load pipeline failed
This commit is contained in:
		| @@ -163,10 +163,15 @@ struct ggml_metal_context * ggml_metal_init(int n_cb) { | |||||||
|  |  | ||||||
|     // load kernels |     // load kernels | ||||||
|     { |     { | ||||||
|  |         NSError * error = nil; | ||||||
| #define GGML_METAL_ADD_KERNEL(name) \ | #define GGML_METAL_ADD_KERNEL(name) \ | ||||||
|         ctx->function_##name = [ctx->library newFunctionWithName:@"kernel_"#name]; \ |         ctx->function_##name = [ctx->library newFunctionWithName:@"kernel_"#name]; \ | ||||||
|         ctx->pipeline_##name = [ctx->device newComputePipelineStateWithFunction:ctx->function_##name error:nil]; \ |         ctx->pipeline_##name = [ctx->device newComputePipelineStateWithFunction:ctx->function_##name error:&error]; \ | ||||||
|         fprintf(stderr, "%s: loaded %-32s %16p\n", __func__, "kernel_"#name, (void *) ctx->pipeline_##name); |         fprintf(stderr, "%s: loaded %-32s %16p\n", __func__, "kernel_"#name, (void *) ctx->pipeline_##name); \ | ||||||
|  |         if (error) { \ | ||||||
|  |             fprintf(stderr, "%s: load pipeline error: %s\n", __func__, [[error description] UTF8String]); \ | ||||||
|  |             return NULL; \ | ||||||
|  |         } | ||||||
|  |  | ||||||
|         GGML_METAL_ADD_KERNEL(add); |         GGML_METAL_ADD_KERNEL(add); | ||||||
|         GGML_METAL_ADD_KERNEL(add_row); |         GGML_METAL_ADD_KERNEL(add_row); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jhen-Jie Hong
					Jhen-Jie Hong