diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-25 17:58:46 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-25 17:58:46 +0200 |
| commit | f7ef995ff54da671f9d7665b3d92ff25934c1e8b (patch) | |
| tree | 1401d04c0f464b32bffd63f787a63a82c6959e97 /libffwd/mlx.h | |
| parent | 417f861f3661c2253258b5683a627d961e81fc68 (diff) | |
| download | ffwd-f7ef995ff54da671f9d7665b3d92ff25934c1e8b.tar.gz ffwd-f7ef995ff54da671f9d7665b3d92ff25934c1e8b.zip | |
chore: run clang-format
Diffstat (limited to 'libffwd/mlx.h')
| -rw-r--r-- | libffwd/mlx.h | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/libffwd/mlx.h b/libffwd/mlx.h index d8a915f..e4e2a8e 100644 --- a/libffwd/mlx.h +++ b/libffwd/mlx.h @@ -38,7 +38,7 @@ typedef struct { */ FFWD_API ffwd_mlx_ctx_t *ffwd_mlx_load(const char *model_dir); FFWD_API ffwd_mlx_ctx_t *ffwd_mlx_load_with_options(const char *model_dir, - const ffwd_mlx_options_t *opts); + const ffwd_mlx_options_t *opts); FFWD_API void ffwd_mlx_free(ffwd_mlx_ctx_t *ctx); @@ -49,7 +49,7 @@ FFWD_API void ffwd_mlx_free(ffwd_mlx_ctx_t *ctx); */ FFWD_API ffwd_mlx_late_ctx_t *ffwd_mlx_late_load(const char *model_dir); FFWD_API ffwd_mlx_late_ctx_t *ffwd_mlx_late_load_with_options(const char *model_dir, - const ffwd_mlx_options_t *opts); + const ffwd_mlx_options_t *opts); FFWD_API void ffwd_mlx_late_free(ffwd_mlx_late_ctx_t *ctx); FFWD_API const ffwd_config_t *ffwd_mlx_late_config(const ffwd_mlx_late_ctx_t *ctx); @@ -72,9 +72,9 @@ FFWD_API int ffwd_mlx_late_encode_tokens( * and copy back only final candidate scores. */ FFWD_API ffwd_mlx_late_vectors_t *ffwd_mlx_late_encode_tokens_device(ffwd_mlx_late_ctx_t *ctx, - const int *token_ids, - int n_tokens, - int normalize); + const int *token_ids, + int n_tokens, + int normalize); FFWD_API void ffwd_mlx_late_vectors_free(ffwd_mlx_late_vectors_t *vecs); FFWD_API int ffwd_mlx_late_vectors_token_count(const ffwd_mlx_late_vectors_t *vecs); FFWD_API int ffwd_mlx_late_vectors_dim(const ffwd_mlx_late_vectors_t *vecs); @@ -87,29 +87,28 @@ FFWD_API int ffwd_mlx_late_vectors_copy(const ffwd_mlx_late_vectors_t *vecs, flo * Returns NULL on error; the handle must not outlive ctx. */ FFWD_API ffwd_mlx_late_vectors_t *ffwd_mlx_late_encode_docs_device(ffwd_mlx_late_ctx_t *ctx, - const int *const *doc_ids, - const int *n_tokens, - const int *const *keep, - const int *n_keep, - int n_docs, - int normalize, - int *out_offsets); + const int *const *doc_ids, + const int *n_tokens, + const int *const *keep, + const int *n_keep, + int n_docs, + int normalize, + int *out_offsets); /* Device-resident select/concat primitives, retained for the late-interaction * verification harness (tests/integration/check_late_interaction.py); the server rerank * path uses ffwd_mlx_late_encode_docs_device. */ FFWD_API ffwd_mlx_late_vectors_t *ffwd_mlx_late_vectors_concat( ffwd_mlx_late_ctx_t *ctx, const ffwd_mlx_late_vectors_t *const *items, int count); -FFWD_API ffwd_mlx_late_vectors_t * -ffwd_mlx_late_vectors_select(ffwd_mlx_late_ctx_t *ctx, - const ffwd_mlx_late_vectors_t *vecs, - const int *token_indices, - int count); +FFWD_API ffwd_mlx_late_vectors_t *ffwd_mlx_late_vectors_select(ffwd_mlx_late_ctx_t *ctx, + const ffwd_mlx_late_vectors_t *vecs, + const int *token_indices, + int count); FFWD_API int ffwd_mlx_late_maxsim_batch_device(ffwd_mlx_late_ctx_t *ctx, - const ffwd_mlx_late_vectors_t *query, - const ffwd_mlx_late_vectors_t *docs, - const int *doc_offsets, - int docs_count, - float *scores); + const ffwd_mlx_late_vectors_t *query, + const ffwd_mlx_late_vectors_t *docs, + const int *doc_offsets, + int docs_count, + float *scores); /* * Compute embedding for token_ids[0..n_tokens-1]. @@ -132,29 +131,29 @@ ffwd_mlx_encode_into(ffwd_mlx_ctx_t *ctx, const int *token_ids, int n_tokens, fl * Returns 0 on success, -1 on error. */ FFWD_API int ffwd_mlx_encode_batch(ffwd_mlx_ctx_t *ctx, - const ffwd_input_t *inputs, - int batch, - float *out_embeddings); + const ffwd_input_t *inputs, + int batch, + float *out_embeddings); /* * Run one contextual sequence and pool selected token spans. * Returns 0 on success, -1 on error. */ FFWD_API int ffwd_mlx_encode_spans(ffwd_mlx_ctx_t *ctx, - const int *token_ids, - int n_tokens, - const ffwd_span_t *spans, - int n_spans, - float *out_embeddings); + const int *token_ids, + int n_tokens, + const ffwd_span_t *spans, + int n_spans, + float *out_embeddings); /* * Run a padded dense contextual document batch and pool every selected span. * out_embeddings contains spans in document order. */ FFWD_API int ffwd_mlx_encode_spans_batch(ffwd_mlx_ctx_t *ctx, - const ffwd_context_input_t *inputs, - int batch, - float *out_embeddings); + const ffwd_context_input_t *inputs, + int batch, + float *out_embeddings); /* Get the config (so ffwd_cli.c can read hidden_size etc.) */ FFWD_API const ffwd_config_t *ffwd_mlx_config(const ffwd_mlx_ctx_t *ctx); |
