mirror of
https://github.com/ollama/ollama.git
synced 2026-04-17 15:53:27 +02:00
* 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
56 lines
858 B
C
56 lines
858 B
C
/* Copyright © 2023-2024 Apple Inc. */
|
|
|
|
#ifndef MLX_STRING_H
|
|
#define MLX_STRING_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* \defgroup mlx_string String
|
|
* MLX string object.
|
|
*/
|
|
/**@{*/
|
|
|
|
/**
|
|
* A MLX string object.
|
|
*/
|
|
typedef struct mlx_string_ {
|
|
void* ctx;
|
|
} mlx_string;
|
|
|
|
/**
|
|
* Returns a new empty string.
|
|
*/
|
|
mlx_string mlx_string_new(void);
|
|
|
|
/**
|
|
* Returns a new string, copying contents from `str`, which must end with `\0`.
|
|
*/
|
|
mlx_string mlx_string_new_data(const char* str);
|
|
|
|
/**
|
|
* Set string to src string.
|
|
*/
|
|
int mlx_string_set(mlx_string* str, const mlx_string src);
|
|
|
|
/**
|
|
* Returns a pointer to the string contents.
|
|
* The pointer is valid for the life duration of the string.
|
|
*/
|
|
const char* mlx_string_data(mlx_string str);
|
|
|
|
/**
|
|
* Free string.
|
|
*/
|
|
int mlx_string_free(mlx_string str);
|
|
|
|
/**@}*/
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|