Merge branch 'master' into concedo_experimental
# Conflicts: # CMakeLists.txt # README.md # flake.nix # ggml-metal.m
This commit is contained in:
commit
fb67506c1b
1 changed files with 8 additions and 1 deletions
|
@ -73,6 +73,12 @@ struct ggml_metal_context {
|
||||||
// for now it is easier to work in a separate file
|
// for now it is easier to work in a separate file
|
||||||
static NSString * const msl_library_source = @"see metal.metal";
|
static NSString * const msl_library_source = @"see metal.metal";
|
||||||
|
|
||||||
|
// Here to assist with NSBundle Path Hack
|
||||||
|
@interface GGMLMetalClass : NSObject
|
||||||
|
@end
|
||||||
|
@implementation GGMLMetalClass
|
||||||
|
@end
|
||||||
|
|
||||||
struct ggml_metal_context * ggml_metal_init(void) {
|
struct ggml_metal_context * ggml_metal_init(void) {
|
||||||
fprintf(stderr, "%s: allocating\n", __func__);
|
fprintf(stderr, "%s: allocating\n", __func__);
|
||||||
|
|
||||||
|
@ -108,7 +114,8 @@ struct ggml_metal_context * ggml_metal_init(void) {
|
||||||
NSError * error = nil;
|
NSError * error = nil;
|
||||||
|
|
||||||
//NSString * path = [[NSBundle mainBundle] pathForResource:@"../../examples/metal/metal" ofType:@"metal"];
|
//NSString * path = [[NSBundle mainBundle] pathForResource:@"../../examples/metal/metal" ofType:@"metal"];
|
||||||
NSString * path = @"./ggml-metal.metal";
|
NSBundle * bundle = [NSBundle bundleForClass:[GGMLMetalClass class]];
|
||||||
|
NSString * path = [bundle pathForResource:@"ggml-metal" ofType:@"metal"];
|
||||||
fprintf(stderr, "%s: loading '%s'\n", __func__, [path UTF8String]);
|
fprintf(stderr, "%s: loading '%s'\n", __func__, [path UTF8String]);
|
||||||
|
|
||||||
NSString * src = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
|
NSString * src = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue