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

Go to the source code of this file.

Functions

esp_err_t dspm_mult_f32_ansi (const float *A, const float *B, float *C, int m, int n, int k)
 Matrix multiplication.

Function Documentation

◆ dspm_mult_f32_ansi()

esp_err_t dspm_mult_f32_ansi ( const float * A,
const float * B,
float * C,
int m,
int n,
int k )

Matrix multiplication.

Matrix multiplication for two floating point matrices: C[m][k] = A[m][n] * B[n][k] 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]Ainput matrix A[m][n]
[in]Binput matrix B[n][k]
Cresult matrix C[m][k]
[in]mmatrix dimension
[in]nmatrix dimension
[in]kmatrix dimension
Returns
  • ESP_OK on success
  • One of the error codes from DSP library

Definition at line 22 of file dspm_mult_f32_ansi.c.

23{
24 for (int i = 0 ; i < m ; i++) {
25 for (int j = 0 ; j < k ; j++) {
26 C[i * k + j] = A[i * n] * B[j];
27 for (int s = 1; s < n ; s++) {
28 C[i * k + j] += A[i * n + s] * B[s * k + j];
29 }
30 }
31 }
32 return ESP_OK;
33}
#define ESP_OK
Definition esp_err.h:23
float C[4][16]
Definition test_mmult.c:22
const int m
Definition test_mmult.c:16
float B[8][16]
Definition test_mmult.c:21
float A[4][8]
Definition test_mmult.c:20
const int n
Definition test_mmult.c:17
const int k
Definition test_mmult.c:18

References A, B, C, ESP_OK, k, m, and n.