diff --git a/.gitignore b/.gitignore index 4d5767d228b86..420e0d6d016a2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.gcno *.gcda *.dot +*.metallib .DS_Store .build/ .cache/ diff --git a/Package.swift b/Package.swift index 5d1400d9b75e7..1ea414cc149fd 100644 --- a/Package.swift +++ b/Package.swift @@ -16,13 +16,12 @@ let resources: [Resource] = [ let additionalSources: [String] = ["ggml-metal.m"] let additionalSettings: [CSetting] = [ .unsafeFlags(["-fno-objc-arc"]), - .define("GGML_SWIFT"), .define("GGML_USE_METAL") ] #else let platforms: [SupportedPlatform]? = nil let exclude: [String] = ["ggml-metal.metal"] -let resources: [String] = [] +let resources: [Resource] = [] let additionalSources: [String] = [] let additionalSettings: [CSetting] = [] #endif diff --git a/ggml-metal.m b/ggml-metal.m index 6fbb8e959dfba..1bf6b965bb82f 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -186,7 +186,7 @@ static void ggml_metal_log(enum ggml_log_level level, const char* format, ...){ // load library { NSBundle * bundle = nil; -#ifdef GGML_SWIFT +#ifdef SWIFT_PACKAGE bundle = SWIFTPM_MODULE_BUNDLE; #else bundle = [NSBundle bundleForClass:[GGMLMetalClass class]]; @@ -204,7 +204,7 @@ static void ggml_metal_log(enum ggml_log_level level, const char* format, ...){ GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [sourcePath UTF8String]); NSString * src = [NSString stringWithContentsOfFile:sourcePath encoding:NSUTF8StringEncoding error:&error]; if (error) { - GGML_METAL_LOG_INFO("%s: error: %s\n", __func__, [[error description] UTF8String]); + GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); return NULL; } @@ -215,9 +215,9 @@ static void ggml_metal_log(enum ggml_log_level level, const char* format, ...){ #endif ctx->library = [ctx->device newLibraryWithSource:src options:options error:&error]; } - + if (error) { - GGML_METAL_LOG_INFO("%s: error: %s\n", __func__, [[error description] UTF8String]); + GGML_METAL_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); return NULL; } }