Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Cmlx/include/mlx/c/metal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern "C" {
/**@{*/

int mlx_metal_is_available(bool* res);
int mlx_metal_set_metallib_path(const char* path);
int mlx_metal_start_capture(const char* path);
int mlx_metal_stop_capture(void);

Expand Down
2 changes: 1 addition & 1 deletion Source/Cmlx/mlx
2 changes: 1 addition & 1 deletion Source/Cmlx/mlx-c
Submodule mlx-c updated 2 files
+9 −0 mlx/c/metal.cpp
+1 −0 mlx/c/metal.h
17 changes: 17 additions & 0 deletions Source/MLX/GPU+Metal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ public enum GPU {
Memory.clearCache()
}

/// Set a custom path to the mlx.metallib file.
///
/// Must be called before any MLX operation (e.g., before `Pipeline.load()`).
/// Use this when running inside a plugin bundle where the default search paths
/// don't apply.
///
/// The override is stored as process-global state inside a single MLX image. If
/// the process ends up with two copies of MLX linked in (see the "XCode (2)"
/// note in the README about diamond dependencies), this may set the path on a
/// different copy than the one that loads the device, and the override will be
/// silently ignored. Ensure there is exactly one MLX instance in the process.
///
/// - Parameter path: Absolute path to `mlx.metallib`
public static func setMetallibPath(_ path: String) {
mlx_metal_set_metallib_path(path)
}

/// Start capturing a metal trace into the given file.
///
/// > There are several requirements for this to be used.
Expand Down