Skip to content

Commit 2116d91

Browse files
MarekPietapdunaj
authored andcommitted
tests: lib: edge_impulse: Use float type for constants
Use float type for constants to prevent `-Werror=double-promotion` build warnings. Jira: NCSDK-31594 Signed-off-by: Marek Pieta <[email protected]>
1 parent ca3e7af commit 2116d91

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/lib/edge_impulse/src/edge_impulse_zip/ei_test_params.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
/* Float comparison tolerance. */
14-
#define FLOAT_CMP_EPSILON 0.000001
14+
#define FLOAT_CMP_EPSILON 0.000001f
1515

1616
/* Definitions provided by the EI library. */
1717
#define EI_CLASSIFIER_RAW_SAMPLES_PER_FRAME 15
@@ -32,8 +32,8 @@ static const char * const ei_classifier_inferencing_categories[] = {
3232
#define EI_MOCK_GEN_LABEL_IDX(PRED_IDX) ((PRED_IDX) % EI_CLASSIFIER_LABEL_COUNT)
3333
#define EI_MOCK_GEN_LABEL(PRED_IDX) \
3434
(ei_classifier_inferencing_categories[EI_MOCK_GEN_LABEL_IDX(PRED_IDX)])
35-
#define EI_MOCK_GEN_VALUE(PRED_IDX) (0.5 + ((PRED_IDX) * 0.001))
36-
#define EI_MOCK_GEN_VALUE_OTHERS(PRED_IDX) ((1.0 - EI_MOCK_GEN_VALUE(PRED_IDX)) / \
35+
#define EI_MOCK_GEN_VALUE(PRED_IDX) (0.5f + ((PRED_IDX) * 0.001f))
36+
#define EI_MOCK_GEN_VALUE_OTHERS(PRED_IDX) ((1.0f - EI_MOCK_GEN_VALUE(PRED_IDX)) / \
3737
(EI_CLASSIFIER_LABEL_COUNT - 1))
3838
#define EI_MOCK_GEN_ANOMALY(PRED_IDX) ((float)(PRED_IDX))
3939

0 commit comments

Comments
 (0)