Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Nov 5, 2023
1 parent 42e642a commit dd3732a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9,905 deletions.
20 changes: 1 addition & 19 deletions ggml-metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,10 @@
#undef GGML_METAL_DECL_KERNEL
};

extern const char ggml_metal_file[];
extern const size_t ggml_metal_file_len;

// MSL code
// TODO: move the contents here when ready
// 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
Expand Down Expand Up @@ -196,20 +193,6 @@ static void ggml_metal_log(enum ggml_log_level level, const char* format, ...){
ctx->d_queue = dispatch_queue_create("ggml-metal", DISPATCH_QUEUE_CONCURRENT);

// load library
#if 1
NSString * const msl_library_source = [[NSString alloc] initWithBytes: ggml_metal_file length: ggml_metal_file_len encoding: NSASCIIStringEncoding];
// compile from source string and show compile log
{
NSError * error = nil;

ctx->library = [ctx->device newLibraryWithSource:msl_library_source options:nil error:&error];
if (error) {
GGML_METAL_LOG_INFO("%s: error: %s\n", __func__, [[error description] UTF8String]);
return NULL;
}
}
[msl_library_source release];
#elif GGML_SWIFT
{
NSBundle * bundle = nil;
#ifdef SWIFT_PACKAGE
Expand Down Expand Up @@ -251,7 +234,6 @@ static void ggml_metal_log(enum ggml_log_level level, const char* format, ...){
return NULL;
}
}
#endif

// load kernels
{
Expand Down
Loading

0 comments on commit dd3732a

Please sign in to comment.