Skip to content

Commit 8cb2708

Browse files
committed
Update function signatures
1 parent b7627a6 commit 8cb2708

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/redisai.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ typedef struct RAI_Script RAI_Script;
1515

1616
typedef struct RAI_ModelRunCtx RAI_ModelRunCtx;
1717
typedef struct RAI_ScriptRunCtx RAI_ScriptRunCtx;
18+
typedef struct RAI_Error RAI_Error;
1819
#endif
1920

2021
#define REDISAI_BACKEND_TENSORFLOW 0
@@ -40,27 +41,30 @@ long long MODULE_API_FUNC(RedisAI_TensorDim)(RAI_Tensor* t, int dim);
4041
size_t MODULE_API_FUNC(RedisAI_TensorByteSize)(RAI_Tensor* t);
4142
char* MODULE_API_FUNC(RedisAI_TensorData)(RAI_Tensor* t);
4243

43-
RAI_Model* MODULE_API_FUNC(RedisAI_ModelCreate)(int backend, int device, const char* modeldef, size_t modellen);
44-
void MODULE_API_FUNC(RedisAI_ModelFree)(RAI_Model* model);
44+
RAI_Model* MODULE_API_FUNC(RedisAI_ModelCreate)(RAI_Backend backend, int device,
45+
size_t ninputs, const char **inputs,
46+
size_t noutputs, const char **outputs,
47+
const char *modeldef, size_t modellen, RAI_Error* err);
48+
void MODULE_API_FUNC(RedisAI_ModelFree)(RAI_Model* model, RAI_Error* err);
4549
RAI_ModelRunCtx* MODULE_API_FUNC(RedisAI_ModelRunCtxCreate)(RAI_Model* model);
4650
int MODULE_API_FUNC(RedisAI_ModelRunCtxAddInput)(RAI_ModelRunCtx* mctx, const char* inputName, RAI_Tensor* inputTensor);
4751
int MODULE_API_FUNC(RedisAI_ModelRunCtxAddOutput)(RAI_ModelRunCtx* mctx, const char* outputName);
4852
size_t MODULE_API_FUNC(RedisAI_ModelRunCtxNumOutputs)(RAI_ModelRunCtx* mctx);
4953
RAI_Tensor* MODULE_API_FUNC(RedisAI_ModelRunCtxOutputTensor)(RAI_ModelRunCtx* mctx, size_t index);
5054
void MODULE_API_FUNC(RedisAI_ModelRunCtxFree)(RAI_ModelRunCtx* mctx);
51-
int MODULE_API_FUNC(RedisAI_ModelRun)(RAI_ModelRunCtx* mctx);
55+
int MODULE_API_FUNC(RedisAI_ModelRun)(RAI_ModelRunCtx* mctx, RAI_Error* err);
5256
RAI_Model* MODULE_API_FUNC(RedisAI_ModelGetShallowCopy)(RAI_Model* model);
5357

54-
RAI_Script* MODULE_API_FUNC(RedisAI_ScriptCreate)(int backend, int device, const char* modeldef, size_t modellen);
55-
void MODULE_API_FUNC(RedisAI_ScriptFree)(RAI_Script* model);
56-
RAI_ScriptRunCtx* MODULE_API_FUNC(RedisAI_ScriptRunCtxCreate)(RAI_Script* model, const char *fnname);
57-
int MODULE_API_FUNC(RedisAI_ScriptRunCtxAddInput)(RAI_ScriptRunCtx* mctx, const char* inputName, RAI_Tensor* inputTensor);
58-
int MODULE_API_FUNC(RedisAI_ScriptRunCtxAddOutput)(RAI_ScriptRunCtx* mctx, const char* outputName);
59-
size_t MODULE_API_FUNC(RedisAI_ScriptRunCtxNumOutputs)(RAI_ScriptRunCtx* mctx);
60-
RAI_Tensor* MODULE_API_FUNC(RedisAI_ScriptRunCtxOutputTensor)(RAI_ScriptRunCtx* mctx, size_t index);
61-
void MODULE_API_FUNC(RedisAI_ScriptRunCtxFree)(RAI_ScriptRunCtx* mctx);
62-
int MODULE_API_FUNC(RedisAI_ScriptRun)(RAI_ScriptRunCtx* mctx);
63-
RAI_Script* MODULE_API_FUNC(RedisAI_ScriptGetShallowCopy)(RAI_Script* model);
58+
RAI_Script* MODULE_API_FUNC(RedisAI_ScriptCreate)(int device, const char* scriptdef, RAI_Error* err);
59+
void MODULE_API_FUNC(RedisAI_ScriptFree)(RAI_Script* script, RAI_Error* err);
60+
RAI_ScriptRunCtx* MODULE_API_FUNC(RedisAI_ScriptRunCtxCreate)(RAI_Script* script, const char *fnname);
61+
int MODULE_API_FUNC(RedisAI_ScriptRunCtxAddInput)(RAI_ScriptRunCtx* sctx, RAI_Tensor* inputTensor);
62+
int MODULE_API_FUNC(RedisAI_ScriptRunCtxAddOutput)(RAI_ScriptRunCtx* sctx);
63+
size_t MODULE_API_FUNC(RedisAI_ScriptRunCtxNumOutputs)(RAI_ScriptRunCtx* sctx);
64+
RAI_Tensor* MODULE_API_FUNC(RedisAI_ScriptRunCtxOutputTensor)(RAI_ScriptRunCtx* sctx, size_t index);
65+
void MODULE_API_FUNC(RedisAI_ScriptRunCtxFree)(RAI_ScriptRunCtx* sctx);
66+
int MODULE_API_FUNC(RedisAI_ScriptRun)(RAI_ScriptRunCtx* sctx, RAI_Error* err);
67+
RAI_Script* MODULE_API_FUNC(RedisAI_ScriptGetShallowCopy)(RAI_Script* script);
6468

6569
int MODULE_API_FUNC(RedisAI_GetAPIVersion)();
6670

0 commit comments

Comments
 (0)