We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fab5620 commit d181635Copy full SHA for d181635
1 file changed
backends/mlx/patches/mlx_metal_device_retain.patch
@@ -0,0 +1,11 @@
1
+diff --git a/mlx/backend/metal/device.cpp b/mlx/backend/metal/device.cpp
2
+--- a/mlx/backend/metal/device.cpp
3
++++ b/mlx/backend/metal/device.cpp
4
+@@ -39,6 +39,7 @@ auto load_device() {
5
+ ?: MTL::CreateSystemDefaultDevice();
6
+ if (!device) {
7
+ throw std::runtime_error("Failed to load device");
8
+ }
9
++ device->retain(); // Ensure device outlives the array/pool
10
+ return device;
11
0 commit comments