Skip to content

Commit f0e70af

Browse files
authored
Fix swift pm load (#2117)
1 parent 86984ca commit f0e70af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlx/backend/metal/device.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ MTL::Library* try_load_bundle(
6969
if (bundle != nullptr) {
7070
std::string resource_path =
7171
std::string(bundle->resourceURL()->fileSystemRepresentation()) + "/" +
72-
lib_name + ".metallib" auto [lib, error] =
73-
load_library_from_path(device, resource_path.c_str());
72+
lib_name + ".metallib";
73+
auto [lib, error] = load_library_from_path(device, resource_path.c_str());
7474
if (lib) {
7575
return lib;
7676
}
@@ -108,7 +108,7 @@ std::pair<MTL::Library*, NS::Error*> load_swiftpm_library(
108108
auto bundles = NS::Bundle::allBundles();
109109
for (int i = 0, c = (int)bundles->count(); i < c; i++) {
110110
auto bundle = reinterpret_cast<NS::Bundle*>(bundles->object(i));
111-
library = try_load_bundle(device, bundle->resourceURL());
111+
library = try_load_bundle(device, bundle->resourceURL(), lib_name);
112112
if (library != nullptr) {
113113
return {library, nullptr};
114114
}

0 commit comments

Comments
 (0)