Update ggml/src/ggml-metal/ggml-metal.m
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
2df2d52d15
commit
bcf86a9d29
1 changed files with 3 additions and 3 deletions
|
@ -509,9 +509,9 @@ static struct ggml_backend_metal_context * ggml_metal_init(ggml_backend_dev_t de
|
||||||
NSString * path_lib = [bundle pathForResource:@"default" ofType:@"metallib"];
|
NSString * path_lib = [bundle pathForResource:@"default" ofType:@"metallib"];
|
||||||
if (path_lib == nil) {
|
if (path_lib == nil) {
|
||||||
// Try to find the resource in the directory where the current binary located.
|
// Try to find the resource in the directory where the current binary located.
|
||||||
NSString *current_binary = [[NSProcessInfo processInfo] arguments][0];
|
NSString * current_binary = [[NSProcessInfo processInfo] arguments][0];
|
||||||
NSString *bin_dir = [current_binary stringByDeletingLastPathComponent];
|
NSString * bin_dir = [current_binary stringByDeletingLastPathComponent];
|
||||||
NSString *default_metallib_path = [NSString pathWithComponents:@[bin_dir, @"default.metallib"]];
|
NSString * default_metallib_path = [NSString pathWithComponents:@[bin_dir, @"default.metallib"]];
|
||||||
if ([[NSFileManager defaultManager] isReadableFileAtPath:default_metallib_path]) {
|
if ([[NSFileManager defaultManager] isReadableFileAtPath:default_metallib_path]) {
|
||||||
GGML_LOG_INFO("%s: found '%s'\n", __func__, [default_metallib_path UTF8String]);
|
GGML_LOG_INFO("%s: found '%s'\n", __func__, [default_metallib_path UTF8String]);
|
||||||
NSDictionary *atts = [[NSFileManager defaultManager] attributesOfItemAtPath:default_metallib_path error:&error];
|
NSDictionary *atts = [[NSFileManager defaultManager] attributesOfItemAtPath:default_metallib_path error:&error];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue