From 4335a39f921256ebb0e23a779e6578f80a1ba18c Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Thu, 27 Jun 2024 12:41:49 +0200 Subject: [PATCH] First definition of binding trtllm to rust --- backends/trtllm/csrc/backend.cpp | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 backends/trtllm/csrc/backend.cpp diff --git a/backends/trtllm/csrc/backend.cpp b/backends/trtllm/csrc/backend.cpp new file mode 100644 index 00000000..bc80c192 --- /dev/null +++ b/backends/trtllm/csrc/backend.cpp @@ -0,0 +1,38 @@ +#include "tensorrt_llm/common/logger.h" +#include "tensorrt_llm/executor/executor.h" +#include "tensorrt_llm/plugins/api/tllmPlugin.h" + +# ifdef __cplusplus +extern "C" { +#endif + +#if defined __GNUC__ +#define TGI_BACKEND_PUBLIC __attribute__ ((visibility("default"))) +#else +#pragma message ("Compiler does not support symbol visibility.") +#define TGI_BACKEND_PUBLIC +#endif + +struct tgi_trtllm_backend; + +/*** + * Create and allocate all the required resources to run inference over the provided engine + * @return A `tgi_trtllm_backend` handle + */ +TGI_BACKEND_PUBLIC struct tgi_trtllm_backend *tgi_trtllm_backend_create(); + +/*** + * Free-up all the resources associated with this backend + * @param handle `tgi_trtllm_backend` handle + */ +TGI_BACKEND_PUBLIC void tgi_trtllm_backend_destroy(struct tgi_trtllm_backend *handle); + +/*** + * + * @param handle `tgi_trtllm_backend` handle + */ +TGI_BACKEND_PUBLIC void tgi_trtllm_backend_submit(struct tgi_trtllm_backend *handle); + +#ifdef __cplusplus +}; +#endif \ No newline at end of file