ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_dotprod.h
Go to the documentation of this file.
1// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef _DSPI_DOTPROD_H_
16#define _DSPI_DOTPROD_H_
17
18#include "esp_log.h"
19#include "dsp_err.h"
20
22
23#ifdef __cplusplus
24extern "C"
25{
26#endif
27// These functions calculates dotproduct of two vectors.
28
45esp_err_t dsps_dotprod_s16_ansi(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift);
46esp_err_t dsps_dotprod_s16_ae32(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift);
47esp_err_t dsps_dotprod_s16_arp4(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift);
49
50
66esp_err_t dsps_dotprod_f32_ansi(const float *src1, const float *src2, float *dest, int len);
67esp_err_t dsps_dotprod_f32_ae32(const float *src1, const float *src2, float *dest, int len);
68esp_err_t dsps_dotprod_f32_aes3(const float *src1, const float *src2, float *dest, int len);
69esp_err_t dsps_dotprod_f32_arp4(const float *src1, const float *src2, float *dest, int len);
71
89esp_err_t dsps_dotprode_f32_ansi(const float *src1, const float *src2, float *dest, int len, int step1, int step2);
90esp_err_t dsps_dotprode_f32_ae32(const float *src1, const float *src2, float *dest, int len, int step1, int step2);
91esp_err_t dsps_dotprode_f32_arp4(const float *src1, const float *src2, float *dest, int len, int step1, int step2);
93
94#ifdef __cplusplus
95}
96#endif
97
98#if CONFIG_DSP_OPTIMIZED
99
100#if (dsps_dotprod_s16_ae32_enabled == 1)
101#define dsps_dotprod_s16 dsps_dotprod_s16_ae32
102#elif (dsps_dotprod_s16_arp4_enabled == 1)
103#define dsps_dotprod_s16 dsps_dotprod_s16_arp4
104#else
105#define dsps_dotprod_s16 dsps_dotprod_s16_ansi
106#endif // dsps_dotprod_s16_ae32_enabled
107
108#if (dsps_dotprod_f32_aes3_enabled == 1)
109#define dsps_dotprod_f32 dsps_dotprod_f32_aes3
110#define dsps_dotprode_f32 dsps_dotprode_f32_ae32
111#elif (dsps_dotprod_f32_arp4_enabled == 1)
112#define dsps_dotprod_f32 dsps_dotprod_f32_arp4
113#define dsps_dotprode_f32 dsps_dotprode_f32_arp4
114#elif (dotprod_f32_ae32_enabled == 1)
115#define dsps_dotprod_f32 dsps_dotprod_f32_ae32
116#define dsps_dotprode_f32 dsps_dotprode_f32_ae32
117#else
118#define dsps_dotprod_f32 dsps_dotprod_f32_ansi
119#define dsps_dotprode_f32 dsps_dotprode_f32_ansi
120#endif // dsps_dotprod_f32_ae32_enabled
121
122#else // CONFIG_DSP_OPTIMIZED
123#define dsps_dotprod_s16 dsps_dotprod_s16_ansi
124#define dsps_dotprod_f32 dsps_dotprod_f32_ansi
125#define dsps_dotprode_f32 dsps_dotprode_f32_ansi
126#endif // CONFIG_DSP_OPTIMIZED
127
128#endif // _DSPI_DOTPROD_H_
esp_err_t dsps_dotprod_f32_arp4(const float *src1, const float *src2, float *dest, int len)
esp_err_t dsps_dotprod_f32_aes3(const float *src1, const float *src2, float *dest, int len)
esp_err_t dsps_dotprod_f32_ansi(const float *src1, const float *src2, float *dest, int len)
dot product of two float vectors Dot product calculation for two floating point arrays: *dest += (src...
esp_err_t dsps_dotprode_f32_ae32(const float *src1, const float *src2, float *dest, int len, int step1, int step2)
esp_err_t dsps_dotprod_s16_ansi(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift)
dot product of two 16 bit vectors Dot product calculation for two signed 16 bit arrays: *dest += (src...
esp_err_t dsps_dotprod_s16_arp4(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift)
esp_err_t dsps_dotprod_s16_ae32(const int16_t *src1, const int16_t *src2, int16_t *dest, int len, int8_t shift)
esp_err_t dsps_dotprod_f32_ae32(const float *src1, const float *src2, float *dest, int len)
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: *de...
esp_err_t dsps_dotprode_f32_arp4(const float *src1, const float *src2, float *dest, int len, int step1, int step2)
int esp_err_t
Definition esp_err.h:21