From b36dd472bb11caa233b007270ab08b6a7b1fc91b Mon Sep 17 00:00:00 2001 From: "Alex Chi Z." <4198311+skyzh@users.noreply.github.com> Date: Tue, 29 Apr 2025 10:30:36 -0400 Subject: [PATCH] return library if it is successfully loaded (#2131) --- mlx/backend/metal/device.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlx/backend/metal/device.cpp b/mlx/backend/metal/device.cpp index 1321fb8d9..cb851b57e 100644 --- a/mlx/backend/metal/device.cpp +++ b/mlx/backend/metal/device.cpp @@ -166,6 +166,7 @@ MTL::Library* load_library( << error->localizedDescription()->utf8String(); throw std::runtime_error(msg.str()); } + return lib; } // We have been given a path so try to load from lib_path / lib_name.metallib @@ -178,6 +179,7 @@ MTL::Library* load_library( << "> with error " << error->localizedDescription()->utf8String(); throw std::runtime_error(msg.str()); } + return lib; } // Try to load the colocated library