ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_dotprode_f32_ansi.c File Reference
#include "dsps_dotprod.h"
Include dependency graph for dsps_dotprode_f32_ansi.c:

Go to the source code of this file.

Functions

esp_err_t dsps_dotprode_f32_ansi (const float *src1, const float *src2, float *dest, int len, int step1, int step2)
 dot product of two float vectors with step Dot product calculation for two floating point arrays: *dest += (src1[i*step1] * src2[i*step2]); i= [0..N) The extension (_ansi) use ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.

Function Documentation

◆ dsps_dotprode_f32_ansi()

esp_err_t dsps_dotprode_f32_ansi ( const float * src1,
const float * src2,
float * dest,
int len,
int step1,
int step2 )

dot product of two float vectors with step Dot product calculation for two floating point arrays: *dest += (src1[i*step1] * src2[i*step2]); i= [0..N) The extension (_ansi) use ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.

Parameters
[in]src1source array 1
[in]src2source array 2
destdestination pointer
[in]lenlength of input arrays
[in]step1step over elements in first array
[in]step2step over elements in second array
Returns
  • ESP_OK on success
  • One of the error codes from DSP library

Definition at line 17 of file dsps_dotprode_f32_ansi.c.

18{
19 float acc = 0;
20 for (int i = 0 ; i < len ; i++) {
21 acc += src1[i * step1] * src2[i * step2];
22 }
23 *dest = acc;
24 return ESP_OK;
25}
#define ESP_OK
Definition esp_err.h:23

References ESP_OK.