aboutsummaryrefslogtreecommitdiff
path: root/pplx_embed_cuda.h
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-08 05:14:12 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 08:27:03 +0200
commit96e5dc95397cd9038212dc69cbe0384b24640dc3 (patch)
treee1eda6b5b3f6b4656a7a667edb98931ef797e163 /pplx_embed_cuda.h
parent6554530a57a6d73ff58cdf7e601ec3cab824a4c1 (diff)
downloadffwd-96e5dc95397cd9038212dc69cbe0384b24640dc3.tar.gz
ffwd-96e5dc95397cd9038212dc69cbe0384b24640dc3.zip
cuda: add initial CUDA embedding backend
Diffstat (limited to 'pplx_embed_cuda.h')
-rw-r--r--pplx_embed_cuda.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/pplx_embed_cuda.h b/pplx_embed_cuda.h
new file mode 100644
index 0000000..af90230
--- /dev/null
+++ b/pplx_embed_cuda.h
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+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);
+
+#endif /* PPLX_EMBED_CUDA_H */