Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/backends/onnxruntime.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define REDISMODULE_MAIN
#include <cuda_provider_factory.h>
#include "backends/onnxruntime.h"
#include "backends/util.h"
Expand Down
1 change: 1 addition & 0 deletions src/backends/tensorflow.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define REDISMODULE_MAIN
#include "backends/tensorflow.h"
#include "backends/util.h"
#include "tensor.h"
Expand Down
1 change: 1 addition & 0 deletions src/backends/tflite.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define REDISMODULE_MAIN
#include "backends/tflite.h"
#include "backends/util.h"
#include "tensor.h"
Expand Down
1 change: 1 addition & 0 deletions src/backends/torch.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define REDISMODULE_MAIN
#include "backends/torch.h"
#include "backends/util.h"
#include "tensor.h"
Expand Down
8 changes: 4 additions & 4 deletions src/background_workers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
*
*/

#if defined(__linux__)
#define _GNU_SOURCE
#endif

#ifndef SRC_BACKGROUND_WORKERS_H_
#define SRC_BACKGROUND_WORKERS_H_

#if defined(__linux__) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE
#endif

#include <pthread.h>

#include "config.h"
Expand Down
1 change: 1 addition & 0 deletions src/redisai.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define REDISMODULE_MAIN
#include "redismodule.h"
#include "tensor.h"

Expand Down
10 changes: 10 additions & 0 deletions src/redisai.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,22 @@ RedisModuleType *MODULE_API_FUNC(RedisAI_ScriptRedisType)(void);

int MODULE_API_FUNC(RedisAI_GetLLAPIVersion)();

#ifndef __cplusplus
#define REDISAI_MODULE_INIT_FUNCTION(ctx, name) \
RedisAI_##name = RedisModule_GetSharedAPI(ctx, "RedisAI_" #name); \
if (!RedisAI_##name) { \
RedisModule_Log(ctx, "warning", "could not initialize RedisAI_" #name "\r\n"); \
return REDISMODULE_ERR; \
}
#else
#define REDISAI_MODULE_INIT_FUNCTION(ctx, name) \
RedisAI_##name = reinterpret_cast<decltype(RedisAI_##name)>( \
RedisModule_GetSharedAPI((RedisModuleCtx *)(ctx), "RedisAI_" #name)); \
if (!RedisAI_##name) { \
RedisModule_Log(ctx, "warning", "could not initialize RedisAI_" #name "\r\n"); \
return REDISMODULE_ERR; \
}
#endif

static int RedisAI_Initialize(RedisModuleCtx *ctx) {

Expand Down
Loading