From f0e70afff0789543dea792bcb6223ca658af8a89 Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Thu, 24 Apr 2025 10:58:29 -0700 Subject: [PATCH] Fix swift pm load (#2117) --- mlx/backend/metal/device.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mlx/backend/metal/device.cpp b/mlx/backend/metal/device.cpp index 43f82893b..1321fb8d9 100644 --- a/mlx/backend/metal/device.cpp +++ b/mlx/backend/metal/device.cpp @@ -69,8 +69,8 @@ MTL::Library* try_load_bundle( if (bundle != nullptr) { std::string resource_path = std::string(bundle->resourceURL()->fileSystemRepresentation()) + "/" + - lib_name + ".metallib" auto [lib, error] = - load_library_from_path(device, resource_path.c_str()); + lib_name + ".metallib"; + auto [lib, error] = load_library_from_path(device, resource_path.c_str()); if (lib) { return lib; } @@ -108,7 +108,7 @@ std::pair load_swiftpm_library( auto bundles = NS::Bundle::allBundles(); for (int i = 0, c = (int)bundles->count(); i < c; i++) { auto bundle = reinterpret_cast(bundles->object(i)); - library = try_load_bundle(device, bundle->resourceURL()); + library = try_load_bundle(device, bundle->resourceURL(), lib_name); if (library != nullptr) { return {library, nullptr}; }