Skip to content

Commit 4e19d00

Browse files
committed
Move backend files to subdirectory
1 parent 8cf7946 commit 4e19d00

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

src/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ INSTALL=install
1212
TS_OBJ = redisai.o tensor.o graph.o
1313

1414
INCLUDE_FLAGS=-I $(DEPS_PATH)/redis/src \
15+
-I . \
16+
-I backends \
1517
-I $(DEPS_PATH)/dlpack/include \
1618

1719
ifeq ($(shell uname),Linux)
@@ -25,7 +27,7 @@ else
2527
endif
2628

2729
# Tensorflow backend
28-
TS_OBJ += backends_tensorflow.o
30+
TS_OBJ += backends/tensorflow_backend.o
2931
FINAL_LDFLAGS += -ltensorflow
3032
INCLUDE_FLAGS += -I $(DEPS_PATH)/libtensorflow/include
3133
LDPATH_FLAGS += -L $(DEPS_PATH)/libtensorflow/lib
@@ -34,13 +36,16 @@ BACKEND_INSTALL += $(INSTALL) $(DEPS_PATH)/libtensorflow/lib/libtensorflow*.so $
3436
all: redisai.so
3537

3638
%.o: %.c
37-
$(TS_CC) $(INCLUDE_FLAGS) -c $(FINAL_CFLAGS) $<
39+
$(TS_CC) $(INCLUDE_FLAGS) -c $(FINAL_CFLAGS) $< -o $@
40+
41+
%.o: backends/%.c
42+
$(TS_CC) $(INCLUDE_FLAGS) -c $(FINAL_CFLAGS) $< -o backends/$@
3843

3944
redisai.so: $(TS_OBJ)
4045
$(TS_LD) $(LDPATH_FLAGS) $(FINAL_LDFLAGS) -o redisai.so $(TS_OBJ)
4146

4247
clean:
43-
rm *.o *.so
48+
rm *.o backends/*.o *.so
4449

4550
cleaninst:
4651
rm -rf $(INSTALL_PATH)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "backends_tensorflow.h"
1+
#include "tensorflow_backend.h"
22
#include "tensor.h"
33
#include "utils/arr_rm_alloc.h"
44

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef SRC_BACKENDS_TENSORFLOW_H_
2-
#define SRC_BACKENDS_TENSORFLOW_H_
1+
#ifndef SRC_TENSORFLOW_BACKEND_H_
2+
#define SRC_TENSORFLOW_BACKEND_H_
33

44
#include "config.h"
55
#include "tensor_struct.h"
@@ -18,4 +18,4 @@ void RAI_GraphFreeTF(RAI_Graph* graph);
1818

1919
int RAI_GraphRunTF(RAI_GraphRunCtx* gctx);
2020

21-
#endif /* SRC_BACKENDS_TENSORFLOW_H_ */
21+
#endif /* SRC_TENSORFLOW_BACKEND_H_ */

src/graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "graph_struct.h"
33

44
#ifdef RAI_TENSORFLOW_BACKEND
5-
#include "backends_tensorflow.h"
5+
#include "backends/tensorflow_backend.h"
66
#endif /* RAI_TENSORFLOW_BACKEND */
77

88
#include "utils/arr_rm_alloc.h"

0 commit comments

Comments
 (0)