Skip to content

Commit f55f1c4

Browse files
Combined testbenches for conv1d and changed macros
1 parent 951d3b1 commit f55f1c4

24 files changed

+162
-316
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,5 @@ c_reference/tests/conv1d/conv1d_depthwise/conv_param_depth.h filter=lfs diff=lfs
7070
c_reference/tests/kws/precnn_params.h filter=lfs diff=lfs merge=lfs -text
7171
c_reference/tests/kws/postcnn_params.h filter=lfs diff=lfs merge=lfs -text
7272
c_reference/tests/kws/rnn_params.h filter=lfs diff=lfs merge=lfs -text
73-
c_reference/tests/dscnn/dscnn_param_lr.h filter=lfs diff=lfs merge=lfs -text
74-
c_reference/tests/dscnn/dscnn_param_lr_depth_point.h filter=lfs diff=lfs merge=lfs -text
7573
c_reference/tests/rnn_bricked/rnn_params.h filter=lfs diff=lfs merge=lfs -text
7674
c_reference/tests/rnn_bricked/rnn_bricked_io.h filter=lfs diff=lfs merge=lfs -text

c_reference/include/rnn_bricked.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef int (*rnn_t)(float* const, unsigned, const float* const, unsigned, unsig
2323
// For Bi-Directional use, there are 2 constarints
2424
// 1) (in_time - window) % hop == 0
2525
// 2) both the window % hop == 0
26-
// 3) sample_first_brick and sample_last_brick = 0
26+
// 3) sample_first_brick and sample_last_brick = 1
2727
//
2828
// Violation of these constraints can lead to one of the following issues
2929
// 1) segmenation faults

c_reference/src/rnn_bricked.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int forward_bricked_rnn(float* output_signal, unsigned rnn_hidden, float* input_
1212
unsigned in_time, unsigned in_dims, unsigned window, unsigned hop,
1313
rnn_t rnn, const void* params, void* buffers,
1414
int bi_direction, int sample_first_brick, int normalize) {
15-
int out_index = 0, t;
15+
int out_index = 0, t; // t is an index, but we want ot remember the value after the loop. Hence we define it outside
1616

1717
unsigned rnn_assign_offset = rnn_hidden;
1818
float* temp_hiddenstate = (float*)calloc(rnn_hidden, sizeof(float));

c_reference/tests/Makefile

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,10 @@ MODEL_DIR=../models
88
SRC_DIR=../src
99
IFLAGS = -I $(INCLUDE_DIR) -I $(MODEL_DIR)
1010

11-
all: test_conv1d test_conv1d_depth test_conv1d_lr test_conv1d_lr_depth test_dscnn_lr test_dscnn_lr_depth_point test_fastgrnn_lr test_rnnpool test_quantized_utils test_quantized_fastgrnn test_quantized_rnnpool test_quantized_mbconv test_quantized_face_detection test_quantized_face_detection_fast test_quantized_face_detection_sparse test_rnn_bricked test_phoneme_det_cnn_rnn
11+
all: test_fastgrnn_lr test_conv1d test_rnnpool test_quantized_utils test_quantized_fastgrnn test_quantized_rnnpool test_quantized_mbconv test_quantized_face_detection test_quantized_face_detection_fast test_quantized_face_detection_sparse test_rnn_bricked test_phoneme_det_cnn_rnn
1212

1313
CONV1D_DIR=conv1d
14-
test_conv1d: $(CONV1D_DIR)/conv1d_regular/test_conv1d.c $(SRC_DIR)/conv1d.o $(SRC_DIR)/utils.o
15-
$(CC) -o $@ $^ $(IFLAGS) $(CFLAGS) -lm
16-
test_conv1d_depth: $(CONV1D_DIR)/conv1d_depthwise/test_conv1d_depth.c $(SRC_DIR)/conv1d.o $(SRC_DIR)/utils.o
17-
$(CC) -o $@ $^ $(IFLAGS) $(CFLAGS) -lm
18-
test_conv1d_lr: $(CONV1D_DIR)/conv1d_lr/test_conv1d_lr.c $(SRC_DIR)/conv1d.o $(SRC_DIR)/utils.o
19-
$(CC) -o $@ $^ $(IFLAGS) $(CFLAGS) -lm
20-
test_conv1d_lr_depth: $(CONV1D_DIR)/conv1d_lr_depthwise/test_conv1d_lr_depth.c $(SRC_DIR)/conv1d.o $(SRC_DIR)/utils.o
21-
$(CC) -o $@ $^ $(IFLAGS) $(CFLAGS) -lm
22-
23-
DSCNN_DIR=dscnn
24-
test_dscnn_lr: $(DSCNN_DIR)/test_dscnn_lr.c $(SRC_DIR)/utils.o $(SRC_DIR)/conv1d.o $(SRC_DIR)/dscnn.o
25-
$(CC) -o $@ $^ $(IFLAGS) $(CFLAGS) -lm
26-
test_dscnn_lr_depth_point : $(DSCNN_DIR)/test_dscnn_lr_depth_point.c $(SRC_DIR)/utils.o $(SRC_DIR)/conv1d.o $(SRC_DIR)/dscnn.o
14+
test_conv1d: $(CONV1D_DIR)/test_conv1d.c $(SRC_DIR)/conv1d.o $(SRC_DIR)/utils.o
2715
$(CC) -o $@ $^ $(IFLAGS) $(CFLAGS) -lm
2816

2917
FASTGRNN_DIR=fastgrnn
@@ -65,7 +53,7 @@ test_phoneme_det_cnn_rnn: $(KWS_DIR)/test_phoneme_det_cnn_rnn.c $(SRC_DIR)/utils
6553
.PHONY: clean cleanest
6654

6755
clean:
68-
rm -f *.o *.gch test_conv1d test_conv1d_depth test_conv1d_lr test_conv1d_lr_depth test_dscnn_lr test_dscnn_lr_depth_point test_fastgrnn_lr test_rnnpool test_quantized_utils test_quantized_fastgrnn test_quantized_rnnpool test_quantized_mbconv test_quantized_face_detection test_quantized_face_detection_fast test_quantized_face_detection_sparse test_rnn_bricked test_phoneme_det_cnn_rnn
56+
rm -f *.o *.gch test_fastgrnn_lr test_conv1d test_rnnpool test_quantized_utils test_quantized_fastgrnn test_quantized_rnnpool test_quantized_mbconv test_quantized_face_detection test_quantized_face_detection_fast test_quantized_face_detection_sparse test_rnn_bricked test_phoneme_det_cnn_rnn
6957

7058
cleanest: clean
7159
rm *~
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version https://git-lfs.github.com/spec/v1
2-
oid sha256:84a457f9627cc6b439a886866b341562eaa42ca1330326aa1e9ec0c3c0a839bc
3-
size 1883689
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:366394ea8c774d6cf481cca16a90fade1485991c0b5788489df6b6626bd236ca
3+
size 1884036

c_reference/tests/conv1d/conv1d_depthwise/test_conv1d_depth.c

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version https://git-lfs.github.com/spec/v1
2-
oid sha256:72fe39ff914d860556af1bc72a40af3fcb2d4540bc60b18924f6de4b882a9a44
3-
size 5119351
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:580bb827ae804ad27ef75be6ba16731aff547a22631f9c3ee62e17cf79e3c838
3+
size 5119705

c_reference/tests/conv1d/conv1d_lr/test_conv1d_lr.c

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version https://git-lfs.github.com/spec/v1
2-
oid sha256:f7d62a5a82464d0cd03857bbc1e0add56624fd294f748b47259f72fc81ead930
3-
size 1947518
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:1e44aba5fb5b03b601060e6ebacfe9047132825f711431bcaf3279a582425151
3+
size 1948109

c_reference/tests/conv1d/conv1d_lr_depthwise/test_conv1d_lr_depth.c

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)