Skip to content

Commit

Permalink
tests: lib: edge_impulse: Use float type for constants
Browse files Browse the repository at this point in the history
Use float type for constants to prevent `-Werror=double-promotion`
build warnings.

Jira: NCSDK-31594

Signed-off-by: Marek Pieta <[email protected]>
  • Loading branch information
MarekPieta authored and pdunaj committed Feb 3, 2025
1 parent ca3e7af commit 2116d91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/lib/edge_impulse/src/edge_impulse_zip/ei_test_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


/* Float comparison tolerance. */
#define FLOAT_CMP_EPSILON 0.000001
#define FLOAT_CMP_EPSILON 0.000001f

/* Definitions provided by the EI library. */
#define EI_CLASSIFIER_RAW_SAMPLES_PER_FRAME 15
Expand All @@ -32,8 +32,8 @@ static const char * const ei_classifier_inferencing_categories[] = {
#define EI_MOCK_GEN_LABEL_IDX(PRED_IDX) ((PRED_IDX) % EI_CLASSIFIER_LABEL_COUNT)
#define EI_MOCK_GEN_LABEL(PRED_IDX) \
(ei_classifier_inferencing_categories[EI_MOCK_GEN_LABEL_IDX(PRED_IDX)])
#define EI_MOCK_GEN_VALUE(PRED_IDX) (0.5 + ((PRED_IDX) * 0.001))
#define EI_MOCK_GEN_VALUE_OTHERS(PRED_IDX) ((1.0 - EI_MOCK_GEN_VALUE(PRED_IDX)) / \
#define EI_MOCK_GEN_VALUE(PRED_IDX) (0.5f + ((PRED_IDX) * 0.001f))
#define EI_MOCK_GEN_VALUE_OTHERS(PRED_IDX) ((1.0f - EI_MOCK_GEN_VALUE(PRED_IDX)) / \
(EI_CLASSIFIER_LABEL_COUNT - 1))
#define EI_MOCK_GEN_ANOMALY(PRED_IDX) ((float)(PRED_IDX))

Expand Down

0 comments on commit 2116d91

Please sign in to comment.