diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-10 08:24:39 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-14 08:27:03 +0200 |
| commit | 2c37727e653d2340d8977dd5db4addc767dd81ea (patch) | |
| tree | 578ad6affac511f847a346a0efc6d40ebf6a279f /embed_cuda.h | |
| parent | ec417bcb52f2aa8e24aeec312e8ddbf3a0798056 (diff) | |
| download | ffwd-2c37727e653d2340d8977dd5db4addc767dd81ea.tar.gz ffwd-2c37727e653d2340d8977dd5db4addc767dd81ea.zip | |
gitignore: track new binary and library names
Diffstat (limited to 'embed_cuda.h')
| -rw-r--r-- | embed_cuda.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/embed_cuda.h b/embed_cuda.h new file mode 100644 index 0000000..badff9c --- /dev/null +++ b/embed_cuda.h @@ -0,0 +1,30 @@ +/* + * pplx_embed_cuda.h - CUDA/cuBLAS backend for pplx-embed inference. + */ + +#ifndef PPLX_EMBED_CUDA_H +#define PPLX_EMBED_CUDA_H + +#include "pplx_embed.h" + +typedef struct pplx_cuda_ctx pplx_cuda_ctx_t; + +int pplx_cuda_set_fast_gemm(const char *mode); +int pplx_cuda_set_weights_bf16(int on); + +pplx_cuda_ctx_t *pplx_cuda_load(const char *model_dir); +void pplx_cuda_free(pplx_cuda_ctx_t *ctx); + +const pplx_config_t *pplx_cuda_config(const pplx_cuda_ctx_t *ctx); + +int pplx_cuda_embed_into(pplx_cuda_ctx_t *ctx, const int *token_ids, + int n_tokens, float *out_embedding); +float *pplx_cuda_embed(pplx_cuda_ctx_t *ctx, const int *token_ids, + int n_tokens); +int pplx_cuda_embed_batch(pplx_cuda_ctx_t *ctx, const pplx_input_t *inputs, + int batch, float *out_embeddings); +int pplx_cuda_embed_spans_batch(pplx_cuda_ctx_t *ctx, + const pplx_context_input_t *inputs, + int batch, float *out_embeddings); + +#endif /* PPLX_EMBED_CUDA_H */ |
