Files
ollama/x/imagegen/mlx/mlx_dynamic.h
Daniel Hiltgen 10e51c5177 MLX: add header vendoring and remove go build tag (#14642)
* prefer rocm v6 on windows

Avoid building with v7 - more changes are needed

* MLX: add header vendoring and remove go build tag

This switches to using a vendoring approach for the mlx-c headers so that Go
can build without requiring a cmake first.  This enables building the new MLX
based code by default.  Every time cmake runs, the headers are refreshed, so we
can easily keep them in sync when we bump mlx versions.  Basic Windows
and Linux support are verified.

* ci: harden for flaky choco repo servers

CI sometimes fails due to choco not actually installing cache.  Since it just speeds up the build, we can proceed without.

* review comments
2026-03-09 17:24:45 -07:00

24 lines
521 B
C

// mlx_dynamic.h - Dynamic loading interface for MLX-C library
#ifndef MLX_DYNAMIC_H
#define MLX_DYNAMIC_H
#ifdef __cplusplus
extern "C" {
#endif
// Initialize the MLX dynamic library from a specific path
// Returns 0 on success, -1 on failure
int mlx_dynamic_init_path(const char* path);
// Get the last error message from dynamic loading
const char* mlx_dynamic_error(void);
// Get the library handle (for use by generated wrappers)
void* mlx_get_handle(void);
#ifdef __cplusplus
}
#endif
#endif // MLX_DYNAMIC_H