1#pragma once
 2
 3#include "ggml-backend.h"
 4
 5#ifdef  __cplusplus
 6extern "C" {
 7#endif
 8
 9#define RPC_PROTO_MAJOR_VERSION    3
10#define RPC_PROTO_MINOR_VERSION    6
11#define RPC_PROTO_PATCH_VERSION    0
12#define GGML_RPC_MAX_SERVERS       16
13
14// backend API
15GGML_BACKEND_API ggml_backend_t ggml_backend_rpc_init(const char * endpoint, uint32_t device);
16GGML_BACKEND_API bool ggml_backend_is_rpc(ggml_backend_t backend);
17
18GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_rpc_buffer_type(const char * endpoint, uint32_t device);
19
20GGML_BACKEND_API void ggml_backend_rpc_get_device_memory(const char * endpoint, uint32_t device, size_t * free, size_t * total);
21
22GGML_BACKEND_API void ggml_backend_rpc_start_server(const char * endpoint, const char * cache_dir,
23                                                    size_t n_threads, size_t n_devices, ggml_backend_dev_t * devices);
24
25GGML_BACKEND_API ggml_backend_reg_t ggml_backend_rpc_reg(void);
26GGML_BACKEND_API ggml_backend_reg_t ggml_backend_rpc_add_server(const char * endpoint);
27
28#ifdef  __cplusplus
29}
30#endif