diff --git a/main/DSP_2basic_8hpp.html b/main/DSP_2basic_8hpp.html new file mode 100644 index 00000000..424ec622 --- /dev/null +++ b/main/DSP_2basic_8hpp.html @@ -0,0 +1,150 @@ + + + +
+ + + ++Data Structures | |
struct | Q15DSPVector |
Representation of a vector when DSP extension supported. More... | |
struct | vector_traits< Q15, DSP, typename std::enable_if< true >::type > |
Vector description for Q15 with DSP extensions. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
Q15DSPVector | vconst (Q15 val) |
Vector const. | |
Q< 33, 30 > | vreduce (const Q< 33, 30 > sum) |
Reduce accumulation value. | |
+Namespaces | |
namespace | inner |
+Functions | |
template<typename T , typename DST , typename std::enable_if< has_vector_inst< DST >() &&IsVector< DST >::value &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill (DST &v, const T val, const vector_length_t l, const Helium *=nullptr) |
Fill evaluator for Helium. | |
template<typename T , typename DST , typename std::enable_if< has_vector_inst< DST >() &&must_use_matrix_idx< DST >() &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill2D (DST &v, const T val, const vector_length_t rows, const vector_length_t cols, const Helium *=nullptr) |
Fill2D evaluator for Helium. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval (DA &v, const DB &other, const vector_length_t l, const Helium *=nullptr) |
Eval function for Helium. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&must_use_matrix_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval2D (DA &v, const DB &other, const vector_length_t rows, const vector_length_t cols, const Helium *=nullptr) |
Eval2D function for Helium. | |
template<class TupType , size_t... I> | |
void | printt (const TupType &_tup, std::index_sequence< I... >) |
Print tuple for debug. | |
template<class... T> | |
void | printt (const std::tuple< T... > &_tup) |
Print tuple. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&vector_idx_pair< DA, DB >(), bool >::type = true> | |
DotResult< DA > | _dot (const DA &a, const DB &b, const vector_length_t l, const Helium *=nullptr) |
Dor product for Helium. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | _swap (DA &&a, DB &&b, const vector_length_t l, const Helium *=nullptr) |
Swap operator for Helium. | |
+Data Structures | |
struct | vector_traits< float, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > |
Vector datatype for Helium. More... | |
struct | vctpq< float > |
vctpq for this datatype More... | |
struct | vload1_gen_stride< S > |
Load with generalized stride (gather load) More... | |
struct | vload1_gen_stride< 0, 1, 2, 3 > |
Load with generalized stride specialized for <0,1,2,3> More... | |
struct | vload1_gen_stride_z< S > |
Load with generalized stride (gather load) and tail predicate. More... | |
struct | vload1_gen_stride_z< 0, 1, 2, 3 > |
Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3> More... | |
struct | vstore1_gen_stride< S > |
Generalized store with strides. More... | |
struct | vstore1_gen_stride< 0, 1, 2, 3 > |
Generalized store with stride (Specialized for <0,1,2,3>) More... | |
struct | vstore1_gen_stride_z< S > |
Store with generalized strides and tail predicate. More... | |
struct | vstore1_gen_stride_z< 0, 1, 2, 3 > |
Scatter store with tail predicate (specialized for <0,1,2,3>) More... | |
+Namespaces | |
namespace | inner |
+Functions | |
float32x4_t | vconst (const float v) |
Vector constant. | |
float32x4_t | vconst_tail (const float v, const mve_pred16_t p0) |
Vector constant with tail. | |
float32x4_t | vneg (const float32x4_t a) |
Vector negate. | |
float32x4_t | vneg (const float32x4_t a, const mve_pred16_t p0) |
Vector negate with tail. | |
float32x4_t | vadd (const float32x4_t a, const float32x4_t b) |
Vector + Vector. | |
float32x4_t | vadd (const float32x4_t a, const float b) |
Vector + Scalar. | |
float32x4_t | vadd (const float a, const float32x4_t b) |
Scalar + Vector. | |
float32x4_t | vadd (const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Vector + Vector with tail. | |
float32x4_t | vadd (const float32x4_t a, const float b, const mve_pred16_t p0) |
Vector + scalar with tail. | |
float32x4_t | vadd (const float a, const float32x4_t b, const mve_pred16_t p0) |
Scalar + vector with tail predicate. | |
float32x4_t | vsub (const float32x4_t a, const float32x4_t b) |
Vector - Vector. | |
float32x4_t | vsub (const float32x4_t a, const float b) |
Vector - Scalar. | |
float32x4_t | vsub (const float a, const float32x4_t b) |
Scalar - Vector. | |
float32x4_t | vsub (const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Vector - Vector with predicate. | |
float32x4_t | vsub (const float32x4_t a, const float b, const mve_pred16_t p0) |
Vector - Scalar with predicate. | |
float32x4_t | vsub (const float a, const float32x4_t b, const mve_pred16_t p0) |
Scalar - Vector with predicate. | |
float32x4_t | vmul (const float32x4_t a, const float32x4_t b) |
Vector * Vector. | |
float32x4_t | vmul (const float32x4_t a, const float b) |
Vector * Scalar. | |
float32x4_t | vmul (const float a, const float32x4_t b) |
Scalar * Vector. | |
float32x4_t | vmul (const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Vector * Vector with predicate. | |
float32x4_t | vmul (const float32x4_t a, const float b, const mve_pred16_t p0) |
Vector * Scalar with predicate. | |
float32x4_t | vmul (const float a, const float32x4_t b, const mve_pred16_t p0) |
Scalar * Vector with predicate. | |
float32x4_t | vmacc (const float32x4_t acc, const float32x4_t a, const float32x4_t b) |
Multiply accumulate (Vector * Vector) | |
float32x4_t | vmacc (const float32x4_t acc, const float32x4_t a, const float_t b) |
Multiply accumulate (Vector * Scalar) | |
float32x4_t | vmacc (const float32x4_t acc, const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Multiply accumulate with predicate (Vector * Vector) | |
float | vreduce (const float32x4_t in) |
Vector reduce. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
float32x4_t | vload1 (const float32_t *p) |
Vector load with stride. | |
float32x4_t | vload1 (const float32_t *p, const index_t stride) |
Vector load with dynamic stride. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
float32x4_t | vload1_z (const float32_t *p, const std::size_t nb, const mve_pred16_t p0) |
Vector load with stride and predicate. | |
float32x4_t | vload1_z (const float32_t *p, const index_t stride, const std::size_t nb, const mve_pred16_t p0) |
Vector load with dynamic stride and loop predication. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
void | vstore1 (float32_t *p, const float32x4_t val) |
Store with stride. | |
void | vstore1 (float32_t *p, const index_t stride, const float32x4_t val) |
Store with dynamic stride. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
void | vstore1_z (float32_t *p, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Store with stride and tail predicate. | |
void | vstore1_z (float32_t *p, const index_t stride, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Store with dynamic stride. | |
+Data Structures | |
struct | vector_traits< float16_t, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > |
Vector features for f16 on Helium. More... | |
struct | vctpq< float16_t > |
vctpq for Helium and f16 More... | |
+Namespaces | |
namespace | inner |
+Functions | |
float16x8_t | vconst (float16_t v) |
Vector const. | |
float16x8_t | vconst_tail (const float16_t v, const mve_pred16_t p0) |
Vector of const with tail predicate. | |
float16x8_t | vneg (const float16x8_t a) |
Vector negate. | |
float16x8_t | vneg (const float16x8_t a, const mve_pred16_t p0) |
Vector negate with tail predicate. | |
float16x8_t | vadd (const float16x8_t a, const float16x8_t b) |
Vector + Vector. | |
float16x8_t | vadd (const float16x8_t a, const float16_t b) |
Vector + Scalar. | |
float16x8_t | vadd (const float16_t a, const float16x8_t b) |
Scalar + Vector. | |
float16x8_t | vadd (const float16x8_t a, const float16x8_t b, const mve_pred16_t p0) |
Vector + Vector with tail predicate. | |
float16x8_t | vadd (const float16x8_t a, const float16_t b, const mve_pred16_t p0) |
Vector + Scalar with tail predicate. | |
float16x8_t | vadd (const float16_t a, const float16x8_t b, const mve_pred16_t p0) |
Scalar + Vector with tail predicate. | |
#include "matrix_multiply_fixed.hpp"
#include "matrix_multiply_f16.hpp"
#include "matrix_multiply_f32.hpp"
+Data Structures | |
struct | vector_traits< Q15, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > |
Vector features for Q15 on Helium. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
Q15DSPVector | vconst (Q15 val) |
Vector const. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
int16x8_t | vload1 (const Q15 *p) |
Vector load with stride. | |
Q< 33, 30 > | vmacc (const Q< 33, 30 > sum, const int16x8_t vala, const int16x8_t valb) |
Vector accumulate into scalar. | |
Q< 33, 30 > | vreduce (const Q< 33, 30 > sum) |
Reduce accumulation value. | |
+Namespaces | |
namespace | inner |
+Namespaces | |
namespace | inner |
+Functions | |
template<typename T , typename DST , typename std::enable_if< IsVector< DST >::value &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill (DST &v, const T val, vector_length_t l, const Scalar *=nullptr) |
Fill evaluator for scalar architecture. | |
template<typename T , typename DST , typename std::enable_if< must_use_matrix_idx< DST >() &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill2D (DST &v, const T val, const vector_length_t rows, const vector_length_t cols, const Scalar *=nullptr) |
Fill2D evaluator for scalar architecture. | |
template<typename DA , typename DB , typename std::enable_if< vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval (DA &v, const DB &other, const vector_length_t l, const Scalar *=nullptr) |
Expression evaluator for vector in scalar mode. | |
template<typename DA , typename DB , typename std::enable_if< must_use_matrix_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval2D (DA &v, const DB &other, const vector_length_t rows, const vector_length_t cols, const Scalar *=nullptr) |
2D expression evaluator for scalar archiecture | |
template<typename DA , typename DB , typename std::enable_if< vector_idx_pair< DA, DB >(), bool >::type = true> | |
DotResult< DA > | _dot (const DA &a, const DB &b, const vector_length_t l, const Scalar *=nullptr) |
Dot product evaluator for scalar architectuire. | |
template<typename DA , typename DB , typename std::enable_if< vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | _swap (DA &&a, DB &&b, const vector_length_t l, const Scalar *=nullptr) |
Swap evaluator for scalar architecture. | |
+Functions | |
template<typename MA , typename MB > | |
__STATIC_INLINE void | _arm_mat_trans (const MA &src, MB &dst, const Scalar *=nullptr) |
Transposition for scalar architecture. | |
template<typename M , typename V , typename RES > | |
void | _dot_m_v (RES &res, const M &m, const V &v, const Scalar *=nullptr) |
Matrix times vector for scalar architecture. | |
+Functions | |
template<typename MA , typename MB , typename RES , typename TMP , typename std::enable_if< number_traits< typename traits< MA >::Scalar >::is_fixed, bool >::type = true> | |
__STATIC_INLINE void | _dot_m_m (const MA &pSrcA, const MB &pSrcB, RES &&pDst, const TMP &BT, const Scalar *=nullptr) |
Matrix times matrix for scalar architecture and fixed point. | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Functions | |
template<typename MA , typename MB , typename std::enable_if< HasMatrixIndexing< MA >::value &&HasMatrixIndexing< MB >::value, bool >::type = true> | |
void | transposeTo (MA &dst, const MB &src) |
Transpose a matrix. | |
template<typename M , typename V , typename std::enable_if< CompatibleStaticMatVecProduct< M, V >::value, bool >::type = true> | |
OutputVector< M, V >::type | dot (const M &m, const V &v) |
Matrix x Vector product. | |
template<typename MA , typename MB , typename std::enable_if< CompatibleStaticMatMatProduct< MA, MB >::value &&number_traits< typename traits< MA >::Scalar >::is_fixed, bool >::type = true> | |
OutputMatrix< MA, MB >::type | dot (const MA &ma, const MB &mb) |
Matrix x Matrix product. | |
template<typename MA , typename MB , typename RES , typename std::enable_if< CompatibleDynamicMatMatProduct< MA, MB >::value &&number_traits< typename traits< MA >::Scalar >::is_float, bool >::type = true> | |
void | dot (RES &&res, const MA &ma, const MB &mb) |
Matrix x Matrix product. | |
template<typename P > | |
Matrix< P, DYNAMIC, DYNAMIC, TMP_ALLOC > | mk_identity (const vector_length_t l) |
Create identity matrix. | |
template<typename P , int L> | |
Matrix< P, L, L, TMP_ALLOC > | mk_identity () |
Create identity matrix. | |
Carm_bilinear_interp_instance_f16 | Instance structure for the floating-point bilinear interpolation function | ||||||||||||||||||||||||
Carm_bilinear_interp_instance_f32 | Instance structure for the floating-point bilinear interpolation function | ||||||||||||||||||||||||
Carm_bilinear_interp_instance_q15 | Instance structure for the Q15 bilinear interpolation function | ||||||||||||||||||||||||
Carm_bilinear_interp_instance_q31 | Instance structure for the Q31 bilinear interpolation function | ||||||||||||||||||||||||
Carm_bilinear_interp_instance_q7 | Instance structure for the Q15 bilinear interpolation function | ||||||||||||||||||||||||
Carm_biquad_cas_df1_32x64_ins_q31 | Instance structure for the high precision Q31 Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_cascade_df2T_instance_f16 | Instance structure for the floating-point transposed direct form II Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_cascade_df2T_instance_f32 | Instance structure for the floating-point transposed direct form II Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_cascade_df2T_instance_f64 | Instance structure for the floating-point transposed direct form II Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_cascade_stereo_df2T_instance_f16 | Instance structure for the floating-point transposed direct form II Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_cascade_stereo_df2T_instance_f32 | Instance structure for the floating-point transposed direct form II Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_casd_df1_inst_f16 | Instance structure for the floating-point Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_casd_df1_inst_f32 | Instance structure for the floating-point Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_casd_df1_inst_q15 | Instance structure for the Q15 Biquad cascade filter | ||||||||||||||||||||||||
Carm_biquad_casd_df1_inst_q31 | Instance structure for the Q31 Biquad cascade filter | ||||||||||||||||||||||||
Carm_cfft_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_instance_f64 | Instance structure for the Double Precision Floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_instance_q15 | Instance structure for the fixed-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_instance_q31 | Instance structure for the fixed-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix2_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix2_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix2_instance_q15 | Instance structure for the Q15 CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix2_instance_q31 | Instance structure for the Radix-2 Q31 CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix4_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix4_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix4_instance_q15 | Instance structure for the Q15 CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_cfft_radix4_instance_q31 | Instance structure for the Q31 CFFT/CIFFT function | ||||||||||||||||||||||||
Carm_dct4_instance_f32 | Instance structure for the floating-point DCT4/IDCT4 function | ||||||||||||||||||||||||
Carm_dct4_instance_q15 | Instance structure for the Q15 DCT4/IDCT4 function | ||||||||||||||||||||||||
Carm_dct4_instance_q31 | Instance structure for the Q31 DCT4/IDCT4 function | ||||||||||||||||||||||||
Carm_fir_decimate_instance_f32 | Instance structure for floating-point FIR decimator | ||||||||||||||||||||||||
Carm_fir_decimate_instance_q15 | Instance structure for the Q15 FIR decimator | ||||||||||||||||||||||||
Carm_fir_decimate_instance_q31 | Instance structure for the Q31 FIR decimator | ||||||||||||||||||||||||
Carm_fir_instance_f16 | Instance structure for the floating-point FIR filter | ||||||||||||||||||||||||
Carm_fir_instance_f32 | Instance structure for the floating-point FIR filter | ||||||||||||||||||||||||
Carm_fir_instance_f64 | Instance structure for the floating-point FIR filter | ||||||||||||||||||||||||
Carm_fir_instance_q15 | Instance structure for the Q15 FIR filter | ||||||||||||||||||||||||
Carm_fir_instance_q31 | Instance structure for the Q31 FIR filter | ||||||||||||||||||||||||
Carm_fir_instance_q7 | Instance structure for the Q7 FIR filter | ||||||||||||||||||||||||
Carm_fir_interpolate_instance_f32 | Instance structure for the floating-point FIR interpolator | ||||||||||||||||||||||||
Carm_fir_interpolate_instance_q15 | Instance structure for the Q15 FIR interpolator | ||||||||||||||||||||||||
Carm_fir_interpolate_instance_q31 | Instance structure for the Q31 FIR interpolator | ||||||||||||||||||||||||
Carm_fir_lattice_instance_f32 | Instance structure for the floating-point FIR lattice filter | ||||||||||||||||||||||||
Carm_fir_lattice_instance_q15 | Instance structure for the Q15 FIR lattice filter | ||||||||||||||||||||||||
Carm_fir_lattice_instance_q31 | Instance structure for the Q31 FIR lattice filter | ||||||||||||||||||||||||
Carm_fir_sparse_instance_f32 | Instance structure for the floating-point sparse FIR filter | ||||||||||||||||||||||||
Carm_fir_sparse_instance_q15 | Instance structure for the Q15 sparse FIR filter | ||||||||||||||||||||||||
Carm_fir_sparse_instance_q31 | Instance structure for the Q31 sparse FIR filter | ||||||||||||||||||||||||
Carm_fir_sparse_instance_q7 | Instance structure for the Q7 sparse FIR filter | ||||||||||||||||||||||||
Carm_gaussian_naive_bayes_instance_f16 | Instance structure for Naive Gaussian Bayesian estimator | ||||||||||||||||||||||||
Carm_gaussian_naive_bayes_instance_f32 | Instance structure for Naive Gaussian Bayesian estimator | ||||||||||||||||||||||||
Carm_iir_lattice_instance_f32 | Instance structure for the floating-point IIR lattice filter | ||||||||||||||||||||||||
Carm_iir_lattice_instance_q15 | Instance structure for the Q15 IIR lattice filter | ||||||||||||||||||||||||
Carm_iir_lattice_instance_q31 | Instance structure for the Q31 IIR lattice filter | ||||||||||||||||||||||||
Carm_linear_interp_instance_f16 | Instance structure for the half floating-point Linear Interpolate function | ||||||||||||||||||||||||
Carm_linear_interp_instance_f32 | Instance structure for the floating-point Linear Interpolate function | ||||||||||||||||||||||||
Carm_lms_instance_f32 | Instance structure for the floating-point LMS filter | ||||||||||||||||||||||||
Carm_lms_instance_q15 | Instance structure for the Q15 LMS filter | ||||||||||||||||||||||||
Carm_lms_instance_q31 | Instance structure for the Q31 LMS filter | ||||||||||||||||||||||||
Carm_lms_norm_instance_f32 | Instance structure for the floating-point normalized LMS filter | ||||||||||||||||||||||||
Carm_lms_norm_instance_q15 | Instance structure for the Q15 normalized LMS filter | ||||||||||||||||||||||||
Carm_lms_norm_instance_q31 | Instance structure for the Q31 normalized LMS filter | ||||||||||||||||||||||||
Carm_matrix_instance_f16 | Instance structure for the floating-point matrix structure | ||||||||||||||||||||||||
Carm_matrix_instance_f32 | Instance structure for the floating-point matrix structure | ||||||||||||||||||||||||
Carm_matrix_instance_f64 | Instance structure for the floating-point matrix structure | ||||||||||||||||||||||||
Carm_matrix_instance_q15 | Instance structure for the Q15 matrix structure | ||||||||||||||||||||||||
Carm_matrix_instance_q31 | Instance structure for the Q31 matrix structure | ||||||||||||||||||||||||
Carm_matrix_instance_q7 | Instance structure for the Q7 matrix structure | ||||||||||||||||||||||||
Carm_merge_sort_instance_f32 | Instance structure for the sorting algorithms | ||||||||||||||||||||||||
Carm_mfcc_instance_f16 | Instance structure for the Floating-point MFCC function | ||||||||||||||||||||||||
Carm_mfcc_instance_f32 | Instance structure for the Floating-point MFCC function | ||||||||||||||||||||||||
Carm_mfcc_instance_q15 | Instance structure for the Q15 MFCC function | ||||||||||||||||||||||||
Carm_mfcc_instance_q31 | Instance structure for the Q31 MFCC function | ||||||||||||||||||||||||
Carm_pid_instance_f32 | Instance structure for the floating-point PID Control | ||||||||||||||||||||||||
Carm_pid_instance_q15 | Instance structure for the Q15 PID Control | ||||||||||||||||||||||||
Carm_pid_instance_q31 | Instance structure for the Q31 PID Control | ||||||||||||||||||||||||
Carm_rfft_fast_instance_f16 | Instance structure for the floating-point RFFT/RIFFT function | ||||||||||||||||||||||||
Carm_rfft_fast_instance_f32 | Instance structure for the floating-point RFFT/RIFFT function | ||||||||||||||||||||||||
Carm_rfft_fast_instance_f64 | Instance structure for the Double Precision Floating-point RFFT/RIFFT function | ||||||||||||||||||||||||
Carm_rfft_instance_f32 | Instance structure for the floating-point RFFT/RIFFT function | ||||||||||||||||||||||||
Carm_rfft_instance_q15 | Instance structure for the Q15 RFFT/RIFFT function | ||||||||||||||||||||||||
Carm_rfft_instance_q31 | Instance structure for the Q31 RFFT/RIFFT function | ||||||||||||||||||||||||
Carm_sort_instance_f32 | Instance structure for the sorting algorithms | ||||||||||||||||||||||||
Carm_spline_instance_f32 | Instance structure for the floating-point cubic spline interpolation | ||||||||||||||||||||||||
Carm_svm_linear_instance_f16 | Instance structure for linear SVM prediction function | ||||||||||||||||||||||||
Carm_svm_linear_instance_f32 | Instance structure for linear SVM prediction function | ||||||||||||||||||||||||
Carm_svm_polynomial_instance_f16 | Instance structure for polynomial SVM prediction function | ||||||||||||||||||||||||
Carm_svm_polynomial_instance_f32 | Instance structure for polynomial SVM prediction function | ||||||||||||||||||||||||
Carm_svm_rbf_instance_f16 | Instance structure for rbf SVM prediction function | ||||||||||||||||||||||||
Carm_svm_rbf_instance_f32 | Instance structure for rbf SVM prediction function | ||||||||||||||||||||||||
Carm_svm_sigmoid_instance_f16 | Instance structure for sigmoid SVM prediction function | ||||||||||||||||||||||||
Carm_svm_sigmoid_instance_f32 | Instance structure for sigmoid SVM prediction function |
►Narm_cmsis_dsp | |
►Ninner | |
C_AddOp | Add operator |
C_BinaryOperator | Unary operator |
C_MulOp | Mul operator |
C_NegOp | Neg operator |
C_NoOp | No operator |
C_SubOp | Sub operator |
C_UnaryOperator | Unary operator |
Carm_bilinear_interp_instance_f16 | Instance structure for the floating-point bilinear interpolation function |
Carm_bilinear_interp_instance_f32 | Instance structure for the floating-point bilinear interpolation function |
Carm_bilinear_interp_instance_q15 | Instance structure for the Q15 bilinear interpolation function |
Carm_bilinear_interp_instance_q31 | Instance structure for the Q31 bilinear interpolation function |
Carm_bilinear_interp_instance_q7 | Instance structure for the Q15 bilinear interpolation function |
Carm_biquad_cas_df1_32x64_ins_q31 | Instance structure for the high precision Q31 Biquad cascade filter |
Carm_biquad_cascade_df2T_instance_f16 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_df2T_instance_f32 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_df2T_instance_f64 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_stereo_df2T_instance_f16 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_stereo_df2T_instance_f32 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_casd_df1_inst_f16 | Instance structure for the floating-point Biquad cascade filter |
Carm_biquad_casd_df1_inst_f32 | Instance structure for the floating-point Biquad cascade filter |
Carm_biquad_casd_df1_inst_q15 | Instance structure for the Q15 Biquad cascade filter |
Carm_biquad_casd_df1_inst_q31 | Instance structure for the Q31 Biquad cascade filter |
Carm_cfft_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_instance_f64 | Instance structure for the Double Precision Floating-point CFFT/CIFFT function |
Carm_cfft_instance_q15 | Instance structure for the fixed-point CFFT/CIFFT function |
Carm_cfft_instance_q31 | Instance structure for the fixed-point CFFT/CIFFT function |
Carm_cfft_radix2_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix2_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix2_instance_q15 | Instance structure for the Q15 CFFT/CIFFT function |
Carm_cfft_radix2_instance_q31 | Instance structure for the Radix-2 Q31 CFFT/CIFFT function |
Carm_cfft_radix4_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix4_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix4_instance_q15 | Instance structure for the Q15 CFFT/CIFFT function |
Carm_cfft_radix4_instance_q31 | Instance structure for the Q31 CFFT/CIFFT function |
Carm_dct4_instance_f32 | Instance structure for the floating-point DCT4/IDCT4 function |
Carm_dct4_instance_q15 | Instance structure for the Q15 DCT4/IDCT4 function |
Carm_dct4_instance_q31 | Instance structure for the Q31 DCT4/IDCT4 function |
Carm_fir_decimate_instance_f32 | Instance structure for floating-point FIR decimator |
Carm_fir_decimate_instance_q15 | Instance structure for the Q15 FIR decimator |
Carm_fir_decimate_instance_q31 | Instance structure for the Q31 FIR decimator |
Carm_fir_instance_f16 | Instance structure for the floating-point FIR filter |
Carm_fir_instance_f32 | Instance structure for the floating-point FIR filter |
Carm_fir_instance_f64 | Instance structure for the floating-point FIR filter |
Carm_fir_instance_q15 | Instance structure for the Q15 FIR filter |
Carm_fir_instance_q31 | Instance structure for the Q31 FIR filter |
Carm_fir_instance_q7 | Instance structure for the Q7 FIR filter |
Carm_fir_interpolate_instance_f32 | Instance structure for the floating-point FIR interpolator |
Carm_fir_interpolate_instance_q15 | Instance structure for the Q15 FIR interpolator |
Carm_fir_interpolate_instance_q31 | Instance structure for the Q31 FIR interpolator |
Carm_fir_lattice_instance_f32 | Instance structure for the floating-point FIR lattice filter |
Carm_fir_lattice_instance_q15 | Instance structure for the Q15 FIR lattice filter |
Carm_fir_lattice_instance_q31 | Instance structure for the Q31 FIR lattice filter |
Carm_fir_sparse_instance_f32 | Instance structure for the floating-point sparse FIR filter |
Carm_fir_sparse_instance_q15 | Instance structure for the Q15 sparse FIR filter |
Carm_fir_sparse_instance_q31 | Instance structure for the Q31 sparse FIR filter |
Carm_fir_sparse_instance_q7 | Instance structure for the Q7 sparse FIR filter |
Carm_gaussian_naive_bayes_instance_f16 | Instance structure for Naive Gaussian Bayesian estimator |
Carm_gaussian_naive_bayes_instance_f32 | Instance structure for Naive Gaussian Bayesian estimator |
Carm_iir_lattice_instance_f32 | Instance structure for the floating-point IIR lattice filter |
Carm_iir_lattice_instance_q15 | Instance structure for the Q15 IIR lattice filter |
Carm_iir_lattice_instance_q31 | Instance structure for the Q31 IIR lattice filter |
Carm_linear_interp_instance_f16 | Instance structure for the half floating-point Linear Interpolate function |
Carm_linear_interp_instance_f32 | Instance structure for the floating-point Linear Interpolate function |
Carm_lms_instance_f32 | Instance structure for the floating-point LMS filter |
Carm_lms_instance_q15 | Instance structure for the Q15 LMS filter |
Carm_lms_instance_q31 | Instance structure for the Q31 LMS filter |
Carm_lms_norm_instance_f32 | Instance structure for the floating-point normalized LMS filter |
Carm_lms_norm_instance_q15 | Instance structure for the Q15 normalized LMS filter |
Carm_lms_norm_instance_q31 | Instance structure for the Q31 normalized LMS filter |
Carm_matrix_instance_f16 | Instance structure for the floating-point matrix structure |
Carm_matrix_instance_f32 | Instance structure for the floating-point matrix structure |
Carm_matrix_instance_f64 | Instance structure for the floating-point matrix structure |
Carm_matrix_instance_q15 | Instance structure for the Q15 matrix structure |
Carm_matrix_instance_q31 | Instance structure for the Q31 matrix structure |
Carm_matrix_instance_q7 | Instance structure for the Q7 matrix structure |
Carm_merge_sort_instance_f32 | Instance structure for the sorting algorithms |
Carm_mfcc_instance_f16 | Instance structure for the Floating-point MFCC function |
Carm_mfcc_instance_f32 | Instance structure for the Floating-point MFCC function |
Carm_mfcc_instance_q15 | Instance structure for the Q15 MFCC function |
Carm_mfcc_instance_q31 | Instance structure for the Q31 MFCC function |
Carm_pid_instance_f32 | Instance structure for the floating-point PID Control |
Carm_pid_instance_q15 | Instance structure for the Q15 PID Control |
Carm_pid_instance_q31 | Instance structure for the Q31 PID Control |
Carm_rfft_fast_instance_f16 | Instance structure for the floating-point RFFT/RIFFT function |
Carm_rfft_fast_instance_f32 | Instance structure for the floating-point RFFT/RIFFT function |
Carm_rfft_fast_instance_f64 | Instance structure for the Double Precision Floating-point RFFT/RIFFT function |
Carm_rfft_instance_f32 | Instance structure for the floating-point RFFT/RIFFT function |
Carm_rfft_instance_q15 | Instance structure for the Q15 RFFT/RIFFT function |
Carm_rfft_instance_q31 | Instance structure for the Q31 RFFT/RIFFT function |
Carm_sort_instance_f32 | Instance structure for the sorting algorithms |
Carm_spline_instance_f32 | Instance structure for the floating-point cubic spline interpolation |
Carm_svm_linear_instance_f16 | Instance structure for linear SVM prediction function |
Carm_svm_linear_instance_f32 | Instance structure for linear SVM prediction function |
Carm_svm_polynomial_instance_f16 | Instance structure for polynomial SVM prediction function |
Carm_svm_polynomial_instance_f32 | Instance structure for polynomial SVM prediction function |
Carm_svm_rbf_instance_f16 | Instance structure for rbf SVM prediction function |
Carm_svm_rbf_instance_f32 | Instance structure for rbf SVM prediction function |
Carm_svm_sigmoid_instance_f16 | Instance structure for sigmoid SVM prediction function |
Carm_svm_sigmoid_instance_f32 | Instance structure for sigmoid SVM prediction function |
Cnumber_traits< double > | Features for double |
Cnumber_traits< float > | Features for float |
Cnumber_traits< float16_t > | Feature of float16 datatype |
Cnumber_traits< Q15 > | Q15 features |
Cnumber_traits< Q31 > | Features for Q31 |
Cnumber_traits< Q7 > | Q7 features |
Cnumber_traits< std::tuple< E... > > | Number description for a tuple of numbers |
CQ15DSPVector | Representation of a vector when DSP extension supported |
Cvector_traits< double, arch, void > | Default vector datatype description for this scalar datatype |
Cvector_traits< float, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | Vector datatype for Helium |
Cvector_traits< float, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > | Vector instructions for float when no Helium or Neon |
Cvector_traits< float16_t > | Float16 vector descrition when no vector architecture |
Cvector_traits< float16_t, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | Vector features for f16 on Helium |
Cvector_traits< Q15, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | Vector features for Q15 on Helium |
Cvector_traits< Q15, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > | Vector features for Q15 when no vector architecture |
Cvector_traits< Q15, DSP, typename std::enable_if< true >::type > | Vector description for Q15 with DSP extensions |
Cvector_traits< Q31, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > | Vector features for Q31 when no vector instructions |
Cvector_traits< Q7, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > | Vector descrition when no vector architecture |
Cvector_traits< std::tuple< E... >, arch > | Tuple of compatible vectors |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Typedefs | |
+typedef int32_t | index_t |
index datatype. It must be a signed datatype | |
+typedef int32_t | vector_length_t |
Vector length datatype. Iy must be a signed datatype. | |
+Functions | |
template<typename T > | |
void | PrintType (void) |
Prints a textual representation of a type. | |
+Files | |
file | double.hpp |
file | num_features/float.hpp |
file | group.hpp |
file | num_features/half.hpp |
file | num_features/q15.hpp |
file | num_features/q31.hpp |
file | num_features/q7.hpp |
+Files | |
file | Helium/basic.hpp |
file | Helium/float.hpp |
file | Helium/half.hpp |
file | Helium/matrix_multiply.hpp |
file | matrix_multiply_f16.hpp |
file | matrix_multiply_f32.hpp |
file | Helium/matrix_multiply_fixed.hpp |
file | Helium/num_features.hpp |
file | Helium/q15.hpp |
file | Helium/q31.hpp |
file | Helium/q7.hpp |
+Files | |
file | Scalar/basic.hpp |
file | Scalar/matrix_multiply.hpp |
file | Scalar/matrix_multiply_fixed.hpp |
file | matrix_multiply_float.hpp |
+Files | |
file | DSP/basic.hpp |
file | DSP/matrix_multiply.hpp |
file | memory.hpp |
file | DSP/num_features.hpp |
file | DSP/q15.hpp |
file | DSP/q7.hpp |
+Directories | |
directory | DSP |
directory | Helium |
directory | Neon |
directory | num_features |
directory | Scalar |
+Files | |
file | algorithms.hpp |
file | arch.hpp |
file | common.hpp |
file | fixed_point.hpp |
file | forward.hpp |
file | fusion.hpp |
file | fusion_ops.hpp |
file | matrix.hpp |
file | matrix_impl.hpp |
file | matrix_view.hpp |
file | memory_pool.hpp |
file | number.hpp |
file | unroll.hpp |
file | vec.hpp |
file | vector_impl.hpp |
file | vector_view.hpp |
+Directories | |
directory | dsppp |
+Data Structures | |
struct | number_traits< double > |
Features for double. More... | |
struct | vector_traits< double, arch, void > |
Default vector datatype description for this scalar datatype. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
double | from_accumulator (const double a) |
Convert from accumulator representation. | |
double | mac (const double acc, const double a, const double b) |
Multiply and accumulate for this datatype. | |
void | accumulate (double &a, const double &b) |
Accumulate. | |
double | mult (double &a, const double &b) |
Multiply. | |
First time:
+Other times:
+If you want to select another test, edit the file example.cproject.yml
and uncomment the test.
If the tools have been installed with vcpkg
:
Otherwise, you'll need to use the path to your FVP installation.
+ It was explained in previous sections that types Vector<T,NB1>
and Vector<T,NB2>
are considered as different types if NB1
and NB2
are differents.
A template algorithm is like a code generator that will generate different code for different values of the template arguments : the types.
+If you use a template algorithm with different vector datatypes, it will generate different code for those two datatypes. The generated code will be specialized for the specific datatypes used and thus is likely to be more efficient.
+But then it means you get different implementations so more code size.
+If you have a lot of different sizes in your system, then you're likely to get too much code size and in that case it may be better to use dynamic objects instead of static ones.
+dynamic objects are less efficient so it is a trade-off between code size / speed.
+With this line of code, there is loop fusion : instead of having one loop per operator there is one loop for the whole computation.
+It is important to have some ideas of how it works to avoid some mistake in the use of the library.
+In above code, a + b * c
is not computing anything ! a + b * c
is creating a representation of the expression : an abstract syntax tree (AST) at build time.
When this AST is assigned to the variable d
it is evaluated. The evaluation forces the inlining of the expression operators in one loop. The code generated thus contains only one loop with a fusion of all the operators : +
and *
.
The library is supporting virtual vectors. They are a view on an existing part of a vector. You can use a virtual vector for instance to read some samples with a stride. Or write some samples with a stride. A virtual vector does not own its memory.
+If you write:
and d
and a
are virtual vectors then nothing will be written to d
!
d
will becomes a
and a
will no more be valid.
If you want to copy a virtual vector you need to make an expression and write:
+Note that this problem occurs only for virtual vectors who do not own their memory.
+For real vectors, a copy would occur. But since there is no overhead in adding copy
it is better to do it to avoid problems.
If you want to compute the dot product:
++\[ + +<scale*(\overrightarrow{a}+\overrightarrow{b}),\overrightarrow{c}*\overrightarrow{d}> + +\] +
+with CMSIS-DSP, you would write:
+There are several limitations with this way of writing the code:
+_f32
suffix changed if the developer wants to use another datatypetmp1
,tmp2
,tmp3
,tmp4
)arm_add_f32
, two loads, an add instruction and a store. It is not enough to enable the compiler to reorder the instructions to improve the performanceWith this new C++ template library, you can write:
+The code generated by this line computes the dot product in one pass with all the operators (+
, *
) included in the loop. There is no more any temporary buffers.
Let's look at another example:
++\[ + +\overrightarrow{d} = \overrightarrow{a} + \overrightarrow{b} * \overrightarrow{c} + +\] +
+With the C++ library, it can be written as:
+Here again : all the vector operations (+
,*
) are done in one pass with one loop. There is no more any temporary buffer.
If you're coming from C and does not know anything about C++ templates, we have a very quick introduction : The minimum you need to know about C++ template to use this library.
+You can also jump directly to an example with vector operations.
+C++ extensions to CMSIS-DSP using C++ template meta-programming (headers only).
+The headers are not yet part of the CMSIS-DSP pack since they are experimental. You can get them from the CMSIS-DSP github. There is nothing to build. Just include the headers when you want to use this framework.
+ +Matrixes can be used similarly to vectors:
+If the dimensions of the matrixes are not known at build time, you would instead write:
+Once you have matrixes, you need to initialize them. A matrix is also a vector, so you can initialize it by indexing into the vector:
+You can also use a bidimensional indexing:
+Once you have initialized matrixes, you can operate on them:
+The operators +
and *
are merged into the loop. *
is the element-wise multiply. For the vector / matrix products you should use the operator dot
.
Note that fusion of operators will not work with dot(Matrix, Matrix
). It is only supported with vectors : dot(Vector,Vector)
or dot(Matrix,Vector)
.
We can create virtual vectors which are view of some slices of the matrix.
+To set the second row to 0.0f
, you can do:
To set the odd elements of the 3rd row to 0.0f
we can do:
The first argument 2
is the row number (starting from 0
).
The second argument 1
is where is the row we start the view : element 1
.
<2>
is the stride known at built time.
The row
API is:
stop
is the index of the first element after the end of the view.
i
is the row index
There is a similar API for columns.
+Let's set the odd elements of columns 3 to 5.0f
:
It is also possible to create a virtual matrix : a view onto a subset of the matrix.
+Let's add the bottom right corner of the matrix to itself:
+The API is:
+You specify the row start and row end, then column start and column end.
+Note that the end is the first index after the end of your rows or columns.
+No stride is supported for matrix view in this version of the library.
+In addition to the vector operations +
,-
and *
, matrixes are supporting more operations:
dot
for vector / matrix productsdiagonal
to create a diagonal matrix from a vector.identity
to create an identity matrixtranpose
to create the transposed matrixouter
for the outer product of two vectorsThe compiler may use the move semantic to copy the temporary result of the dot
function to result
.
In this case, no copy would occur and result
after the assignment would be a vector allocated by dot
so using the TMP_ALLOC
.
or
+is allocating a vector of dimension NB
(known at build time) and datatype float32_t
.
The definition of the Vector
template is:
It means that by default the memory allocator is TMP_ALLOC
.
This TMP_ALLOC
#define
can be changed if you define it before including any header from the library.
An allocator should implement a template like:
+It has no state because in practice we observed that compilers were generating more efficient code without state in the memory allocator template.
+If you don't want to use a malloc
based memory allocator, you can replace it with your own memory allocator and implement an API like the one just shown in malloc_allocator
.
For instance, often in DSP pipelines, the dimensions of the vectors and matrixes are fixed and known at build time. In that case, you could replace the memory allocator by one using memory pools.
+With memory pools, allocation is nearly cost free and there is no fragmentation.
+The test framework of the library is providing an example in allocator.h
and allocator.cpp
.
There are two memory allocators:
+stat_allocator
is a malloc
based allocator that is making statistics on the memory allocations and how many buffers of each dimension is requiredpool_allocator
can use the data generated by stat_allocator
to pre-allocate memory pools that will be then used for the memory allocations. The memory pools are also creating aligned buffers.It is no more difficult (and less difficult) than allocating temporary buffers in CMSIS-DSP.
+You could define the TMP_ALLOC
with:
You use stat_allocator
by default. When your code is working, you switch to pool_allocator
to have better performance and determinism.
Another possibility is to use different vector types:
+Note that you cannot avoid using TMP_ALLOC
because some functions in the library are creating temporary objects. For instance, if you want to make an identity matrix, you can use mk_identity
that will make a memory allocation using TMP_ALLOC
Also note that if you create a vector with:
+then the dimension NB
is a runtime parameter. The memory pool allocator given as example in this library is only working with dimensions known at build time. For runtime dimensions, it is still using a malloc
.
As we have seen in the previous sections, there are two kind of vectors:
+Vector<T>
with a dimension know at runtimeVector<T,NB>
with a dimension known at build timeThe former vectors are called "dynamic" ins this library. The later are called "static".
+This naming "static" / "dynamic" is referring to the dimension. With "dynamic" vectors the same code can, at runtime, create vectors of different length based on a runtime length.
+With "static" vectors : the length is fixed at build time and will never change at runtime.
+Note that the library also have "static" / "dynamic" matrixes. So, we are going to use "objects" to cover both cases
+The advantage of static objects is that the dimension is known at build time. The compiler can thus generate an algorithm that is specialized for those dimensions and thus more efficient.
+With static objects it is also possible to use different memory allocator with better performances and determinism.
+But, with static objects, objects of different dimension are considered as different types. The compiler will generate different implementation so it will have an impact on the code dimension.
+If you need lots of objects of different dimensions, or if the dimensions are nort known at build time, then you need to use dynamic object
+With dynamic objects, the dimension is know at runtime. So object of different dimensions have the same datatype and the compiler is generating only one implementation for all those objects. It cannot generate specialized implementations based on the dimension. It is better for code size, but the implementations will be less efficient.
+Also when dimension is not know at build time, some instruction selection made by the C++ library at build time is no more possible. It has an effect on performance since at runtime one must decides what's possible or not. It is mostly impacting matrixes where stride information is needed.
+With vector instructions one can use scatter / gather instructions and they require a stride. But there are constraints depending on the datatype and when the stride is too big for those instructions, they cannot be used. This check has to be done at runtime for dynamic object.
+Finally, with dynamic object, memory allocation can be an issue. You can mitigate the problem by reusing temporaries in your algorithms instead of re-allocating them. But it makes the implementation more difficult. See section about Guidelines.
+In CMSIS-DSP, you have functions like:
+arm_add_f32
arm_add_f64
Without unrolling, the scalar implementation is the same but is duplicated (two different source files to maintain although they are nearly the same).
+One could try to reuse the same source for both functions using C preprocessor. But we would still have two different functions with different names at the end (both generated from the same C + C preprocessor macros)
+With C++ templates, we can achieve the same result in a better way since the C++ compiler will check the templates and typecheck them. In addition to that, both functions can share the same name.
+With C++ template, we could have a generic function arm_add
taking as argument a pointer T *pSrc
where T
is a type variable !
When the function is used with a float32_t *
, the compiler would generate code for a function using float32_t
.
And if the function is used with a float64_t *
, the compiler would generate code for a function using float64_t
.
The generic arm_add
source code is a template used to generate different implementations. It is like a code generator.
And if the compiler is unable to generate an implementation because the type variable T
is replaced by a type with no addition operator, then it would be detected by the compiler.
C++ templates also apply to structs and classes.
+For instance, we could have a template Vector<T>
and thus different types Vector<float32_t>
, Vector<Q15>
...
There is another aspect of C++ templates that may be surprising : the types can contain numbers.
+For instance, one could have a type Vector<float32_t,10>
for a vector of float
and of length 10
. The length being known at build time.
The types Vector<float32_t,10>
and Vector<float32_t,5>
should be considered as different types because they have different lengths. The length is part of the type.
What we said above for code generation applies. For a template algorithm using any kind of vector, the compiler would generate different code for different vector types. The code for a template algorithm using Vector<float32_t,10>
would be different from the code for Vector<float32_t,5>
because those two types are different.
A template can also have implicit parameters.
+For instance one could use Vector<float32_t>
or Vector<float32_t,10>
.
In the first case, the length is an implicit parameter with a default value and it is equivalent to writing Vector<float32_t,DYNAMIC>
where DYNAMIC
could be a special value (negative for instance) used to tell the compiler that the length of the vector is not known at build time but only at runtime.
Both variants may use totally different implementations. The DYNAMIC
variant may contain a length
field in the struct
definition whereas other variants do not need this field since the length is known at build time.
A template is just a C++ header. You only need to include this header to start using the template. There is nothing to build.
+Now you can look at an example with vector operations showing how to use the library
+ The use of vectors has been explained in example with vector operations and focusing on float32_t
.
The vector template is defined as:
+P
is the datatype of vector elementsL
is the static length of the vector (length known at build time). L<0
when the length is dynamic and not known at build time. It is the default value.Allocator
is the memory allocator. By default it is TMP_ALLOC
that you can redefine since it is a macroVector_Base<P>
is providing the storage. A vector owns its storage buffer.Example with Q15
is very similar:
The vectors are defined:
+They are initialized:
+Here, the Q15
value is initialized from the int value i
and thus represents \( i/2^{15} \)
Some computation is done
+The result is displayed:
+A vector view is a virtual vector : a view of a vector.
+One can define a VectorView
with:
This is creating a virtual vector starting at index 2
(3rd element) of vector d
.
You can then operate with this virtual vector:
+If you display the vector d
, you'll see that 2.0f
has been added to all elements starting from the 2rd one.
VectorView
do not own their memory. It is owned by the original vector.
If you write:
+and x
and y
are VectorView
, no copy will occur. x
will just reference the same data as y
. If you want to copy you have to be explicit and write:
It is advised to always use the copy
operator (even with normal vectors).
Virtual vectors can have a stride:
+This line sets the odd elements of the vector to 0.0f
. It is creating a vvirtual vector with stride 2
and starting at index 1
of first vector.
Then, all elements of this virtual vector are set to 0.0f
.
The sub
API is:
You can define:
+S
: statically known and by default 1
.0
by default)L
by default : the length known at build time). Note that it is the first index after the end of the vector. +\[ + +\overrightarrow{d} = \overrightarrow{a} + \overrightarrow{b} * \overrightarrow{c} + +\] +
+we need to:
The headers are not yet part of the CMSIS-DSP packs since they are experimental. You can get them from the CMSIS-DSP github
+If fixed point datatypes are required, #include <fixed_point>
should be used before <matrix>
Fixed point requires the use of CMSIS-DSP.
+To create a vector a
you would write:
Vector<float32_t,NB>
is creating a vector of dimension NB
(known at build time) and datatype float32_t
. This creation is requiring some memory allocation and by default it is done with a malloc
.
It is possible to change the memory allocator for the vectors (and it is advised) to avoid using malloc
and instead have deterministic allocation without fragmentation.
See section Memory allocation.
+Vectors of different dimensions are considered as being different types.
+If you don't know the dimension at build time, you can use a different type of vector with:
+For the trade-off between vector with build time dimension or runtime dimension please see the section Static / dynamic .
+You can index the vectors as normal C arrays.
+The computation can be written normally as :
+Note that the computation can be parametrized with template arguments so the same computation could be used with any datatype or length. In that case you would have to define a template (and not just a normal function) and inside you would use something like:
+where T
is a type variable coming from the template.
The operators +
, *
are computed in one pass with one loop : we have loop fusion and instead of having a loop per operator we have a loop for the whole computation.
To understand fusion and how to extend it with new operators, see section Fusion .
+For an overview of vector operators, see section Vector . For an overview of matrix operators, see section Matrix .
+The vectors can be displayed on stdout
for debug purpose.
► dsppp |
#include <cstdint>
#include "arch.hpp"
#include <cstdlib>
#include <type_traits>
#include <iostream>
+Data Structures | |
struct | fixed_storage_type< M, F, s, bool > |
Storage type for a fixed point number. More... | |
struct | fixed_storage_type< M, F, true, test64(M, F, 1)> |
Storage type for a fixed point number representable on int64. More... | |
struct | fixed_storage_type< M, F, false, test64(M, F, 0)> |
Storage type for a fixed point number representable on uint64. More... | |
struct | fixed_storage_type< M, F, true, test32(M, F, 1)> |
Storage type for a fixed point number representable on int32. More... | |
struct | fixed_storage_type< M, F, false, test32(M, F, 0)> |
Storage type for a fixed point number representable on uint32. More... | |
struct | fixed_storage_type< M, F, true, test16(M, F, 1)> |
Storage type for a fixed point number representable on int16. More... | |
struct | fixed_storage_type< M, F, false, test16(M, F, 0)> |
Storage type for a fixed point number representable on uint16. More... | |
struct | fixed_storage_type< M, F, true, test8(M, F, 1)> |
Storage type for a fixed point number representable on int8. More... | |
struct | fixed_storage_type< M, F, false, test8(M, F, 0)> |
Storage type for a fixed point number representable on uint8. More... | |
struct | Q< M, F, S, T > |
Fixed point template. More... | |
struct | Q< M, F, true, int64_t > |
Signed fixed point datatypes on 64 bits. More... | |
struct | Q< M, F, false, uint64_t > |
Unsigned fixed point datatypes on 64 bits. More... | |
struct | Q< M, F, true, int32_t > |
Signed fixed point datatypes on 32 bits. More... | |
struct | Q< M, F, false, uint32_t > |
Unsigned fixed point datatypes on 32 bits. More... | |
struct | Q< M, F, true, int16_t > |
Signed fixed point datatypes on 16 bits. More... | |
struct | Q< M, F, false, uint16_t > |
Unsigned fixed point datatypes on 16 bits. More... | |
struct | Q< M, F, true, int8_t > |
Signed fixed point datatypes on 8 bits. More... | |
struct | Q< M, F, false, uint8_t > |
Unsigned fixed point datatypes on 8 bits. More... | |
struct | FixedCastShift< M, FD, FS, S,(FD >FS)> |
Changed fractional representation of a fixed point number using a shift. More... | |
struct | FixedCastShift< M, FD, FS, S,(FD< FS)> |
Changed fractional representation of a fixed point number using a shift. More... | |
struct | Accumulate< MD, MS, F, S, true > |
Accumulation without saturation. More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Typedefs | |
+using | Q63 = Q< 0, 63 > |
Q63 datatype. | |
+using | Q31 = Q< 0, 31 > |
Q31 datatype. | |
+using | Q15 = Q< 0, 15 > |
Q15 datatype. | |
+using | Q7 = Q< 0, 7 > |
Q7 datatype. | |
+Functions | |
constexpr bool | test64 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 64 bits. | |
constexpr bool | test32 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 32 bits. | |
constexpr bool | test16 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 16 bits. | |
constexpr bool | test8 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 8 bits. | |
constexpr Q63 | operator""_q63 (long double x) |
q63 literal | |
constexpr Q31 | operator""_q31 (long double x) |
q31 literal | |
constexpr Q15 | operator""_q15 (long double x) |
q15 literal | |
constexpr Q7 | operator""_q7 (long double x) |
q7 literal | |
template<int MA, int FA, int MB, int FB, bool SA, bool SB> | |
Q< MA+MB+1, FA+FB, SA||SB > | mult (const Q< MA, FA, SA > &a, const Q< MB, FB, SB > &b) |
Multiplication of two fixed point numbers A and B. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator+ (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Add two fixed point numbers with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator- (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Subtract two fixed point numbers with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator- (const Q< M, F, S > &a) |
Negate a fixed point number with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | add (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Add two fixed point numbers without saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | sub (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Subtract two fixed point numbers without saturation. | |
template<int M, int F, int N, bool S> | |
Q< M, F, S > | operator>> (const Q< M, F, S > &a, std::integral_constant< int, N >) noexcept |
Shift right a fixed point number with a shift known at build time. | |
template<int M, int F, int N, bool S> | |
Q< M+N, F, S > | operator<< (const Q< M, F, S > &a, std::integral_constant< int, N >) noexcept |
Shift left a fixed point number with a shift known at build time. | |
template<int MD = 0, int MS, int F> | |
Q< MD, F, true > | saturate (const Q< MS, F, true > &src, typename std::enable_if<(MD< MS) &&((MD+F)< 31)>::type *=nullptr) |
Saturate a signed fixed point number. | |
template<int MD = 0, int MS, int F> | |
Q< MD, F, false > | saturate (const Q< MS, F, false > &src, typename std::enable_if<(MD< MS) &&((MD+F)< 31)>::type *=nullptr) |
Saturate an unsigned fixed point number. | |
template<int FD, int M, int FS, bool S> | |
Q< M, FD, S > | toFrac (const Q< M, FS, S > &src) |
Convert between different fractional part formats. | |
template<int MD, int MS, int F, bool S> | |
Q< MD, F, S > | accumulate (const Q< MD, F, S > &a, const Q< MS, F, S > &b) |
Accumulate without saturation. | |
Q7 | operator* (const Q7 &a, const Q7 &b) |
Multiplication operator. | |
Q15 | operator* (const Q15 &a, const Q15 &b) |
Multiplication operator. | |
Q31 | operator* (const Q31 &a, const Q31 &b) |
Multiplication operator. | |
template<int M, int F> | |
bool | operator> (const Q< M, F > &a, const Q< M, F > &b) |
Greater-than comparison operator. | |
template<int M, int F> | |
bool | operator< (const Q< M, F > &a, const Q< M, F > &b) |
Less-than comparison operator. | |
template<int M, int F> | |
bool | operator>= (const Q< M, F > &a, const Q< M, F > &b) |
Greater-than-or-equal comparison operator. | |
template<int M, int F> | |
bool | operator<= (const Q< M, F > &a, const Q< M, F > &b) |
Less-than-or-equal comparison operator. | |
template<int M, int F> | |
bool | operator== (const Q< M, F > a, const Q< M, F > b) |
Equality operator. | |
template<int M, int F> | |
bool | operator!= (const Q< M, F > a, const Q< M, F > b) |
Inequality operator. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator/ (const Q< M, F, S > a, const int32_t b) |
Division operator. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator+ (const Q< M, F, S > &a) |
No op operator. | |
+Namespaces | |
namespace | arm_cmsis_dsp |
#include "fusion_ops.hpp"
+Data Structures | |
struct | _Expr< T > |
Expression template. More... | |
struct | _Binary< LHS, RHS, DerivedOp > |
Expression for binary operator. More... | |
struct | _Unary< LHS, DerivedOp > |
Expression for unary operator. More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Functions | |
template<typename DA > | |
constexpr bool | has_vector_inst () |
Determines if vector datatype supports vector instruction on a current architecture. | |
template<typename DA > | |
constexpr bool | has_predicate_inst () |
Determines if datatype has predicated loop for current architecture. | |
template<typename DA > | |
constexpr bool | is_scalar () |
Determines if scalar datatype (not vector, vectorview, matrix, matrixview) | |
template<typename DA > | |
constexpr bool | must_use_matrix_idx () |
Check if datatype can only be used as a matrix (no vector addressing) | |
template<typename DA , typename DB > | |
constexpr bool | vector_idx_pair () |
Check if both datatype have vector indexing are same scalar datatype. | |
template<typename DA > | |
constexpr bool | is_only_vector () |
Check if has vector indexing. | |
template<typename DA , typename DB > | |
constexpr bool | must_use_matrix_idx_pair () |
Check if datatypes have same scalar datatype and no vector indexing. | |
template<typename DA , typename DB > | |
constexpr vector_length_t | static_length () |
Static length. | |
template<typename DA , typename DB > | |
constexpr bool | same_static_length () |
Check compatibility of length. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >() &&is_only_vector< VA >() &&is_only_vector< VB >() &&(!IsDynamic< VA >::value||!IsDynamic< VB >::value), bool >::type = true> | |
DotResult< VA > | dot (const VA &a, const VB &b) |
Dot product. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >() &&(!IsDynamic< VA >::value||!IsDynamic< VB >::value), bool >::type = true> | |
void | swap (VA &&a, VB &&b) |
Swap vectors. | |
+Data Structures | |
struct | _UnaryOperator< Scalar, Derived > |
Unary operator. More... | |
struct | _BinaryOperator< Scalar, Derived > |
Unary operator. More... | |
struct | _AddOp< Scalar > |
Add operator. More... | |
struct | _SubOp< Scalar > |
Sub operator. More... | |
struct | _MulOp< Scalar > |
Mul operator. More... | |
struct | _NegOp< Scalar > |
Neg operator. More... | |
struct | _NoOp< Scalar > |
No operator. More... | |
+Data Structures | |
struct | number_traits< std::tuple< E... > > |
Number description for a tuple of numbers. More... | |
struct | vector_traits< std::tuple< E... >, arch > |
Tuple of compatible vectors. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
template<typename A , typename V , std::size_t... Ns> | |
A | vmacc_impl (const A &acc, const V &a, const V &b, std::index_sequence< Ns... >) |
Vector accumulate for tuples of vectors. | |
template<typename A , typename ... E> | |
A | vmacc (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b) |
Vector accumulate for tuples of vectors. | |
template<typename A , typename V , typename B , std::size_t... Ns> | |
A | vmacc_impl (const A &acc, const V &a, const V &b, const B p0, std::index_sequence< Ns... >) |
Predicated vector accumulate for tuple. | |
template<typename A , typename B , typename ... E> | |
A | vmacc (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b, const B p0) |
Predicated vector accumulate for tuples. | |
template<typename A , std::size_t... Ns> | |
auto | vreduce_impl (const A &acc, std::index_sequence< Ns... >) |
Reduce function for tuple. | |
template<typename ... E> | |
auto | vreduce (const std::tuple< E... > &acc) |
Reduce function for tuples. | |
template<typename A , std::size_t... Ns> | |
auto | from_accumulator_impl (const A &acc, std::index_sequence< Ns... >) |
Convert from accumulator value. | |
template<typename ... E> | |
auto | from_accumulator (const std::tuple< E... > &acc) |
Convert from tuple of accumulator values. | |
template<typename A , typename V , std::size_t... Ns> | |
A | mac_impl (const A &acc, const V &a, const V &b, std::index_sequence< Ns... >) |
Multiply accumulate for tuple of scalar. | |
template<typename A , typename ... E> | |
A | mac (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b) |
Multiply accumulate. | |
template<typename A , typename V , typename B , std::size_t... Ns> | |
A | mac_impl (const A &acc, const V &a, const V &b, const B p0, std::index_sequence< Ns... >) |
Multiply accumulate for tuple of scalar. | |
template<typename A , typename B , typename ... E> | |
A | mac (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b, const B p0) |
Multiply accumulate. | |
+Functions | |
template<typename MA , typename MB , typename std::enable_if< HasMatrixIndexing< MA >::value &&HasMatrixIndexing< MB >::value, bool >::type = true> | |
void | transposeTo (MA &dst, const MB &src) |
Transpose a matrix. | |
template<typename M , typename V , typename std::enable_if< CompatibleStaticMatVecProduct< M, V >::value, bool >::type = true> | |
OutputVector< M, V >::type | dot (const M &m, const V &v) |
Matrix x Vector product. | |
template<typename MA , typename MB , typename std::enable_if< CompatibleStaticMatMatProduct< MA, MB >::value &&number_traits< typename traits< MA >::Scalar >::is_fixed, bool >::type = true> | |
OutputMatrix< MA, MB >::type | dot (const MA &ma, const MB &mb) |
Matrix x Matrix product. | |
template<typename MA , typename MB , typename RES , typename std::enable_if< CompatibleDynamicMatMatProduct< MA, MB >::value &&number_traits< typename traits< MA >::Scalar >::is_float, bool >::type = true> | |
void | dot (RES &&res, const MA &ma, const MB &mb) |
Matrix x Matrix product. | |
template<typename P > | |
Matrix< P, DYNAMIC, DYNAMIC, TMP_ALLOC > | mk_identity (const vector_length_t l) |
Create identity matrix. | |
template<typename P , int L> | |
Matrix< P, L, L, TMP_ALLOC > | mk_identity () |
Create identity matrix. | |
Algorithms written in an architecture independent way
+
+
|
+ +inline | +
+
|
+ +inline | +
+
|
+ +inline | +
MA | Any matrix type |
MB | Any matrix type |
RES | Any matrix type |
res | Output matrix. Result of ma x mb is written to this argument |
ma | Matrix. |
mb | Matrix. |
Used in dynamic mode (dimension of matrix not know at build time) to avoid a memory allocation if the result matrix is already available (Enable to reuse the same matrix storage for the result in some algorithms)
+ +Matrix< P, L, L, TMP_ALLOC > mk_identity | +( | +) | ++ |
Create identity matrix.
+P | Datatype of matrix elements |
L | Matrix dimension (L x L) |
Matrix< P, DYNAMIC, DYNAMIC, TMP_ALLOC > mk_identity | +( | +const vector_length_t | +l | ) | ++ |
Create identity matrix.
+P | Datatype of matrix elements |
l | Dimension of matrix (l x l) |
+
|
+ +inline | +
Transpose a matrix.
+MA | Any matrix type |
MB | Any matrix type |
dst | Destination matrix. |
src | Source matrix. |
+Data Structures | |
class | Scalar |
class | DSP |
class | Helium |
class | Helium82 |
class | Neon |
class arm_cmsis_dsp::Scalar | +
Scalar architecture
+class arm_cmsis_dsp::DSP | +
Architecture supporting DSP extensions
+class arm_cmsis_dsp::Helium | +
v8.1M Architecture
+class arm_cmsis_dsp::Helium82 | +
v8.2M Architecture
+class arm_cmsis_dsp::Neon | +
Architecture supporting Neon
++Content | |
DSP Extension specific algorithm | |
Helium specific algorithm | |
Scalar algorithm | |
+Typedefs | |
+typedef int32_t | index_t |
index datatype. It must be a signed datatype | |
+typedef int32_t | vector_length_t |
Vector length datatype. Iy must be a signed datatype. | |
+Functions | |
template<typename T > | |
void | PrintType (void) |
Prints a textual representation of a type. | |
void PrintType | +( | +void | +) | ++ |
Prints a textual representation of a type.
+T | The datatype to display |
+Content | |
Architecture independent algorithms | |
Architecture detection | |
Common types and constants | |
Tools for debugging | |
Fixed point datatypes | |
Abstract syntax tree for fusion | |
Matrixes | |
Memory allocator | |
Number datatypes | |
Architecture specific algorithm | |
Unrolling | |
Vectors | |
C++ template extension to CMSIS-DSP. It is not yet part of the pack but the headers can be found on the CMSIS-DSP github The principles are described in this page
++Namespaces | |
namespace | inner |
+Data Structures | |
struct | Q15DSPVector |
Representation of a vector when DSP extension supported. More... | |
struct | vector_traits< Q15, DSP, typename std::enable_if< true >::type > |
Vector description for Q15 with DSP extensions. More... | |
struct Q15DSPVector | +
Representation of a vector when DSP extension supported.
+Public Member Functions | |
+ | Q15DSPVector () |
Create new 0 initialized vector. | |
Q15DSPVector (int32_t val) | |
Create vector initialized from value. | |
+ | operator int32_t () |
Return value in vector. | |
+
|
+ +inlineexplicit | +
Create vector initialized from value.
+[in] | val | The value |
struct vector_traits< Q15, DSP, typename std::enable_if< true >::type > | +
Vector description for Q15 with DSP extensions.
+Public Types | |
+typedef Q15 | type |
Scalar datatype. | |
+typedef type::value_type | storage_type |
Storage datatype. | |
+typedef Q15DSPVector | vector |
Vector datatype. | |
+typedef Q< 33, 30 > | temp_accumulator |
Accumulator datatype. | |
typedef uint32_t | predicate_t |
Static Public Member Functions | |
static Q< 33, 30 > | temp_acc_zero () |
Zero accumulator. | |
static constexpr int16_t | zero_lane () |
Value to write in a lane to write 0. | |
static constexpr int16_t | lane_value (const Q15 x) |
Convert to lane value. | |
Static Public Attributes | |
+static constexpr bool | has_vector = true |
Has some vector instructions. | |
+static constexpr bool | is_float = false |
Is not float. | |
+static constexpr bool | is_fixed = true |
Is fixed point. | |
+static constexpr bool | has_predicate = false |
No predicated loops. | |
+static constexpr int | nb_lanes = 2 |
Number of lanes. | |
typedef uint32_t predicate_t | +
Dummy type since there is no predicated loop for DSP extensions
+ +
+
|
+ +inlinestaticconstexpr | +
Convert to lane value.
+[in] | x | Value |
+
|
+ +inlinestatic | +
Zero accumulator.
+
+
|
+ +inlinestaticconstexpr | +
Value to write in a lane to write 0.
++Data Structures | |
struct | fixed_storage_type< M, F, s, bool > |
Storage type for a fixed point number. More... | |
struct | fixed_storage_type< M, F, true, test64(M, F, 1)> |
Storage type for a fixed point number representable on int64. More... | |
struct | fixed_storage_type< M, F, false, test64(M, F, 0)> |
Storage type for a fixed point number representable on uint64. More... | |
struct | fixed_storage_type< M, F, true, test32(M, F, 1)> |
Storage type for a fixed point number representable on int32. More... | |
struct | fixed_storage_type< M, F, false, test32(M, F, 0)> |
Storage type for a fixed point number representable on uint32. More... | |
struct | fixed_storage_type< M, F, true, test16(M, F, 1)> |
Storage type for a fixed point number representable on int16. More... | |
struct | fixed_storage_type< M, F, false, test16(M, F, 0)> |
Storage type for a fixed point number representable on uint16. More... | |
struct | fixed_storage_type< M, F, true, test8(M, F, 1)> |
Storage type for a fixed point number representable on int8. More... | |
struct | fixed_storage_type< M, F, false, test8(M, F, 0)> |
Storage type for a fixed point number representable on uint8. More... | |
struct | Q< M, F, S, T > |
Fixed point template. More... | |
struct | Q< M, F, true, int64_t > |
Signed fixed point datatypes on 64 bits. More... | |
struct | Q< M, F, false, uint64_t > |
Unsigned fixed point datatypes on 64 bits. More... | |
struct | Q< M, F, true, int32_t > |
Signed fixed point datatypes on 32 bits. More... | |
struct | Q< M, F, false, uint32_t > |
Unsigned fixed point datatypes on 32 bits. More... | |
struct | Q< M, F, true, int16_t > |
Signed fixed point datatypes on 16 bits. More... | |
struct | Q< M, F, false, uint16_t > |
Unsigned fixed point datatypes on 16 bits. More... | |
struct | Q< M, F, true, int8_t > |
Signed fixed point datatypes on 8 bits. More... | |
struct | Q< M, F, false, uint8_t > |
Unsigned fixed point datatypes on 8 bits. More... | |
struct | FixedCastShift< M, FD, FS, S,(FD >FS)> |
Changed fractional representation of a fixed point number using a shift. More... | |
struct | FixedCastShift< M, FD, FS, S,(FD< FS)> |
Changed fractional representation of a fixed point number using a shift. More... | |
struct | Accumulate< MD, MS, F, S, bool > |
Accumulation without saturation. More... | |
struct | Accumulate< MD, MS, F, S, true > |
Accumulation without saturation. More... | |
+Typedefs | |
+using | Q63 = Q< 0, 63 > |
Q63 datatype. | |
+using | Q31 = Q< 0, 31 > |
Q31 datatype. | |
+using | Q15 = Q< 0, 15 > |
Q15 datatype. | |
+using | Q7 = Q< 0, 7 > |
Q7 datatype. | |
+Functions | |
constexpr bool | test64 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 64 bits. | |
constexpr bool | test32 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 32 bits. | |
constexpr bool | test16 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 16 bits. | |
constexpr bool | test8 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 8 bits. | |
constexpr Q63 | operator""_q63 (long double x) |
q63 literal | |
constexpr Q31 | operator""_q31 (long double x) |
q31 literal | |
constexpr Q15 | operator""_q15 (long double x) |
q15 literal | |
constexpr Q7 | operator""_q7 (long double x) |
q7 literal | |
template<int MA, int FA, int MB, int FB, bool SA, bool SB> | |
Q< MA+MB+1, FA+FB, SA||SB > | mult (const Q< MA, FA, SA > &a, const Q< MB, FB, SB > &b) |
Multiplication of two fixed point numbers A and B. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator+ (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Add two fixed point numbers with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator- (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Subtract two fixed point numbers with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator- (const Q< M, F, S > &a) |
Negate a fixed point number with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | add (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Add two fixed point numbers without saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | sub (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Subtract two fixed point numbers without saturation. | |
template<int M, int F, int N, bool S> | |
Q< M, F, S > | operator>> (const Q< M, F, S > &a, std::integral_constant< int, N >) noexcept |
Shift right a fixed point number with a shift known at build time. | |
template<int M, int F, int N, bool S> | |
Q< M+N, F, S > | operator<< (const Q< M, F, S > &a, std::integral_constant< int, N >) noexcept |
Shift left a fixed point number with a shift known at build time. | |
template<int MD = 0, int MS, int F> | |
Q< MD, F, true > | saturate (const Q< MS, F, true > &src, typename std::enable_if<(MD< MS) &&((MD+F)< 31)>::type *=nullptr) |
Saturate a signed fixed point number. | |
template<int MD = 0, int MS, int F> | |
Q< MD, F, false > | saturate (const Q< MS, F, false > &src, typename std::enable_if<(MD< MS) &&((MD+F)< 31)>::type *=nullptr) |
Saturate an unsigned fixed point number. | |
template<int FD, int M, int FS, bool S> | |
Q< M, FD, S > | toFrac (const Q< M, FS, S > &src) |
Convert between different fractional part formats. | |
template<int MD, int MS, int F, bool S> | |
Q< MD, F, S > | accumulate (const Q< MD, F, S > &a, const Q< MS, F, S > &b) |
Accumulate without saturation. | |
Q7 | operator* (const Q7 &a, const Q7 &b) |
Multiplication operator. | |
Q15 | operator* (const Q15 &a, const Q15 &b) |
Multiplication operator. | |
Q31 | operator* (const Q31 &a, const Q31 &b) |
Multiplication operator. | |
template<int M, int F> | |
bool | operator> (const Q< M, F > &a, const Q< M, F > &b) |
Greater-than comparison operator. | |
template<int M, int F> | |
bool | operator< (const Q< M, F > &a, const Q< M, F > &b) |
Less-than comparison operator. | |
template<int M, int F> | |
bool | operator>= (const Q< M, F > &a, const Q< M, F > &b) |
Greater-than-or-equal comparison operator. | |
template<int M, int F> | |
bool | operator<= (const Q< M, F > &a, const Q< M, F > &b) |
Less-than-or-equal comparison operator. | |
template<int M, int F> | |
bool | operator== (const Q< M, F > a, const Q< M, F > b) |
Equality operator. | |
template<int M, int F> | |
bool | operator!= (const Q< M, F > a, const Q< M, F > b) |
Inequality operator. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator/ (const Q< M, F, S > a, const int32_t b) |
Division operator. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator+ (const Q< M, F, S > &a) |
No op operator. | |
struct arm_cmsis_dsp::fixed_storage_type | +
Storage type for a fixed point number.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
s | signed or unsigned |
struct arm_cmsis_dsp::fixed_storage_type< M, F, true, test64(M, F, 1)> | +
Storage type for a fixed point number representable on int64.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, false, test64(M, F, 0)> | +
Storage type for a fixed point number representable on uint64.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, true, test32(M, F, 1)> | +
Storage type for a fixed point number representable on int32.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, false, test32(M, F, 0)> | +
Storage type for a fixed point number representable on uint32.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, true, test16(M, F, 1)> | +
Storage type for a fixed point number representable on int16.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, false, test16(M, F, 0)> | +
Storage type for a fixed point number representable on uint16.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, true, test8(M, F, 1)> | +
Storage type for a fixed point number representable on int8.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::fixed_storage_type< M, F, false, test8(M, F, 0)> | +
Storage type for a fixed point number representable on uint8.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
struct arm_cmsis_dsp::Q | +
Fixed point template.
+M | Number of bits for mantissa (without sign bit)# |
F | Number of bits for fractional part |
S | Signed or unsigned |
T | storage datatype |
struct arm_cmsis_dsp::Q< M, F, true, int64_t > | +
Signed fixed point datatypes on 64 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, true >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, true >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
constexpr | Q (const Q< M, F, false > &other) |
Convert an unsigned fixed point to this fixed point. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Q & | operator+= (const Q other) |
this += other | |
Q & | operator-= (const Q other) |
this -= other | |
Static Public Member Functions | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = true |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0x7FFFFFFFFFFFFFFFLL |
Maximum representable positive value. | |
+static constexpr value_type | minVal = 0x8000000000000000LL |
Minimum representable negative value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlineexplicitconstexpr | +
Convert an unsigned fixed point to this fixed point.
+other | The unsigned fixed point number |
Some problem may occur since the unsigned may not be representable with the less bits required for the sign representation. This convertion is not saturating.
+ +
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
this += other
+other | the other fixed point |
this -= other
+other | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
struct arm_cmsis_dsp::Q< M, F, false, uint64_t > | +
Unsigned fixed point datatypes on 64 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, false >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, false >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Static Public Member Functions | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = false |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0xFFFFFFFFFFFFFFFFLL |
Maximum representable positive value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
struct arm_cmsis_dsp::Q< M, F, true, int32_t > | +
Signed fixed point datatypes on 32 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, true >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, true >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
constexpr | Q (const Q< M, F, false > &other) |
Convert an unsigned fixed point to this fixed point. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Q & | operator+= (const Q other) |
this += other | |
Q & | operator-= (const Q other) |
this -= other | |
Static Public Member Functions | |
static constexpr value_type | sat (const wider_type i) |
Saturate a wider type to the current type. | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point with saturation. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = true |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0x7FFFFFFFL |
Maximum representable positive value. | |
+static constexpr value_type | minVal = 0x80000000L |
Minimum representable negative value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlineexplicitconstexpr | +
Convert an unsigned fixed point to this fixed point.
+other | The unsigned fixed point number |
Some problem may occur since the unsigned may not be representable with the less bits required for the sign representation. This convertion is not saturating.
+ +
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point with saturation.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
this += other
+other | the other fixed point |
this -= other
+other | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
+
|
+ +inlinestaticconstexpr | +
Saturate a wider type to the current type.
+i | the wider integer type |
struct arm_cmsis_dsp::Q< M, F, false, uint32_t > | +
Unsigned fixed point datatypes on 32 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, false >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, false >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Static Public Member Functions | |
static constexpr value_type | sat (const wider_type i) |
Saturate a wider type to the current type. | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point with saturation. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = false |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0xFFFFFFFFL |
Maximum representable positive value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point with saturation.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
+
|
+ +inlinestaticconstexpr | +
Saturate a wider type to the current type.
+i | the wider integer type |
struct arm_cmsis_dsp::Q< M, F, true, int16_t > | +
Signed fixed point datatypes on 16 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, true >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, true >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
constexpr | Q (const Q< M, F, false > &other) |
Convert an unsigned fixed point to this fixed point. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Q & | operator+= (const Q other) |
this += other | |
Q & | operator-= (const Q other) |
this -= other | |
Static Public Member Functions | |
static constexpr value_type | sat (const wider_type i) |
Saturate a wider type to the current type. | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point with saturation. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = true |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0x7FFF |
Maximum representable positive value. | |
+static constexpr value_type | minVal = 0x8000 |
Minimum representable negative value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlineexplicitconstexpr | +
Convert an unsigned fixed point to this fixed point.
+other | The unsigned fixed point number |
Some problem may occur since the unsigned may not be representable with the less bits required for the sign representation. This convertion is not saturating.
+ +
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point with saturation.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
this += other
+other | the other fixed point |
this -= other
+other | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
+
|
+ +inlinestaticconstexpr | +
Saturate a wider type to the current type.
+i | the wider integer type |
struct arm_cmsis_dsp::Q< M, F, false, uint16_t > | +
Unsigned fixed point datatypes on 16 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, false >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, false >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Q & | operator+= (const Q other) |
this += other | |
Static Public Member Functions | |
static constexpr value_type | sat (const wider_type i) |
Saturate a wider type to the current type. | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point with saturation. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = false |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0xFFFF |
Maximum representable positive value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point with saturation.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
this += other
+other | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
+
|
+ +inlinestaticconstexpr | +
Saturate a wider type to the current type.
+i | the wider integer type |
struct arm_cmsis_dsp::Q< M, F, true, int8_t > | +
Signed fixed point datatypes on 8 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, true >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, true >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
constexpr | Q (const Q< M, F, false > &other) |
Convert an unsigned fixed point to this fixed point. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Q & | operator+= (const Q other) |
this += other | |
Q & | operator-= (const Q other) |
this -= other | |
Static Public Member Functions | |
static constexpr value_type | sat (const wider_type i) |
Saturate a wider type to the current type. | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point with saturation. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = true |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0x7F |
Maximum representable positive value. | |
+static constexpr value_type | minVal = 0x80 |
Minimum representable negative value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlineexplicitconstexpr | +
Convert an unsigned fixed point to this fixed point.
+other | The unsigned fixed point number |
Some problem may occur since the unsigned may not be representable with the less bits required for the sign representation. This convertion is not saturating.
+ +
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point with saturation.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
this += other
+other | the other fixed point |
this -= other
+other | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
+
|
+ +inlinestaticconstexpr | +
Saturate a wider type to the current type.
+i | the wider integer type |
struct arm_cmsis_dsp::Q< M, F, false, uint8_t > | +
Unsigned fixed point datatypes on 8 bits.
+M | Number of bits for mantissa (without sign bit) |
F | Number of bits for fractional part |
Public Types | |
+using | value_type = typename fixed_storage_type< M, F, false >::value_type |
Storage type for the value. | |
+using | wider_type = typename fixed_storage_type< M, F, false >::wider_type |
Storage type for the widening of the value. | |
Public Member Functions | |
+constexpr | Q () |
Create a new zero fixed point. | |
constexpr | Q (const value_type x) |
Create a new fixed point from a raw integer. | |
bool | operator== (const Q &b) const |
this == b | |
bool | operator!= (const Q &b) const |
this != b | |
bool | operator< (const Q &b) const |
this < b | |
bool | operator> (const Q &b) const |
this > b | |
bool | operator<= (const Q &b) const |
this <= b | |
bool | operator>= (const Q &b) const |
this >= b | |
Q & | operator+= (const Q other) |
this += other | |
Static Public Member Functions | |
static constexpr value_type | sat (const wider_type i) |
Saturate a wider type to the current type. | |
static constexpr value_type | convert (const float f) |
Convert a float to fixed point with saturation. | |
static constexpr Q | f (const float x) |
Create a new fixed point from a float. | |
static constexpr Q | one () |
Fixed point number representing 1. | |
Data Fields | |
+value_type | v |
Storage value. | |
Static Public Attributes | |
+static constexpr int | fracBits = F |
Number of fractional bits. | |
+static constexpr int | mantissaBits = M |
Number of mantissa bits (without sign bit) | |
+static constexpr bool | isSigned = false |
Is this number representation signed. | |
+static constexpr value_type | maxVal = 0xFF |
Maximum representable positive value. | |
+
|
+ +inlineexplicitconstexpr | +
Create a new fixed point from a raw integer.
+x | the raw integer |
+
|
+ +inlinestaticconstexpr | +
Convert a float to fixed point with saturation.
+f | float value |
+
|
+ +inlinestaticconstexpr | +
Create a new fixed point from a float.
+x | the float |
+
|
+ +inlinestaticconstexpr | +
Fixed point number representing 1.
+
+
|
+ +inline | +
this != b
+b | the other fixed point |
this += other
+other | the other fixed point |
+
|
+ +inline | +
this < b
+b | the other fixed point |
+
|
+ +inline | +
this <= b
+b | the other fixed point |
+
|
+ +inline | +
this == b
+b | the other fixed point |
+
|
+ +inline | +
this > b
+b | the other fixed point |
+
|
+ +inline | +
this >= b
+b | the other fixed point |
+
|
+ +inlinestaticconstexpr | +
Saturate a wider type to the current type.
+i | the wider integer type |
struct arm_cmsis_dsp::FixedCastShift< M, FD, FS, S,(FD >FS)> | +
Changed fractional representation of a fixed point number using a shift.
+M | Number of mantissa bits for the fixed point number |
FD | Number of fractional bits for the destination fixed point number |
FS | Number of fractional bits for the source fixed point number |
S | Is the fixed point number using a signed representation |
src | The fixed point number |
Only applies if FD > FS
+struct arm_cmsis_dsp::FixedCastShift< M, FD, FS, S,(FD< FS)> | +
Changed fractional representation of a fixed point number using a shift.
+M | Number of mantissa bits for the fixed point number |
FD | Number of fractional bits for the destination fixed point number |
FS | Number of fractional bits for the source fixed point number |
S | Is the fixed point number using a signed representation |
src | The fixed point number |
Only applies if FD < FS
+struct arm_cmsis_dsp::Accumulate | +
Accumulation without saturation.
+MD | Number of mantissa bits for the destination fixed point number |
MS | Number of mantissa bits for the source fixed point number |
F | Number of fractional bits for fixed point number |
S | Is the fixed point number using a signed representation |
struct arm_cmsis_dsp::Accumulate< MD, MS, F, S, true > | +
Accumulation without saturation.
+MD | Number of mantissa bits for the destination fixed point number |
MS | Number of mantissa bits for the source fixed point number |
F | Number of fractional bits for fixed point number |
S | Is the fixed point number using a signed representation |
Static Public Member Functions | |
static Q< MD, F, S > | acc (const Q< MD, F, S > &a, const Q< MS, F, S > &b) |
Accumulation without saturation. | |
+
|
+ +inlinestatic | +
Accumulation without saturation.
+[in] | a | first fixed point number |
[in] | b | second fixed point number |
+
|
+ +inline | +
Accumulate without saturation.
+[in] | a | First fixed point number |
[in] | b | Second fixed point number |
MD | Number of mantissa bits for destination |
MS | Number of mantissa bits fro source |
F | Number of fractional bits |
S | Is the representation signed |
+
|
+ +inline | +
Add two fixed point numbers without saturation.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
b | Second fixed point number |
+
|
+ +inline | +
Multiplication of two fixed point numbers A and B.
+MA | Number of mantissa bits for A |
FA | Number of fractional bits for A |
MB | Number of mantissa bits for B |
FB | Number of fractional bits for B |
SA | Is A using a signed representation |
SB | Is B using a signed representation |
a | First fixed point number |
b | Second fixed point number |
+
|
+ +inline | +
Inequality operator.
+[in] | a | First value |
[in] | b | Second value |
M | Number of mantissa bits |
F | Number of fractional bits |
+
|
+ +constexpr | +
q15 literal
+x | long double value |
You can write
The float is converted to Q15 at build time.
+ +
+
|
+ +constexpr | +
q31 literal
+x | long double value |
You can write
The float is converted to Q31 at build time.
+ +
+
|
+ +constexpr | +
q63 literal
+x | long double value |
You can write
The float is converted to Q63 at build time.
+ +
+
|
+ +constexpr | +
q7 literal
+x | long double value |
You can write
The float is converted to Q7 at build time.
+ +
+
|
+ +inline | +
Multiplication operator.
+[in] | a | First value |
[in] | b | Second value |
+
|
+ +inline | +
Multiplication operator.
+[in] | a | First value |
[in] | b | Second value |
+
|
+ +inline | +
Multiplication operator.
+[in] | a | First value |
[in] | b | Second value |
No op operator.
+[in] | a | Fixed point number |
M | Number of mantissa bits |
F | Number of fractional bits |
S | Is the representation signed |
+
|
+ +inline | +
Add two fixed point numbers with saturation.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
b | Second fixed point number |
Negate a fixed point number with saturation.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
+
|
+ +inline | +
Subtract two fixed point numbers with saturation.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
b | Second fixed point number |
+
|
+ +inline | +
Division operator.
+[in] | a | First fixed point value |
[in] | b | Integer |
M | Number of mantissa bits |
F | Number of fractional bits |
S | Is representation signed |
+
|
+ +inline | +
Less-than comparison operator.
+[in] | a | First value |
[in] | b | Second value |
M | Number of mantissa bits |
F | Number of fractional bits |
+
|
+ +inlinenoexcept | +
Shift left a fixed point number with a shift known at build time.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
+
|
+ +inline | +
Less-than-or-equal comparison operator.
+[in] | a | First value |
[in] | b | Second value |
M | Number of mantissa bits |
F | Number of fractional bits |
+
|
+ +inline | +
Equality operator.
+[in] | a | First value |
[in] | b | Second value |
M | Number of mantissa bits |
F | Number of fractional bits |
+
|
+ +inline | +
Greater-than comparison operator.
+[in] | a | First value |
[in] | b | Second value |
M | Number of mantissa bits |
F | Number of fractional bits |
+
|
+ +inline | +
Greater-than-or-equal comparison operator.
+[in] | a | First value |
[in] | b | Second value |
M | Number of mantissa bits |
F | Number of fractional bits |
+
|
+ +inlinenoexcept | +
Shift right a fixed point number with a shift known at build time.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
+
|
+ +inline | +
Saturate an unsigned fixed point number.
+MD | Number of mantissa bits for the destination fixed point number |
MS | Number of mantissa bits for the source fixed point number |
S | Is the fixed point number using a signed representation |
src | The fixed point number |
Only applies if the number is unsigned, the representation requires less than 31 bits (since there is no saturating instruction for 64 bits) and if destination has less mantissa bits.
+If destination has more or equal number of mantissa bits then it does not make sense to saturate.
+ +
+
|
+ +inline | +
Saturate a signed fixed point number.
+MD | Number of mantissa bits for the destination fixed point number |
MS | Number of mantissa bits for the source fixed point number |
S | Is the fixed point number using a signed representation |
src | First fixed point number |
Only applies if the number is signed, the representation requires less than 32 bits (since there is no saturating instruction for 64 bits) and if destination has less mantissa bits.
+If destination has more or equal number of mantissa bits then it does not make sense to saturate.
+ +
+
|
+ +inline | +
Subtract two fixed point numbers without saturation.
+M | Number of mantissa bits for the fixed point number |
F | Number of fractional bits for the fixed point number |
S | Is the fixed point number using a signed representation |
a | First fixed point number |
b | Second fixed point number |
+
|
+ +constexpr | +
Function to identify the template for fixed number representable on 16 bits.
+M | number of mantissa bit (without sign bit) |
F | number of fractional bits |
S | sign or unsigned |
+
|
+ +constexpr | +
Function to identify the template for fixed number representable on 32 bits.
+M | number of mantissa bit (without sign bit) |
F | number of fractional bits |
S | sign or unsigned |
+
|
+ +constexpr | +
Function to identify the template for fixed number representable on 64 bits.
+M | number of mantissa bit (without sign bit) |
F | number of fractional bits |
S | sign or unsigned |
+
|
+ +constexpr | +
Function to identify the template for fixed number representable on 8 bits.
+M | number of mantissa bit (without sign bit) |
F | number of fractional bits |
S | sign or unsigned |
Convert between different fractional part formats.
+M | Number of mantissa bits for the fixed point number |
FD | Number of fractional bits for the destination fixed point number |
FS | Number of fractional bits for the source fixed point number |
S | Is the fixed point number using a signed representation |
src | The fixed point number |
+Data Structures | |
struct | _Expr< T > |
Expression template. More... | |
struct | _Binary< LHS, RHS, DerivedOp > |
Expression for binary operator. More... | |
struct | _Unary< LHS, DerivedOp > |
Expression for unary operator. More... | |
struct | _UnaryOperator< Scalar, Derived > |
Unary operator. More... | |
struct | _BinaryOperator< Scalar, Derived > |
Unary operator. More... | |
struct | _AddOp< Scalar > |
Add operator. More... | |
struct | _SubOp< Scalar > |
Sub operator. More... | |
struct | _MulOp< Scalar > |
Mul operator. More... | |
struct | _NegOp< Scalar > |
Neg operator. More... | |
struct | _NoOp< Scalar > |
No operator. More... | |
+Functions | |
template<typename DA > | |
constexpr bool | has_vector_inst () |
Determines if vector datatype supports vector instruction on a current architecture. | |
template<typename DA > | |
constexpr bool | has_predicate_inst () |
Determines if datatype has predicated loop for current architecture. | |
template<typename DA > | |
constexpr bool | is_scalar () |
Determines if scalar datatype (not vector, vectorview, matrix, matrixview) | |
template<typename DA > | |
constexpr bool | must_use_matrix_idx () |
Check if datatype can only be used as a matrix (no vector addressing) | |
template<typename DA , typename DB > | |
constexpr bool | vector_idx_pair () |
Check if both datatype have vector indexing are same scalar datatype. | |
template<typename DA > | |
constexpr bool | is_only_vector () |
Check if has vector indexing. | |
template<typename DA , typename DB > | |
constexpr bool | must_use_matrix_idx_pair () |
Check if datatypes have same scalar datatype and no vector indexing. | |
template<typename DA , typename DB > | |
constexpr vector_length_t | static_length () |
Static length. | |
template<typename DA , typename DB > | |
constexpr bool | same_static_length () |
Check compatibility of length. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >() &&is_only_vector< VA >() &&is_only_vector< VB >() &&(!IsDynamic< VA >::value||!IsDynamic< VB >::value), bool >::type = true> | |
DotResult< VA > | dot (const VA &a, const VB &b) |
Dot product. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >() &&(!IsDynamic< VA >::value||!IsDynamic< VB >::value), bool >::type = true> | |
void | swap (VA &&a, VB &&b) |
Swap vectors. | |
struct arm_cmsis_dsp::_Expr | +
Expression template.
+T | Datatype representing the expression |
Public Member Functions | |
T & | derived () |
Derived datatype. | |
T const & | derived () const |
Derived datatype. | |
Scalar const | operator[] (const index_t i) const |
Vector indexing in the expression. | |
Scalar const | operator() (const index_t r, const index_t c) const |
Matrix indexing. | |
Vector const | vector_op (const index_t i) const |
Vector operation at given index. | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index with loop predicate. | |
Vector const | matrix_op (const index_t r, const index_t c) const |
Matrix operation at index. | |
Vector const | matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const |
Matrix operation at index with tail predication. | |
vector_length_t | length () const |
Length of result. | |
vector_length_t | rows () const |
Number of rows for result. | |
vector_length_t | columns () const |
Number of columns for result. | |
+
|
+ +inline | +
Number of columns for result.
+
+
|
+ +inline | +
Derived datatype.
+
+
|
+ +inline | +
Derived datatype.
+
+
|
+ +inline | +
Length of result.
+
+
|
+ +inline | +
Matrix operation at index.
+[in] | r | row index |
[in] | c | column index |
+
|
+ +inline | +
Matrix operation at index with tail predication.
+[in] | r | row index |
[in] | c | column index |
[in] | remaining | Remaining elements in the loop |
+
|
+ +inline | +
Matrix indexing.
+[in] | r | Row index |
[in] | c | Column index |
+
|
+ +inline | +
Vector indexing in the expression.
+[in] | i | Index |
+
|
+ +inline | +
Number of rows for result.
+
+
|
+ +inline | +
+
|
+ +inline | +
struct arm_cmsis_dsp::_Binary | +
Expression for binary operator.
+LHS | Left hand side datatype |
RHS | Right hand side datatype |
DerivedOp | Operator for the binary operation |
+Additional Inherited Members | |
![]() | |
_Binary< LHS, RHS, DerivedOp > & | derived () |
Derived datatype. | |
_Binary< LHS, RHS, DerivedOp > const & | derived () const |
Derived datatype. | |
Scalar const | operator[] (const index_t i) const |
Vector indexing in the expression. | |
Scalar const | operator() (const index_t r, const index_t c) const |
Matrix indexing. | |
Vector const | vector_op (const index_t i) const |
Vector operation at given index. | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index with loop predicate. | |
Vector const | matrix_op (const index_t r, const index_t c) const |
Matrix operation at index. | |
Vector const | matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const |
Matrix operation at index with tail predication. | |
vector_length_t | length () const |
Length of result. | |
vector_length_t | rows () const |
Number of rows for result. | |
vector_length_t | columns () const |
Number of columns for result. | |
struct arm_cmsis_dsp::_Unary | +
Expression for unary operator.
+LHS | Left hand side datatype |
DerivedOp | Operator for the binary operation |
+Additional Inherited Members | |
![]() | |
_Unary< LHS, DerivedOp > & | derived () |
Derived datatype. | |
_Unary< LHS, DerivedOp > const & | derived () const |
Derived datatype. | |
Scalar const | operator[] (const index_t i) const |
Vector indexing in the expression. | |
Scalar const | operator() (const index_t r, const index_t c) const |
Matrix indexing. | |
Vector const | vector_op (const index_t i) const |
Vector operation at given index. | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index with loop predicate. | |
Vector const | matrix_op (const index_t r, const index_t c) const |
Matrix operation at index. | |
Vector const | matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const |
Matrix operation at index with tail predication. | |
vector_length_t | length () const |
Length of result. | |
vector_length_t | rows () const |
Number of rows for result. | |
vector_length_t | columns () const |
Number of columns for result. | |
struct _UnaryOperator | +
Unary operator.
+Scalar | Datatype for scalar |
Derived | Datatype representing the operator expression |
struct _BinaryOperator | +
Unary operator.
+Scalar | Datatype for scalar |
Derived | Datatype representing the operator expression |
struct _AddOp | +
Add operator.
+Scalar | Datatype for scalar |
struct _SubOp | +
Sub operator.
+Scalar | Datatype for scalar |
struct _MulOp | +
Mul operator.
+Scalar | Datatype for scalar |
struct _NegOp | +
Neg operator.
+Scalar | Datatype for scalar |
struct _NoOp | +
No operator.
+Scalar | Datatype for scalar |
+
|
+ +inline | +
Dot product.
+VA | Left hand side vector datatype |
VB | Right hand side vector datatype |
a | left hand side vector |
b | right hand side vector |
The vector can be vector, vector views or expressions.
+ +
+
|
+ +constexpr | +
Determines if datatype has predicated loop for current architecture.
+DA | Datatype |
+
|
+ +constexpr | +
Determines if vector datatype supports vector instruction on a current architecture.
+DA | Datatype |
+
|
+ +constexpr | +
Check if has vector indexing.
+DA | Datatype |
+
|
+ +constexpr | +
Determines if scalar datatype (not vector, vectorview, matrix, matrixview)
+DA | { description } |
+
|
+ +constexpr | +
Check if datatype can only be used as a matrix (no vector addressing)
+DA | Datatype |
+
|
+ +constexpr | +
Check if datatypes have same scalar datatype and no vector indexing.
+DA | First datatype |
DB | Second datatype |
+
|
+ +constexpr | +
Check compatibility of length.
+DA | First datatype |
DB | Second datatype |
+
|
+ +constexpr | +
Static length.
+DA | First datatype |
DB | Second datatype |
+
|
+ +inline | +
Swap vectors.
+VA | Left hand side vector datatype |
VB | Right hand side vector datatype |
a | left hand side vector |
b | right hand side vector |
The vector can be vector, vector views or expressions.
+The content of vector is swapped.
+ +
+
|
+ +constexpr | +
Check if both datatype have vector indexing are same scalar datatype.
+DA | First datatype |
DB | Second datatype |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< double > |
Features for double. More... | |
struct | vector_traits< double, arch, void > |
Default vector datatype description for this scalar datatype. More... | |
struct number_traits< double > | +
Features for double.
+Public Types | |
+typedef double | accumulator |
Accumulator datatype for this scalar datatype. | |
+typedef double | compute_type |
Compute datatype for this scalar datatype. | |
Static Public Member Functions | |
static constexpr double | one () |
One for this datatype. | |
Static Public Attributes | |
+static constexpr bool | is_float = true |
It is a float number. | |
+static constexpr bool | is_fixed = false |
It is not a fixed point. | |
+
|
+ +inlinestaticconstexpr | +
One for this datatype.
+struct vector_traits< double, arch, void > | +
Default vector datatype description for this scalar datatype.
+arch | Current architecture |
Public Types | |
typedef double | type |
typedef double | storage_type |
typedef bool | vector |
typedef bool | temp_accumulator |
typedef uint32_t | predicate_t |
Static Public Attributes | |
static constexpr bool | has_vector = false |
+static constexpr bool | is_float = true |
It is a float. | |
+static constexpr bool | is_fixed = false |
Not a fixed point. | |
+static constexpr bool | has_predicate = false |
No predicated loops. | |
typedef uint32_t predicate_t | +
Dummy datatype. Must be present for building but not used since by default there is no vector architecture assumed
+ +typedef double storage_type | +
Storage datatype
+ +typedef bool temp_accumulator | +
Dummy datatype. Must be present for building but not used since by default there is no vector architecture assumed
+ +typedef double type | +
Scalar datatype
+ +typedef bool vector | +
Dummy datatype. Must be present for building but not used since by default there is no vector architecture assumed
+ +
+
|
+ +staticconstexpr | +
By default : no vector architecture assumed
+ ++Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< float > |
Features for float. More... | |
struct | vector_traits< float, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > |
Vector instructions for float when no Helium or Neon. More... | |
struct number_traits< float > | +
Features for float.
+Public Types | |
+typedef float | accumulator |
Accumulator datatype for this scalar datatype. | |
+typedef float | compute_type |
Compute datatype for this scalar datatype. | |
Static Public Member Functions | |
static constexpr float | one () |
One for this datatype. | |
Static Public Attributes | |
+static constexpr bool | is_float = true |
It is a float number. | |
+static constexpr bool | is_fixed = false |
It is not a fixed point. | |
+
|
+ +inlinestaticconstexpr | +
One for this datatype.
+struct vector_traits< float, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > | +
Vector instructions for float when no Helium or Neon.
+arch | Current architecture |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< float16_t > |
Feature of float16 datatype. More... | |
struct | vector_traits< float16_t > |
float16 vector descrition when no vector architecture More... | |
struct number_traits< float16_t > | +
Feature of float16 datatype.
+Public Types | |
+typedef float16_t | accumulator |
Accumulator datatype. | |
+typedef _Float16 | compute_type |
Compute datatype. | |
Static Public Member Functions | |
static constexpr float16_t | one () |
One value. | |
Static Public Attributes | |
+static constexpr bool | is_float = true |
It is a float number. | |
+static constexpr bool | is_fixed = false |
It is not a fixed point number. | |
+
|
+ +inlinestaticconstexpr | +
One value.
+struct vector_traits< float16_t > | +
float16 vector descrition when no vector architecture
++Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< Q15 > |
Q15 features. More... | |
struct | vector_traits< Q15, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > |
Vector features for Q15 when no vector architecture. More... | |
struct number_traits< Q15 > | +
Q15 features.
+Public Types | |
+typedef Q< 33, 30 > | accumulator |
Accumulator datatype. | |
+typedef Q15 | compute_type |
Compute type. | |
Static Public Member Functions | |
static constexpr Q15 | one () |
One value. | |
Static Public Attributes | |
+static constexpr bool | is_float = false |
Is not float. | |
+static constexpr bool | is_fixed = true |
Is fixed point. | |
+
|
+ +inlinestaticconstexpr | +
One value.
+struct vector_traits< Q15, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > | +
Vector features for Q15 when no vector architecture.
+arch | Current architecture |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< Q31 > |
Features for Q31. More... | |
struct | vector_traits< Q31, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > |
Vector features for Q31 when no vector instructions. More... | |
struct number_traits< Q31 > | +
Features for Q31.
+Public Types | |
+typedef Q< 15, 48 > | accumulator |
Accumulator datatype. | |
+typedef Q31 | compute_type |
Compute type. | |
Static Public Member Functions | |
static constexpr Q31 | one () |
One value. | |
Static Public Attributes | |
+static constexpr bool | is_float = false |
Is not a float. | |
+static constexpr bool | is_fixed = true |
Is fixed point. | |
+
|
+ +inlinestaticconstexpr | +
One value.
+struct vector_traits< Q31, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > | +
Vector features for Q31 when no vector instructions.
+arch | Current architecture |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< Q7 > |
Q7 features. More... | |
struct | vector_traits< Q7, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > |
Vector descrition when no vector architecture. More... | |
struct number_traits< Q7 > | +
Q7 features.
+Public Types | |
+typedef Q< 17, 14 > | accumulator |
Accumulator datatype. | |
+typedef Q7 | compute_type |
Compute type. | |
Static Public Member Functions | |
static constexpr Q7 | one () |
One value. | |
Static Public Attributes | |
+static constexpr bool | is_float = false |
Is not float. | |
+static constexpr bool | is_fixed = true |
Is fixed point. | |
+
|
+ +inlinestaticconstexpr | +
One value.
+struct vector_traits< Q7, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > | +
Vector descrition when no vector architecture.
+arch | Current architecture |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | number_traits< std::tuple< E... > > |
Number description for a tuple of numbers. More... | |
struct | vector_traits< std::tuple< E... >, arch > |
Tuple of compatible vectors. More... | |
Tuples of numbers or expressions used for unrolling
+struct number_traits< std::tuple< E... > > | +
Number description for a tuple of numbers.
+E | Datatype for all numbers |
Public Types | |
+typedef std::tuple< typename number_traits< E >::accumulator... > | accumulator |
Tuple of accumulator datatype for the accumulator type. | |
+typedef std::tuple< typename number_traits< E >::compute_type... > | compute_type |
Tuple of compute datatype for the compute type. | |
Static Public Member Functions | |
static std::tuple< typename number_traits< E >::accumulator... > | one () |
Return of tuples of one values. | |
Static Public Attributes | |
+static constexpr bool | is_float = false |
It is not a float number. | |
+static constexpr bool | is_fixed = false |
It is not a fixed point number. | |
+
|
+ +inlinestatic | +
Return of tuples of one values.
+struct vector_traits< std::tuple< E... >, arch > | +
Tuple of compatible vectors.
+arch | Current architecture |
E | List of vector dataypes |
The vector datatypes must be coherent : have same number of lanes or same lane datatype
+Public Types | |
+using | RefScalar = typename std::tuple_element< 0, std::tuple< E... > >::type |
First element of tuple defines the scalar datatype. | |
+typedef std::tuple< typename vector_traits< E, arch >::temp_accumulator... > | temp_accumulator |
Temporary accumulator datatype. | |
+typedef std::tuple< typename vector_traits< E, arch >::vector... > | vector |
Vector datatype. | |
+typedef std::tuple< typename vector_traits< E, arch >::predicate_t... > | predicate_t |
Predicate datatype. | |
Static Public Member Functions | |
static temp_accumulator | temp_acc_zero () |
Zero represented with temp accumulator datatype. | |
Static Public Attributes | |
+static constexpr int | nb_lanes = vector_traits<RefScalar,arch>::nb_lanes |
Number of lanes (from RefScalar) | |
+static constexpr bool | has_vector = vector_traits<RefScalar,arch>::has_vector |
Has vector instructions. | |
+static constexpr bool | is_float = vector_traits<RefScalar,arch>::is_float |
Is a float. | |
+static constexpr bool | is_fixed = vector_traits<RefScalar,arch>::is_fixed |
Is fixed point. | |
+static constexpr bool | has_predicate = vector_traits<RefScalar,arch>::has_predicate |
Has predicated loop. | |
+
|
+ +inlinestatic | +
Zero represented with temp accumulator datatype.
++Functions | |
template<typename T , typename DST , typename std::enable_if< has_vector_inst< DST >() &&IsVector< DST >::value &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill (DST &v, const T val, const vector_length_t l, const Helium *=nullptr) |
Fill evaluator for Helium. | |
template<typename T , typename DST , typename std::enable_if< has_vector_inst< DST >() &&must_use_matrix_idx< DST >() &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill2D (DST &v, const T val, const vector_length_t rows, const vector_length_t cols, const Helium *=nullptr) |
Fill2D evaluator for Helium. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval (DA &v, const DB &other, const vector_length_t l, const Helium *=nullptr) |
Eval function for Helium. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&must_use_matrix_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval2D (DA &v, const DB &other, const vector_length_t rows, const vector_length_t cols, const Helium *=nullptr) |
Eval2D function for Helium. | |
template<class TupType , size_t... I> | |
void | printt (const TupType &_tup, std::index_sequence< I... >) |
Print tuple for debug. | |
template<class... T> | |
void | printt (const std::tuple< T... > &_tup) |
Print tuple. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&vector_idx_pair< DA, DB >(), bool >::type = true> | |
DotResult< DA > | _dot (const DA &a, const DB &b, const vector_length_t l, const Helium *=nullptr) |
Dor product for Helium. | |
template<typename DA , typename DB , typename std::enable_if< has_vector_inst< DA >() &&vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | _swap (DA &&a, DB &&b, const vector_length_t l, const Helium *=nullptr) |
Swap operator for Helium. | |
+
|
+ +inline | +
Dor product for Helium.
+[in] | a | First expression |
[in] | b | Second expression |
[in] | l | Vector length |
DA | First operand datatype |
DB | Second operand datatype |
<unnamed> | Check vector indexing and compatible vectors |
+
|
+ +inline | +
Fill evaluator for Helium.
+v | Destination value | |
[in] | val | Initialization value |
[in] | l | Vector length |
T | Scalar datatype |
DST | Destination datatype |
<unnamed> | Check if has vector indexing |
+
|
+ +inline | +
Fill2D evaluator for Helium.
+v | Destination value | |
[in] | val | Initialization value |
[in] | rows | Number of rows |
[in] | cols | Number of columns |
T | Scalar datatype |
DST | Destination datatype |
<unnamed> | Check only matrix indexing supported |
+
|
+ +inline | +
Swap operator for Helium.
+a | First opetand | |
b | Second operand | |
[in] | l | Vector length |
DA | First operand datatype |
DB | Second operand datatype |
<unnamed> | Check vector indexing and compatible vectors |
+
|
+ +inline | +
Eval function for Helium.
+v | Destination | |
[in] | other | Expression to evaluate |
[in] | l | Vector length |
DA | Destination datatype |
DB | Expression datatype |
<unnamed> | Check vector indexing and compatible vectors |
+
|
+ +inline | +
Eval2D function for Helium.
+v | Destination vector | |
[in] | other | Expression to evaluate |
[in] | rows | Number of rows |
[in] | cols | Number of columns |
DA | Destination datatype |
DB | Source datatype |
<unnamed> | Check has only matrix indexing |
void printt | +( | +const std::tuple< T... > & | +_tup | ) | ++ |
Print tuple.
+[in] | _tup | Tuple |
T | Datatype for tuple elements |
void printt | +( | +const TupType & | +_tup, | +
+ | + | std::index_sequence< I... > | ++ |
+ | ) | ++ |
Print tuple for debug.
+[in] | _tup | Tuple |
TupType | Tuple datatype |
I | List of tuple indexes |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | vector_traits< float, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > |
Vector datatype for Helium. More... | |
struct | vctpq< float > |
vctpq for this datatype More... | |
struct | vload1_gen_stride< S > |
Load with generalized stride (gather load) More... | |
struct | vload1_gen_stride< 0, 1, 2, 3 > |
Load with generalized stride specialized for <0,1,2,3> More... | |
struct | vload1_gen_stride_z< S > |
Load with generalized stride (gather load) and tail predicate. More... | |
struct | vload1_gen_stride_z< 0, 1, 2, 3 > |
Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3> More... | |
struct | vstore1_gen_stride< S > |
Generalized store with strides. More... | |
struct | vstore1_gen_stride< 0, 1, 2, 3 > |
Generalized store with stride (Specialized for <0,1,2,3>) More... | |
struct | vstore1_gen_stride_z< S > |
Store with generalized strides and tail predicate. More... | |
struct | vstore1_gen_stride_z< 0, 1, 2, 3 > |
Scatter store with tail predicate (specialized for <0,1,2,3>) More... | |
struct vector_traits< float, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | +
Vector datatype for Helium.
+arch | Current architecture |
Public Types | |
+typedef float | type |
Scalar datatype. | |
+typedef float | storage_type |
Storage datatype. | |
+typedef float32x4_t | vector |
Vector datatype. | |
+typedef float32x4_t | temp_accumulator |
Temp accumulator datatype (must be reduced to final scalar datatype) | |
+typedef mve_pred16_t | predicate_t |
Predicate datatype. | |
Static Public Member Functions | |
static float32x4_t | temp_acc_zero () |
Temp accumulator initialized to 0. | |
static constexpr float | zero_lane () |
Zero lane. | |
static constexpr float | lane_value (const float x) |
Lane value. | |
Static Public Attributes | |
+static constexpr bool | has_vector = true |
Has vector instruction. | |
+static constexpr bool | is_float = true |
Is float. | |
+static constexpr bool | is_fixed = false |
Is not fixed point. | |
+static constexpr bool | has_predicate = true |
Has predicated loops. | |
+static constexpr int | nb_lanes = 4 |
Number of lanes. | |
+
|
+ +inlinestaticconstexpr | +
Lane value.
+[in] | x | Lane vlue |
+
|
+ +inlinestatic | +
Temp accumulator initialized to 0.
+
+
|
+ +inlinestaticconstexpr | +
Zero lane.
+struct inner::vctpq< float > | +
vctpq for this datatype
+Static Public Member Functions | |
static mve_pred16_t | mk (uint32_t v) |
Make a predicate. | |
+
|
+ +inlinestatic | +
Make a predicate.
+[in] | v | Number of iterations |
struct inner::vload1_gen_stride | +
Load with generalized stride (gather load)
+S | List of offsets known at built time |
Static Public Member Functions | |
static float32x4_t | run (const float32_t *p) |
Load with generalized stride. | |
+
|
+ +inlinestatic | +
Load with generalized stride.
+[in] | p | Load address |
struct inner::vload1_gen_stride< 0, 1, 2, 3 > | +
Load with generalized stride specialized for <0,1,2,3>
+Static Public Member Functions | |
static float32x4_t | run (const float32_t *p) |
Load with generalized stride. | |
+
|
+ +inlinestatic | +
Load with generalized stride.
+[in] | p | Load address |
struct inner::vload1_gen_stride_z | +
Load with generalized stride (gather load) and tail predicate.
+S | List of offsets known at built time |
Static Public Member Functions | |
static float32x4_t | run (const float32_t *p, const std::size_t nb, const mve_pred16_t p0) |
Load. | |
+
|
+ +inlinestatic | +
Load.
+[in] | p | Load address |
[in] | nb | Number of remaining samples in loop |
[in] | p0 | Predicate for remaining samples |
struct inner::vload1_gen_stride_z< 0, 1, 2, 3 > | +
Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3>
+S | List of offsets known at built time |
Static Public Member Functions | |
static float32x4_t | run (const float32_t *p, const std::size_t nb, const mve_pred16_t p0) |
Gather load with predicated specialized for <0,1,2,3> | |
+
|
+ +inlinestatic | +
Gather load with predicated specialized for <0,1,2,3>
+[in] | p | Load address |
[in] | nb | Number of remaining samples in the loop |
[in] | p0 | Predicate for samples in the loop |
struct inner::vstore1_gen_stride | +
Generalized store with strides.
+S | Stride values known at built time |
Static Public Member Functions | |
static void | run (float32_t *p, const float32x4_t val) |
Scatter store. | |
+
|
+ +inlinestatic | +
Scatter store.
+p | Store address | |
[in] | val | VAlue to store |
struct inner::vstore1_gen_stride< 0, 1, 2, 3 > | +
Generalized store with stride (Specialized for <0,1,2,3>)
+Static Public Member Functions | |
static void | run (float32_t *p, const float32x4_t val) |
Scatter store. | |
+
|
+ +inlinestatic | +
Scatter store.
+p | Store address | |
[in] | val | Value to store |
struct inner::vstore1_gen_stride_z | +
Store with generalized strides and tail predicate.
+S | Strides values known at built time |
Static Public Member Functions | |
static void | vstore1_z (float32_t *p, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Scatter store with tail predicate. | |
+
|
+ +inlinestatic | +
Scatter store with tail predicate.
+p | Store address | |
[in] | val | Value to store |
[in] | nb | Remaining number of loops |
[in] | p0 | Loop predicate |
struct inner::vstore1_gen_stride_z< 0, 1, 2, 3 > | +
Scatter store with tail predicate (specialized for <0,1,2,3>)
+Static Public Member Functions | |
static void | vstore1_z (float32_t *p, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Scatter store with tail predicate. | |
+
|
+ +inlinestatic | +
Scatter store with tail predicate.
+p | Store address | |
[in] | val | Value to store |
[in] | nb | Number of remaining loops |
[in] | p0 | Loop predicate |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | vector_traits< float16_t, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > |
Vector features for f16 on Helium. More... | |
struct | vctpq< float16_t > |
vctpq for Helium and f16 More... | |
struct vector_traits< float16_t, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | +
Vector features for f16 on Helium.
+arch | Current architecture |
Public Types | |
+typedef float16_t | type |
Scalar datatype. | |
+typedef float16_t | storage_type |
Storage datatype. | |
+typedef float16x8_t | vector |
Vector datatype. | |
+typedef float16x8_t | temp_accumulator |
Temp accumulator datatype. | |
+typedef mve_pred16_t | predicate_t |
Predicate datatype. | |
Static Public Member Functions | |
static float16x8_t | temp_acc_zero () |
Vector of 0. | |
static constexpr float16_t | zero_lane () |
Value to write 0 in a lane. | |
static constexpr float16_t | lane_value (const float16_t x) |
Convert from lane value. | |
Static Public Attributes | |
+static constexpr bool | has_vector = true |
Has vector instructions. | |
+static constexpr bool | is_float = true |
Is float. | |
+static constexpr bool | is_fixed = false |
Is not fixed point. | |
+static constexpr bool | has_predicate = true |
Has predicated loop. | |
+static constexpr int | nb_lanes = 8 |
Number of lanes. | |
+
|
+ +inlinestaticconstexpr | +
Convert from lane value.
+[in] | x | Lane value |
+
|
+ +inlinestatic | +
Vector of 0.
+
+
|
+ +inlinestaticconstexpr | +
Value to write 0 in a lane.
+f16 suffix not supported in C++
+ +struct inner::vctpq< float16_t > | +
vctpq for Helium and f16
+Static Public Member Functions | |
static mve_pred16_t | mk (uint32_t v) |
Make predicate. | |
+
|
+ +inlinestatic | +
Make predicate.
+[in] | v | Remaining iterations |
+Content | |
Float | |
Half | |
Q15 | |
Q31 | |
Q7 | |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | vctpq< float > |
vctpq for this datatype More... | |
struct | vload1_gen_stride< S > |
Load with generalized stride (gather load) More... | |
struct | vload1_gen_stride< 0, 1, 2, 3 > |
Load with generalized stride specialized for <0,1,2,3> More... | |
struct | vload1_gen_stride_z< S > |
Load with generalized stride (gather load) and tail predicate. More... | |
struct | vload1_gen_stride_z< 0, 1, 2, 3 > |
Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3> More... | |
struct | vstore1_gen_stride< S > |
Generalized store with strides. More... | |
struct | vstore1_gen_stride< 0, 1, 2, 3 > |
Generalized store with stride (Specialized for <0,1,2,3>) More... | |
struct | vstore1_gen_stride_z< S > |
Store with generalized strides and tail predicate. More... | |
struct | vstore1_gen_stride_z< 0, 1, 2, 3 > |
Scatter store with tail predicate (specialized for <0,1,2,3>) More... | |
struct | vctpq< float16_t > |
vctpq for Helium and f16 More... | |
struct inner::vctpq< float > | +
vctpq for this datatype
+Static Public Member Functions | |
static mve_pred16_t | mk (uint32_t v) |
Make a predicate. | |
+
|
+ +inlinestatic | +
Make a predicate.
+[in] | v | Number of iterations |
struct inner::vload1_gen_stride | +
Load with generalized stride (gather load)
+S | List of offsets known at built time |
Static Public Member Functions | |
static float32x4_t | run (const float32_t *p) |
Load with generalized stride. | |
+
|
+ +inlinestatic | +
Load with generalized stride.
+[in] | p | Load address |
struct inner::vload1_gen_stride< 0, 1, 2, 3 > | +
Load with generalized stride specialized for <0,1,2,3>
+Static Public Member Functions | |
static float32x4_t | run (const float32_t *p) |
Load with generalized stride. | |
+
|
+ +inlinestatic | +
Load with generalized stride.
+[in] | p | Load address |
struct inner::vload1_gen_stride_z | +
Load with generalized stride (gather load) and tail predicate.
+S | List of offsets known at built time |
Static Public Member Functions | |
static float32x4_t | run (const float32_t *p, const std::size_t nb, const mve_pred16_t p0) |
Load. | |
+
|
+ +inlinestatic | +
Load.
+[in] | p | Load address |
[in] | nb | Number of remaining samples in loop |
[in] | p0 | Predicate for remaining samples |
struct inner::vload1_gen_stride_z< 0, 1, 2, 3 > | +
Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3>
+S | List of offsets known at built time |
Static Public Member Functions | |
static float32x4_t | run (const float32_t *p, const std::size_t nb, const mve_pred16_t p0) |
Gather load with predicated specialized for <0,1,2,3> | |
+
|
+ +inlinestatic | +
Gather load with predicated specialized for <0,1,2,3>
+[in] | p | Load address |
[in] | nb | Number of remaining samples in the loop |
[in] | p0 | Predicate for samples in the loop |
struct inner::vstore1_gen_stride | +
Generalized store with strides.
+S | Stride values known at built time |
Static Public Member Functions | |
static void | run (float32_t *p, const float32x4_t val) |
Scatter store. | |
+
|
+ +inlinestatic | +
Scatter store.
+p | Store address | |
[in] | val | VAlue to store |
struct inner::vstore1_gen_stride< 0, 1, 2, 3 > | +
Generalized store with stride (Specialized for <0,1,2,3>)
+Static Public Member Functions | |
static void | run (float32_t *p, const float32x4_t val) |
Scatter store. | |
+
|
+ +inlinestatic | +
Scatter store.
+p | Store address | |
[in] | val | Value to store |
struct inner::vstore1_gen_stride_z | +
Store with generalized strides and tail predicate.
+S | Strides values known at built time |
Static Public Member Functions | |
static void | vstore1_z (float32_t *p, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Scatter store with tail predicate. | |
+
|
+ +inlinestatic | +
Scatter store with tail predicate.
+p | Store address | |
[in] | val | Value to store |
[in] | nb | Remaining number of loops |
[in] | p0 | Loop predicate |
struct inner::vstore1_gen_stride_z< 0, 1, 2, 3 > | +
Scatter store with tail predicate (specialized for <0,1,2,3>)
+Static Public Member Functions | |
static void | vstore1_z (float32_t *p, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Scatter store with tail predicate. | |
+
|
+ +inlinestatic | +
Scatter store with tail predicate.
+p | Store address | |
[in] | val | Value to store |
[in] | nb | Number of remaining loops |
[in] | p0 | Loop predicate |
struct inner::vctpq< float16_t > | +
vctpq for Helium and f16
+Static Public Member Functions | |
static mve_pred16_t | mk (uint32_t v) |
Make predicate. | |
+
|
+ +inlinestatic | +
Make predicate.
+[in] | v | Remaining iterations |
+Namespaces | |
namespace | inner |
+Data Structures | |
struct | vector_traits< Q15, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > |
Vector features for Q15 on Helium. More... | |
struct vector_traits< Q15, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | +
Vector features for Q15 on Helium.
+arch | Current architecture |
Public Types | |
+typedef Q15 | type |
Scalar datatype. | |
+typedef type::value_type | storage_type |
Storage datatype (int16_t) | |
+typedef int16x8_t | vector |
Vector datatype. | |
+typedef Q< 33, 30 > | temp_accumulator |
Temp accumulator datatype. | |
+typedef mve_pred16_t | predicate_t |
Predicate for loop. | |
Static Public Member Functions | |
static Q< 33, 30 > | temp_acc_zero () |
Zero. | |
static constexpr int16_t | zero_lane () |
Value to write in a lane to write 0. | |
static constexpr int16_t | lane_value (const Q15 x) |
Convert to lane value. | |
Static Public Attributes | |
+static constexpr bool | has_vector = true |
Has vector instructions. | |
+static constexpr bool | is_float = false |
Is not float. | |
+static constexpr bool | is_fixed = true |
Is fixed point. | |
+static constexpr bool | has_predicate = true |
Has predicated loop. | |
+static constexpr int | nb_lanes = 8 |
Number of lanes. | |
+
|
+ +inlinestaticconstexpr | +
Convert to lane value.
+[in] | x | Lane value |
+
|
+ +inlinestatic | +
Zero.
+
+
|
+ +inlinestaticconstexpr | +
Value to write in a lane to write 0.
++Data Structures | |
struct | default_user_allocator_malloc_free |
Malloc memory allocator. More... | |
struct | user_allocator_aligned_malloc |
Memory allocation for aligned buffers. More... | |
+Functions | |
void * | aligned_malloc (std::size_t alignment, std::size_t size) |
Aligned memory allocation. | |
void | aligned_free (void *ptr) |
Free an aligned buffer. | |
Allocators for allocating memory buffers
+struct arm_cmsis_dsp::default_user_allocator_malloc_free | +
Malloc memory allocator.
+Static Public Member Functions | |
static char * | malloc (const std::size_t bytes) |
Allocate a buffer. | |
static void | free (char *const block) |
Free a buffer. | |
+
|
+ +inlinestatic | +
Free a buffer.
+block | The buffer to free |
+
|
+ +inlinestatic | +
Allocate a buffer.
+[in] | bytes | The bytes |
struct arm_cmsis_dsp::user_allocator_aligned_malloc | +
Memory allocation for aligned buffers.
+Static Public Member Functions | |
static char * | malloc (const size_type bytes) |
Allocate a new buffer. | |
static void | free (char *const block) |
Free a buffer. | |
+
|
+ +inlinestatic | +
Free a buffer.
+block | Pointer to the buffer |
+
|
+ +inlinestatic | +
Allocate a new buffer.
+[in] | bytes | The bytes |
+
|
+ +inline | +
Free an aligned buffer.
+ptr | The pointer |
+
|
+ +inline | +
Aligned memory allocation.
+[in] | alignment | The alignment of the buffer |
[in] | size | The size of the buffer |
+Content | |
Memory buffer allocator | |
Vector / matrix buffer allocator | |
Miscellaneous utilities for memory | |
+Data Structures | |
struct | default_user_allocator_malloc_free |
Malloc memory allocator. More... | |
struct | user_allocator_aligned_malloc |
Memory allocation for aligned buffers. More... | |
struct | malloc_allocator< L > |
Default memory allocator for vectors and matrixes. More... | |
struct | ListElem |
Simple list of elements. More... | |
class | MemoryPool< BUF_SIZE, UserAllocator > |
This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes. More... | |
struct arm_cmsis_dsp::default_user_allocator_malloc_free | +
Malloc memory allocator.
+Static Public Member Functions | |
static char * | malloc (const std::size_t bytes) |
Allocate a buffer. | |
static void | free (char *const block) |
Free a buffer. | |
+
|
+ +inlinestatic | +
Free a buffer.
+block | The buffer to free |
+
|
+ +inlinestatic | +
Allocate a buffer.
+[in] | bytes | The bytes |
struct arm_cmsis_dsp::user_allocator_aligned_malloc | +
Memory allocation for aligned buffers.
+Static Public Member Functions | |
static char * | malloc (const size_type bytes) |
Allocate a new buffer. | |
static void | free (char *const block) |
Free a buffer. | |
+
|
+ +inlinestatic | +
Free a buffer.
+block | Pointer to the buffer |
+
|
+ +inlinestatic | +
Allocate a new buffer.
+[in] | bytes | The bytes |
struct arm_cmsis_dsp::malloc_allocator | +
Default memory allocator for vectors and matrixes.
+L | Size known at build time in bytes |
Static Public Member Functions | |
static char * | allocate (vector_length_t sz) noexcept |
Allocate a buffer with size known at runtime. | |
static char * | allocate () noexcept |
Allocate a buffer with size known at build time. | |
static void | destroy (char *ptr) noexcept |
Destroys the given pointer. | |
+
|
+ +inlinestaticnoexcept | +
Allocate a buffer with size known at build time.
+
+
|
+ +inlinestaticnoexcept | +
Allocate a buffer with size known at runtime.
+[in] | sz | The size |
+
|
+ +inlinestaticnoexcept | +
Destroys the given pointer.
+ptr | The pointer |
struct arm_cmsis_dsp::ListElem | +
Simple list of elements.
+class arm_cmsis_dsp::MemoryPool | +
This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes.
+BUF_SIZE | Size of a buffer known at build time |
UserAllocator | Memory allocator to allocate the memory buffer |
Public Member Functions | |
MemoryPool (const uint16_t nbBufs) | |
Create a new memory pool. | |
+ | ~MemoryPool () |
Destroys the object. | |
char * | get_new_buffer () noexcept |
Gets the new free buffer. | |
void | recycle_buffer (char *buf) noexcept |
Release the buffer so that it can be reused. | |
+void | reset () noexcept |
Release all the buffers so that they can be reused. | |
+
|
+ +inlineexplicit | +
Create a new memory pool.
+[in] | nbBufs | The number of buffers to pre-allocate |
+
|
+ +inlinenoexcept | +
Gets the new free buffer.
+
+
|
+ +inlinenoexcept | +
Release the buffer so that it can be reused.
+buf | The buffer |
+Data Structures | |
struct | ListElem |
Simple list of elements. More... | |
class | MemoryPool< BUF_SIZE, UserAllocator > |
This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes. More... | |
Miscellaneous utilities for implementing memory allocators
+struct arm_cmsis_dsp::ListElem | +
Simple list of elements.
+class arm_cmsis_dsp::MemoryPool | +
This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes.
+BUF_SIZE | Size of a buffer known at build time |
UserAllocator | Memory allocator to allocate the memory buffer |
Public Member Functions | |
MemoryPool (const uint16_t nbBufs) | |
Create a new memory pool. | |
+ | ~MemoryPool () |
Destroys the object. | |
char * | get_new_buffer () noexcept |
Gets the new free buffer. | |
void | recycle_buffer (char *buf) noexcept |
Release the buffer so that it can be reused. | |
+void | reset () noexcept |
Release all the buffers so that they can be reused. | |
+
|
+ +inlineexplicit | +
Create a new memory pool.
+[in] | nbBufs | The number of buffers to pre-allocate |
+
|
+ +inlinenoexcept | +
Gets the new free buffer.
+
+
|
+ +inlinenoexcept | +
Release the buffer so that it can be reused.
+buf | The buffer |
+Data Structures | |
struct | malloc_allocator< L > |
Default memory allocator for vectors and matrixes. More... | |
Allocators for allocating vector / matrix buffers
+struct arm_cmsis_dsp::malloc_allocator | +
Default memory allocator for vectors and matrixes.
+L | Size known at build time in bytes |
Static Public Member Functions | |
static char * | allocate (vector_length_t sz) noexcept |
Allocate a buffer with size known at runtime. | |
static char * | allocate () noexcept |
Allocate a buffer with size known at build time. | |
static void | destroy (char *ptr) noexcept |
Destroys the given pointer. | |
+
|
+ +inlinestaticnoexcept | +
Allocate a buffer with size known at build time.
+
+
|
+ +inlinestaticnoexcept | +
Allocate a buffer with size known at runtime.
+[in] | sz | The size |
+
|
+ +inlinestaticnoexcept | +
Destroys the given pointer.
+ptr | The pointer |
+Data Structures | |
struct | _Outer< LHS, RHS, DerivedOp > |
Outer product operator for expressions. More... | |
struct | Slice |
Slice. More... | |
struct | Matrix< P, R, C, Allocator > |
Matrix. More... | |
struct | Matrix< P, DYNAMIC, DYNAMIC, Allocator > |
Matrix. More... | |
struct | MatrixView< T, S > |
Matrix. More... | |
struct | MatrixView< T, DYNAMIC > |
Dynamic Matrix View. More... | |
struct | MatrixView< T, CONSTRAINED_DYNAMIC > |
Dynamic Matrix View. More... | |
+Functions | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >(), bool >::type = true> | |
auto | outer (const VA &a, const VB &b) |
Outer product. | |
struct arm_cmsis_dsp::_Outer | +
Outer product operator for expressions.
+LHS | Left hand side datatype |
RHS | Right hand side datatype |
DerivedOp | Operator for the Outer operation |
vector op
vector (including matrix)
Public Types | |
+using | Scalar = typename traits< LHS >::Scalar |
Type of vector elements. | |
+using | Vector = typename traits< LHS >::Vector |
Type of vector in the architecture. | |
Public Member Functions | |
_Outer (const LHS &lhs, const RHS &rhs, const _BinaryOperator< Scalar, DerivedOp > &op) | |
Create an Outer operator. | |
_Outer (const _Outer &other) | |
Create an Outer operator from another operator of same type. | |
_Outer (_Outer &&other) | |
Move semantic for _Outer operator. | |
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true> | |
vector_length_t | length () const |
Length of the matrix (seen as vector) resulting from the outer operator. | |
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value, bool >::type = true> | |
vector_length_t | rows () const |
Rows of the matrix. | |
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< R >::value, bool >::type = true> | |
vector_length_t | columns () const |
Columns of the matrix. | |
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true> | |
Scalar const | operator() (const index_t r, const index_t c) const |
Expression value at given position. | |
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true> | |
Vector const | matrix_op (const index_t r, const index_t c) const |
Expression vector value at given position. | |
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true> | |
Vector const | matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const |
Expression vector value at given position with tail predication. | |
![]() | |
_Outer< LHS, RHS, DerivedOp > & | derived () |
Derived datatype. | |
_Outer< LHS, RHS, DerivedOp > const & | derived () const |
Derived datatype. | |
Scalar const | operator[] (const index_t i) const |
Vector indexing in the expression. | |
Scalar const | operator() (const index_t r, const index_t c) const |
Matrix indexing. | |
Vector const | vector_op (const index_t i) const |
Vector operation at given index. | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index with loop predicate. | |
Vector const | matrix_op (const index_t r, const index_t c) const |
Matrix operation at index. | |
Vector const | matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const |
Matrix operation at index with tail predication. | |
vector_length_t | length () const |
Length of result. | |
vector_length_t | rows () const |
Number of rows for result. | |
vector_length_t | columns () const |
Number of columns for result. | |
+
|
+ +inline | +
Create an Outer operator.
+lhs | Left hand side expression |
rhs | Right hand side expression |
op | operator |
Create an Outer operator from another operator of same type.
+other | the other operator |
Move semantic for _Outer operator.
+other | the other operator |
+
|
+ +inline | +
Columns of the matrix.
+R | Right hand side datatype |
L | Left hand side datatype |
+
|
+ +inline | +
Length of the matrix (seen as vector) resulting from the outer operator.
+R | Right hand side datatype |
L | Left hand side datatype |
+
|
+ +inline | +
Expression vector value at given position with tail predication.
+R | Right hand side datatype |
L | Left hand side datatype |
r | row index |
c | column index |
remaining | remaining number of samples in loop |
+
|
+ +inline | +
Expression value at given position.
+R | Right hand side datatype |
L | Left hand side datatype |
r | row index |
c | column index |
+
|
+ +inline | +
Rows of the matrix.
+R | Right hand side datatype |
L | Left hand side datatype |
struct arm_cmsis_dsp::Slice | +
struct arm_cmsis_dsp::Matrix | +
P | Type of the scalar |
R | Number of rows |
C | Number of columns |
Allocator | Memory allocator |
Public Types | |
+using | VectorType = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
![]() | |
+using | element_type = P |
Type of vector elements. | |
![]() | |
+typedef P | element_type |
Type of vector elements. | |
+using | Vector = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
constexpr vector_length_t | rows () const |
Number of rows. | |
constexpr vector_length_t | columns () const |
Number of columns. | |
constexpr uint32_t | stride () const |
Number of stride. | |
+ | Matrix () |
Create matrix. | |
Matrix (P init_val) | |
Create matrix. | |
template<template< int > typename OtherAllocator> | |
Matrix (const Matrix< P, R, C, OtherAllocator > &other) | |
Create matrix from another matrix using different memory allocator. | |
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true> | |
Matrix (const _Expr< Derived > &other) | |
Create matrix from expression. | |
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true> | |
Matrix (const _Expr< Derived > &other) | |
Create matrix from expression. | |
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true> | |
Matrix & | operator= (const _Expr< Derived > &other) |
Assign matrix from expression. | |
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true> | |
Matrix & | operator= (const _Expr< Derived > &other) |
Assign matrix from expression. | |
MatrixView< P, C > | sub (const index_t rs, const index_t cs) |
Create a matrix view. | |
const MatrixView< P, C > | sub (const index_t rs, const index_t cs) const |
Create a constant matrix view. | |
MatrixView< P, C > | sub (const Slice &rs, const index_t cs) |
Create a matrix view. | |
const MatrixView< P, C > | sub (const Slice &rs, const index_t cs) const |
Create a constant matrix view. | |
MatrixView< P, C > | sub (const index_t rs, const Slice &cs) |
Create a matrix view. | |
const MatrixView< P, C > | sub (const index_t rs, const Slice &cs) const |
Create a constant matrix view. | |
MatrixView< P, C > | sub (const Slice &rs, const Slice &cs) |
Create a matrix view. | |
const MatrixView< P, C > | sub (const Slice &rs, const Slice &cs) const |
Create a constant matrix view. | |
MatrixView< P, C > | sub (const index_t rs, const index_t re, const index_t cs, const index_t ce) |
Create a matrix view. | |
const MatrixView< P, C > | sub (const index_t rs, const index_t re, const index_t cs, const index_t ce) const |
Create a constant matrix view. | |
P & | operator() (const index_t r, const index_t c) |
Access matrix element at given position. | |
P & | operator() (const index_t r, const index_t c) const |
Access matrix element at given position. | |
template<int S = 1> | |
VectorView< P, S > | row (const index_t i, const index_t start=0, const index_t stop=C) |
Create a row view vector with stride. | |
template<int S = 1> | |
const VectorView< P, S > | row (const index_t i, const index_t start=0, const index_t stop=C) const |
Create a constant row view vector with stride. | |
template<int CS = 1, int S = C> | |
VectorView< P, CS *S > | col (const index_t i, const index_t start=0, const index_t stop=R) |
Create a column view vector with stride. | |
template<int CS = 1, int S = C> | |
const VectorView< P, CS *S > | col (const index_t i, const index_t start=0, const index_t stop=R) const |
Create a constant column view vector with stride. | |
template<int RA = R, int CA = C, typename VA , typename std::enable_if< IsVector< VA >::value &&(RA==CA) &&(RA >0) &&SameElementType< VA, P >::value, bool >::type = true> | |
void | fill_diagonal (const VA &a) |
Fill diagonal of a matrix with a vector. | |
Matrix< P, R, C, Allocator > | create () const |
Create a matrix of same type. | |
Matrix< P, C, R, Allocator > | transpose () const |
Create the transposed matrix. | |
void | matrix_store (const index_t row, const index_t col, const VectorType val) const |
Vector store at a given row,column position | |
void | matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const |
Vector store at a given row,column position with predicated tail | |
VectorType const | matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const |
Vector operation at a given row,column position with predicated tail | |
VectorType const | matrix_op (const index_t row, const index_t col) const |
Vector operation at a given row,column position | |
![]() | |
Vector () | |
Construct a new vector. | |
Vector (P init_val) | |
Construct a new vector and initialize it. | |
Vector (const std::initializer_list< P > &l) | |
Construct a new vector and initialize it with a list. | |
template<template< int > typename OtherAllocator> | |
Vector (const Vector< P, L, OtherAllocator > &other) | |
Create a vector from a vector using a different memory allocator. | |
template<int S> | |
Vector (const VectorView< P, S > &other) | |
Create a vector from a VectorView. | |
template<typename Derived > | |
Vector (const _Expr< Derived > &other) | |
Create a vector from an expression. | |
template<typename Derived > | |
Vector & | operator= (const _Expr< Derived > &other) |
Copy result of an expression to a vector content. | |
template<typename T , typename std::enable_if< is_scalar< T >(), bool >::type = true> | |
Vector & | operator= (const T other) |
Fill a vector with a constant. | |
template<typename Derived > | |
Vector & | operator+= (const _Expr< Derived > &other) |
Elementwise add the result of an expression to a vector. | |
Vector & | operator+= (const Vector &other) |
Elementwise add vector to another vector. | |
Vector & | operator+= (const P other) |
Elementwise add a constant to a vector. | |
template<typename Derived > | |
Vector & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract the result of an expression from a vector. | |
Vector & | operator-= (const Vector &other) |
Elementwise subtract a vector from a vector. | |
Vector & | operator-= (const P other) |
Elementwise subtract a constant from a vector. | |
template<typename Derived > | |
Vector & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply the result of an expression with a vector. | |
Vector & | operator*= (const Vector &other) |
Elementwise multiply a vector with a vector. | |
Vector & | operator*= (const P other) |
Elementwise multiply a constant with a vector. | |
template<int S = 1> | |
VectorView< P, S > | sub (const index_t start=0, const index_t stop=L) |
Create a vector view. | |
![]() | |
vector_length_t | length () const |
Vector dimension. | |
P * | ptr () const |
Pointer to storage buffer. | |
P * | ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
const P * | const_ptr () const |
Pointer to storage buffer. | |
const P * | const_ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
P * | begin () const |
Iterator begin. | |
P * | end () const |
Iterator end. | |
P & | operator[] (const index_t i) |
Element at index i. | |
P & | operator[] (const index_t i) const |
Element at index i. | |
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true> | |
void | vector_store (const index_t i, const Vector val) const |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
Static Public Member Functions | |
template<int RA = R, int CA = C, typename VA , typename std::enable_if< IsVector< VA >::value &&(RA==CA) &&(RA >0) &&SameElementType< VA, P >::value, bool >::type = true> | |
static Matrix< P, RA, CA, Allocator > | diagonal (const VA &a) |
Create a diagonal matrix. | |
template<int RA = R, int CA = C, typename std::enable_if<(RA==CA) &&(RA >0), bool >::type = true> | |
static Matrix< P, RA, CA, Allocator > | identity () |
Create an identity matrix. | |
![]() | |
static char * | allocate () |
Allocate a buffer for this vector using the memory allocator. | |
+Additional Inherited Members | |
![]() | |
+static constexpr vector_length_t | vector_size = sizeof(P)*L |
Length of the vector when known at build time. | |
+
|
+ +inlineexplicit | +
Create matrix.
+init_val | Initialization value |
+
|
+ +inlineexplicit | +
Create matrix from another matrix using different memory allocator.
+OtherAllocator | other memory allocator |
other | Other matrix |
Create matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Only applies when the expression does not contain any MatrixView since matrix view may have a stride and cannot be used as vectors.
+ +Create matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.
+ +
+
|
+ +inline | +
Create a column view vector with stride.
+S | stride |
i | column index |
start | Start index in row |
stop | Stop index in row Default is number of rows |
+
|
+ +inline | +
Create a constant column view vector with stride.
+S | stride |
i | column index |
start | Start index in row |
stop | Stop index in row Default is number of rows |
+
|
+ +inlineconstexpr | +
Number of columns.
+
+
|
+ +inline | +
Create a matrix of same type.
+
+
|
+ +inlinestatic | +
+
|
+ +inline | +
+
|
+ +inlinestatic | +
Create an identity matrix.
+RA | Number of rows |
CA | Number of columns |
Only exists when RA == CA and the size is known at built time
+ +
+
|
+ +inline | +
Vector operation at a given row,column position
+row | row index |
col | column index |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype
+ +
+
|
+ +inline | +
Vector operation at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Vector store at a given row,column position
+row | row index |
col | column index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.
+ +
+
|
+ +inline | +
Vector store at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Access matrix element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Access matrix element at given position.
+r | Row index |
c | Column index |
Assign matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Applies when expression does not contain matrix view
+ +Assign matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.
+ +
+
|
+ +inline | +
Create a row view vector with stride.
+S | stride |
i | row index |
start | Start index in row |
stop | Stop index in row Default is number of columns |
+
|
+ +inline | +
Create a constant row view vector with stride.
+S | stride |
i | row index |
start | Start index in row |
stop | Stop index in row Default is number of columns |
+
|
+ +inlineconstexpr | +
Number of rows.
+
+
|
+ +inlineconstexpr | +
Number of stride.
+
+
|
+ +inline | +
Create a matrix view.
+rs | start row |
cs | start column |
+
|
+ +inline | +
Create a constant matrix view.
+rs | start row |
cs | start column |
+
|
+ +inline | +
Create a matrix view.
+rs | Row start |
re | Row end |
cs | Column start |
ce | Column end |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row start |
re | Row end |
cs | Column start |
ce | Column end |
+
|
+ +inline | +
Create a matrix view.
+rs | Row start index |
cs | Column slice |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row start index |
cs | Column slice |
+
|
+ +inline | +
Create a matrix view.
+rs | Row slice (start and end row) |
cs | start column |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row slice (start and end row) |
cs | start column |
+
|
+ +inline | +
Create a matrix view.
+rs | Row slice |
cs | Column slice |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row slice |
cs | Column slice |
+
|
+ +inline | +
Create the transposed matrix.
+struct arm_cmsis_dsp::Matrix< P, DYNAMIC, DYNAMIC, Allocator > | +
P | Type of the scalar |
Allocator | Memory allocator |
Public Types | |
+using | VectorType = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
![]() | |
+typedef P | element_type |
Type of vector elements. | |
+using | Vector = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
vector_length_t | rows () const |
Number of rows. | |
vector_length_t | columns () const |
Number of columns. | |
uint32_t | stride () const |
Number of stride. | |
Matrix (vector_length_t r, vector_length_t c) | |
Create matrix. | |
Matrix (vector_length_t r, vector_length_t c, P init_val) | |
Create matrix. | |
P & | operator() (const index_t r, const index_t c) |
Access matrix element at given position. | |
P & | operator() (const index_t r, const index_t c) const |
Access matrix element at given position. | |
template<int RK, int CK, template< int > typename OtherAllocator> | |
Matrix (const Matrix< P, RK, CK, OtherAllocator > &other) | |
Create matrix from another matrix using different memory allocator. | |
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true> | |
Matrix (const _Expr< Derived > &other) | |
Create matrix from expression. | |
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true> | |
Matrix (const _Expr< Derived > &other) | |
Create matrix from expression. | |
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true> | |
Matrix & | operator= (const _Expr< Derived > &other) |
Assign matrix from expression. | |
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true> | |
Matrix & | operator= (const _Expr< Derived > &other) |
Assign matrix from expression. | |
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, P >::value, bool >::type = true> | |
void | fill_diagonal (const VA &a) |
Fill diagonal of a matrix with a vector. | |
Matrix< P, DYNAMIC, DYNAMIC, Allocator > | create () const |
Create a matrix of same type. | |
Matrix< P, DYNAMIC, DYNAMIC, Allocator > | transpose () const |
Create the transposed matrix. | |
VectorView< P, 1 > | row (const index_t i, const index_t start=0) |
Create a row view with stride 1. | |
VectorView< P, 1 > | row (const index_t i, const index_t start, const index_t stop) |
Create a row view with stride 1. | |
const VectorView< P, 1 > | row (const index_t i, const index_t start=0) const |
Create a constant row view with stride 1. | |
const VectorView< P, 1 > | row (const index_t i, const index_t start, const index_t stop) const |
Create a constant row view with stride 1. | |
template<int CS = 1> | |
VectorView< P, DYNAMIC > | col (const index_t i, const index_t start=0) |
Create a column view vector. | |
template<int CS = 1> | |
VectorView< P, DYNAMIC > | col (const index_t i, const index_t start, const index_t stop) |
Create a column view vector. | |
template<int CS = 1> | |
const VectorView< P, DYNAMIC > | col (const index_t i, const index_t start=0) const |
Create a constant column view vector. | |
template<int CS = 1> | |
const VectorView< P, DYNAMIC > | col (const index_t i, const index_t start, const index_t stop) const |
Create a constant column view vector. | |
void | matrix_store (const index_t row, const index_t col, const VectorType val) const |
Vector store at a given row,column position | |
void | matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const |
Vector store at a given row,column position with predicated tail | |
VectorType const | matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const |
Vector operation at a given row,column position with predicated tail | |
VectorType const | matrix_op (const index_t row, const index_t col) const |
Vector operation at a given row,column position | |
MatrixView< P, DYNAMIC > | sub (const index_t rs, const index_t cs) |
Create a matrix view. | |
const MatrixView< P, DYNAMIC > | sub (const index_t rs, const index_t cs) const |
Create a constant matrix view. | |
MatrixView< P, DYNAMIC > | sub (const Slice &rs, const index_t cs) |
Create a matrix view. | |
const MatrixView< P, DYNAMIC > | sub (const Slice &rs, const index_t cs) const |
Create a constant matrix view. | |
MatrixView< P, DYNAMIC > | sub (const index_t rs, const Slice &cs) |
Create a matrix view. | |
const MatrixView< P, DYNAMIC > | sub (const index_t rs, const Slice &cs) const |
Create a constant matrix view. | |
MatrixView< P, DYNAMIC > | sub (const Slice &rs, const Slice &cs) |
Create a matrix view. | |
const MatrixView< P, DYNAMIC > | sub (const Slice &rs, const Slice &cs) const |
Create a constant matrix view. | |
MatrixView< P, DYNAMIC > | sub (const index_t rs, const index_t re, const index_t cs, const index_t ce) |
Create a matrix view. | |
const MatrixView< P, DYNAMIC > | sub (const index_t rs, const index_t re, const index_t cs, const index_t ce) const |
Create a constant matrix view. | |
![]() | |
Vector (vector_length_t length, P init_val) | |
Create a new vector. | |
Vector (vector_length_t length) | |
Create a new vector. | |
Vector (const std::initializer_list< P > &l) | |
Create a new vector. | |
template<int K, template< int > typename OtherAllocator> | |
Vector (const Vector< P, K, OtherAllocator > &other) | |
Create a new vector from a vector using a different memory allocator. | |
Vector (const Vector &other) | |
Create a new vector from a vector of same type. | |
template<int S> | |
Vector (const VectorView< P, S > &other) | |
Create a new vector from a vector view. | |
template<typename Derived > | |
Vector (const _Expr< Derived > &other) | |
Create a new vector from an expressipn. | |
template<typename Derived > | |
Vector & | operator= (const _Expr< Derived > &other) |
Fill a vector with an expression. | |
template<typename T , typename std::enable_if< is_scalar< T >(), bool >::type = true> | |
Vector & | operator= (const T other) |
Fill a vector with a scalar. | |
template<typename Derived > | |
Vector & | operator+= (const _Expr< Derived > &other) |
Elementwise add an expression to a vector. | |
Vector & | operator+= (const Vector &other) |
Elementwise add a vector to a vector. | |
Vector & | operator+= (const P other) |
Elementwise add a scalar to a vector. | |
template<typename Derived > | |
Vector & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract an expression to a vector. | |
Vector & | operator-= (const Vector &other) |
Elementwise subtract a vector to a vector. | |
Vector & | operator-= (const P other) |
Elementwise subtract a scalar to a vector. | |
template<typename Derived > | |
Vector & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply an expression with a vector. | |
Vector & | operator*= (const Vector &other) |
Elementwise multiply a vector with a vector. | |
Vector & | operator*= (const P other) |
Elementwise multiply a scalar with a vector. | |
template<int S = 1> | |
VectorView< P, S > | sub (const index_t start=0, const index_t stop=-1) |
Create a vector view. | |
![]() | |
vector_length_t | length () const |
Vector dimension. | |
P * | ptr () const |
Pointer to storage buffer. | |
P * | ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
const P * | const_ptr () const |
Pointer to storage buffer. | |
const P * | const_ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
P * | begin () const |
Iterator begin. | |
P * | end () const |
Iterator end. | |
P & | operator[] (const index_t i) |
Element at index i. | |
P & | operator[] (const index_t i) const |
Element at index i. | |
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true> | |
void | vector_store (const index_t i, const Vector val) const |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
Static Public Member Functions | |
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, P >::value, bool >::type = true> | |
static Matrix< P, DYNAMIC, DYNAMIC, Allocator > | diagonal (const VA &a) |
Create a diagonal matrix. | |
static Matrix< P, DYNAMIC, DYNAMIC, Allocator > | identity (const vector_length_t l) |
Create an identity matrix. | |
![]() | |
static char * | allocate (vector_length_t length) |
Allocate a buffer for this vector using the memory allocator. | |
+
|
+ +inlineexplicit | +
Create matrix.
+r | number of rows |
c | number of columns |
+
|
+ +inlineexplicit | +
Create matrix.
+r | number of rows |
c | number of columns |
init_val | Initialization value |
+
|
+ +inlineexplicit | +
Create matrix from another matrix using different memory allocator.
+RK | Number of rows |
CK | Number of columns |
OtherAllocator | other memory allocator |
other | Other matrix |
Create matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Only applies when the expression does not contain any MatrixView since matrix view may have a stride and cannot be used as vectors.
+ +Create matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.
+ +
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Number of columns.
+Create a matrix of same type.
+
+
|
+ +inline | +
+
|
+ +inlinestatic | +
+
|
+ +inline | +
Vector operation at a given row,column position
+row | row index |
col | column index |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype
+ +
+
|
+ +inline | +
Vector operation at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Vector store at a given row,column position
+row | row index |
col | column index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.
+ +
+
|
+ +inline | +
Vector store at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Access matrix element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Access matrix element at given position.
+r | Row index |
c | Column index |
Assign matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Applies when expression does not contain matrix view
+ +Assign matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Other matrix |
Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.
+ +
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Number of rows.
+
+
|
+ +inline | +
Number of stride.
+
+
|
+ +inline | +
Create a matrix view.
+rs | start row |
cs | start column |
+
|
+ +inline | +
Create a constant matrix view.
+rs | start row |
cs | start column |
+
|
+ +inline | +
Create a matrix view.
+rs | Row start |
re | Row end |
cs | Column start |
ce | Column end |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row start |
re | Row end |
cs | Column start |
ce | Column end |
+
|
+ +inline | +
Create a matrix view.
+rs | Row start index |
cs | Column slice |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row start index |
cs | Column slice |
+
|
+ +inline | +
Create a matrix view.
+rs | Row slice (start and end row) |
cs | start column |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row slice (start and end row) |
cs | start column |
+
|
+ +inline | +
Create a matrix view.
+rs | Row slice |
cs | Column slice |
+
|
+ +inline | +
Create a constant matrix view.
+rs | Row slice |
cs | Column slice |
struct arm_cmsis_dsp::MatrixView | +
T | Type of the scalar |
S | Stride |
Public Types | |
+using | VectorType = typename vector_traits< T >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
vector_length_t | rows () const |
Number of rows. | |
vector_length_t | columns () const |
Number of columns. | |
constexpr uint32_t | stride () const |
Number of stride. | |
MatrixView (T *v, const vector_length_t rows, const vector_length_t cols) | |
Create matrix view on a buffer (buffer not owned by the view) | |
MatrixView (const Vector_Base< T > &v, const vector_length_t rows, const vector_length_t cols) | |
Create matrix view on vector (vector not owned by the view) | |
T & | operator() (const index_t r, const index_t c) |
Access matrix view element at given position. | |
T const | operator() (const index_t r, const index_t c) const |
Access matrix view element at given position. | |
template<typename Derived > | |
MatrixView & | operator= (const _Expr< Derived > &other) |
Assign matrix from expression. | |
MatrixView & | operator= (const T val) |
Assign matrix view from constant. | |
template<typename Derived > | |
MatrixView & | operator+= (const _Expr< Derived > &other) |
Add matrix from expression. | |
MatrixView & | operator+= (const MatrixView &other) |
Add matrix from matrix view. | |
MatrixView & | operator+= (const T other) |
Add constant to matrix view. | |
template<typename Derived > | |
MatrixView & | operator-= (const _Expr< Derived > &other) |
Subtract matrix from expression. | |
MatrixView & | operator-= (const MatrixView &other) |
Subtract matrix view. | |
MatrixView & | operator-= (const T other) |
Subtract constant. | |
template<typename Derived > | |
MatrixView & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply matrix view with expression. | |
MatrixView & | operator*= (const MatrixView &other) |
Elementwise multiply matrix view with matrix view. | |
MatrixView & | operator*= (const T other) |
Elementwise multiply matrix view constant. | |
VectorView< T, 1 > | row (const index_t i, const index_t start=0) |
Create a row view with stride 1. | |
VectorView< T, 1 > | row (const index_t i, const index_t start, const index_t stop) |
Create a row view with stride 1. | |
const VectorView< T, 1 > | row (const index_t i, const index_t start=0) const |
Create a constant row view with stride 1. | |
const VectorView< T, 1 > | row (const index_t i, const index_t start, const index_t stop) const |
Create a constant row view with stride 1. | |
template<int CS = 1> | |
VectorView< T, CS *S > | col (const index_t i, const index_t start=0) |
Create a column view vector. | |
template<int CS = 1> | |
VectorView< T, CS *S > | col (const index_t i, const index_t start, const index_t stop) |
Create a column view vector. | |
template<int CS = 1> | |
const VectorView< T, CS *S > | col (const index_t i, const index_t start=0) const |
Create a constant column view vector. | |
template<int CS = 1> | |
const VectorView< T, CS *S > | col (const index_t i, const index_t start, const index_t stop) const |
Create a constant column view vector. | |
void | matrix_store (const index_t row, const index_t col, const VectorType val) const |
Vector store at a given row,column position | |
void | matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const |
Vector store at a given row,column position with predicated tail | |
VectorType const | matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const |
Vector operation at a given row,column position with predicated tail | |
VectorType const | matrix_op (const index_t row, const index_t col) const |
Vector operation at a given row,column position | |
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, T >::value, bool >::type = true> | |
void | fill_diagonal (const VA &a) |
Fill diagonal of a matrix with a vector. | |
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > | transpose () const |
Create the transposed matrix. | |
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > | create () const |
Create a matrix of same type. | |
T * | ptr () const |
Pointer to storage buffer. | |
const T * | const_ptr () const |
Constant pointer to storage buffer. | |
+
|
+ +inlineexplicit | +
Create matrix view on a buffer (buffer not owned by the view)
+v | buffer |
rows | number of rows |
cols | number of columns |
+
|
+ +inlineexplicit | +
Create matrix view on vector (vector not owned by the view)
+v | vector |
rows | number of rows |
cols | number of columns |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Number of columns.
+
+
|
+ +inline | +
Constant pointer to storage buffer.
+
+
|
+ +inline | +
Create a matrix of same type.
+
+
|
+ +inline | +
+
|
+ +inline | +
Vector operation at a given row,column position
+row | row index |
col | column index |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype
+ +
+
|
+ +inline | +
Vector operation at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Vector store at a given row,column position
+row | row index |
col | column index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.
+ +
+
|
+ +inline | +
Vector store at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Access matrix view element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Access matrix view element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Elementwise multiply matrix view with expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | expression |
+
|
+ +inline | +
Elementwise multiply matrix view with matrix view.
+other | Other matrix |
+
|
+ +inline | +
Elementwise multiply matrix view constant.
+other | constant |
+
|
+ +inline | +
Add matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Expression |
+
|
+ +inline | +
Add matrix from matrix view.
+other | Other matrix |
+
|
+ +inline | +
Add constant to matrix view.
+other | The constant |
+
|
+ +inline | +
Subtract matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | expression |
+
|
+ +inline | +
Subtract matrix view.
+other | Other matrix view |
+
|
+ +inline | +
Subtract constant.
+other | Other matrix |
+
|
+ +inline | +
Assign matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Expression |
+
|
+ +inline | +
Assign matrix view from constant.
+val | The constant |
+
|
+ +inline | +
Pointer to storage buffer.
+
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Number of rows.
+
+
|
+ +inlineconstexpr | +
Number of stride.
+
+
|
+ +inline | +
Create the transposed matrix.
+struct arm_cmsis_dsp::MatrixView< T, DYNAMIC > | +
Dynamic Matrix View.
+T | Type of the scalar |
This template is used for dynamic matrix (stride not known at build time) and when we do not know if stride == number of columns. When stride is different from number of columns, the matrix cannot be seen as a vector.
+Public Types | |
+using | VectorType = typename vector_traits< T >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
vector_length_t | rows () const |
Number of rows. | |
vector_length_t | columns () const |
Number of columns. | |
uint32_t | stride () const |
Number of stride. | |
MatrixView (T *v, const vector_length_t rows, const vector_length_t cols, const uint32_t stride) | |
Create matrix view on a buffer (buffer not owned by the view) | |
MatrixView (const Vector_Base< T > &v, const vector_length_t rows, const vector_length_t cols, const uint32_t stride) | |
Create matrix view on vector (vector not owned by the view) | |
T & | operator() (const index_t r, const index_t c) |
Access matrix view element at given position. | |
T const | operator() (const index_t r, const index_t c) const |
Access matrix view element at given position. | |
template<typename Derived > | |
MatrixView & | operator= (const _Expr< Derived > &other) |
Assign matrix view from expression. | |
MatrixView & | operator= (const T val) |
Assign matrix view from constant. | |
template<typename Derived > | |
MatrixView & | operator+= (const _Expr< Derived > &other) |
Add matrix from expression. | |
MatrixView & | operator+= (const MatrixView &other) |
Add matrix from matrix view. | |
MatrixView & | operator+= (const T other) |
Add constant to matrix view. | |
template<typename Derived > | |
MatrixView & | operator-= (const _Expr< Derived > &other) |
Subtract matrix from expression. | |
MatrixView & | operator-= (const MatrixView &other) |
Subtract matrix view. | |
MatrixView & | operator-= (const T other) |
Subtract constant. | |
template<typename Derived > | |
MatrixView & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply matrix view with expression. | |
MatrixView & | operator*= (const MatrixView &other) |
Elementwise multiply matrix view with matrix view. | |
MatrixView & | operator*= (const T other) |
Elementwise multiply matrix view constant. | |
VectorView< T, 1 > | row (const index_t i, const index_t start=0) |
Create a row view with stride 1. | |
VectorView< T, 1 > | row (const index_t i, const index_t start, const index_t stop) |
Create a row view with stride 1. | |
const VectorView< T, 1 > | row (const index_t i, const index_t start=0) const |
Create a constant row view with stride 1. | |
const VectorView< T, 1 > | row (const index_t i, const index_t start, const index_t stop) const |
Create a constant row view with stride 1. | |
template<int CS = 1> | |
VectorView< T, DYNAMIC > | col (const index_t i, const index_t start=0) |
Create a column view vector. | |
template<int CS = 1> | |
VectorView< T, DYNAMIC > | col (const index_t i, const index_t start, const index_t stop) |
Create a column view vector. | |
template<int CS = 1> | |
const VectorView< T, DYNAMIC > | col (const index_t i, const index_t start=0) const |
Create a constant column view vector. | |
template<int CS = 1> | |
const VectorView< T, DYNAMIC > | col (const index_t i, const index_t start, const index_t stop) const |
Create a constant column view vector. | |
void | matrix_store (const index_t row, const index_t col, const VectorType val) const |
Vector store at a given row,column position | |
void | matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const |
Vector store at a given row,column position with predicated tail | |
VectorType const | matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const |
Vector operation at a given row,column position with predicated tail | |
VectorType const | matrix_op (const index_t row, const index_t col) const |
Vector operation at a given row,column position | |
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, T >::value, bool >::type = true> | |
void | fill_diagonal (const VA &a) |
Fill diagonal of a matrix with a vector. | |
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > | transpose () const |
Create the transposed matrix. | |
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > | create () const |
Create a matrix of same type. | |
T * | ptr () const |
Pointer to storage buffer. | |
const T * | const_ptr () const |
Constant pointer to storage buffer. | |
+
|
+ +inlineexplicit | +
Create matrix view on a buffer (buffer not owned by the view)
+v | buffer |
rows | number of rows |
cols | number of columns |
stride | stride |
+
|
+ +inlineexplicit | +
Create matrix view on vector (vector not owned by the view)
+v | vector |
rows | number of rows |
cols | number of columns |
stride | stride |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Number of columns.
+
+
|
+ +inline | +
Constant pointer to storage buffer.
+
+
|
+ +inline | +
Create a matrix of same type.
+
+
|
+ +inline | +
+
|
+ +inline | +
Vector operation at a given row,column position
+row | row index |
col | column index |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype
+ +
+
|
+ +inline | +
Vector operation at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Vector store at a given row,column position
+row | row index |
col | column index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.
+ +
+
|
+ +inline | +
Vector store at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Access matrix view element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Access matrix view element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Elementwise multiply matrix view with expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | expression |
+
|
+ +inline | +
Elementwise multiply matrix view with matrix view.
+other | Other matrix |
+
|
+ +inline | +
Elementwise multiply matrix view constant.
+other | constant |
+
|
+ +inline | +
Add matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Expression |
+
|
+ +inline | +
Add matrix from matrix view.
+other | Other matrix |
+
|
+ +inline | +
Add constant to matrix view.
+other | The constant |
+
|
+ +inline | +
Subtract matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | expression |
+
|
+ +inline | +
Subtract matrix view.
+other | Other matrix view |
+
|
+ +inline | +
Subtract constant.
+other | Other matrix |
+
|
+ +inline | +
Assign matrix view from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Expression |
+
|
+ +inline | +
Assign matrix view from constant.
+val | The constant |
+
|
+ +inline | +
Pointer to storage buffer.
+
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Number of rows.
+
+
|
+ +inline | +
Number of stride.
+
+
|
+ +inline | +
Create the transposed matrix.
+struct arm_cmsis_dsp::MatrixView< T, CONSTRAINED_DYNAMIC > | +
Dynamic Matrix View.
+T | Type of the scalar |
This template is used for dynamic matrix (stride not known at build time) and when we do know that stride == number of columns. When stride is equal to the number of columns, the matrix can be seen as a vector and it enables to use the vector eval loop in the operator fusion mechanism.
+Those matrix views are created by expression when a reference to a matrix is used in the expression tree (to avoid copying the matrix). In this case, we do know that the matrix view is the full matrix and thus stride == number of columns
+Public Types | |
+using | VectorType = typename vector_traits< T >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
![]() | |
+using | Vector = typename vector_traits< T >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
vector_length_t | rows () const |
Number of rows. | |
vector_length_t | columns () const |
Number of columns. | |
uint32_t | stride () const |
Number of stride. | |
MatrixView (T *v, const vector_length_t rows, const vector_length_t cols) | |
Create matrix view on a buffer (buffer not owned by the view) | |
MatrixView (const Vector_Base< T > &v, const vector_length_t rows, const vector_length_t cols) | |
Create matrix view on vector (vector not owned by the view) | |
T & | operator() (const index_t r, const index_t c) |
Access matrix view element at given position. | |
T const | operator() (const index_t r, const index_t c) const |
Access matrix view element at given position. | |
template<typename Derived > | |
MatrixView & | operator= (const _Expr< Derived > &other) |
Assign matrix view from expression. | |
MatrixView & | operator= (const T val) |
Assign matrix view from constant. | |
template<typename Derived > | |
MatrixView & | operator+= (const _Expr< Derived > &other) |
Add matrix from expression. | |
MatrixView & | operator+= (const MatrixView &other) |
Add matrix from matrix view. | |
MatrixView & | operator+= (const T other) |
Add constant to matrix view. | |
template<typename Derived > | |
MatrixView & | operator-= (const _Expr< Derived > &other) |
Subtract matrix from expression. | |
MatrixView & | operator-= (const MatrixView &other) |
Subtract matrix view. | |
MatrixView & | operator-= (const T other) |
Subtract constant. | |
template<typename Derived > | |
MatrixView & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply matrix view with expression. | |
MatrixView & | operator*= (const MatrixView &other) |
Elementwise multiply matrix view with matrix view. | |
MatrixView & | operator*= (const T other) |
Elementwise multiply matrix view constant. | |
VectorView< T, 1 > | row (const index_t i, const index_t start=0) |
Create a row view with stride 1. | |
VectorView< T, 1 > | row (const index_t i, const index_t start, const index_t stop) |
Create a row view with stride 1. | |
const VectorView< T, 1 > | row (const index_t i, const index_t start=0) const |
Create a constant row view with stride 1. | |
const VectorView< T, 1 > | row (const index_t i, const index_t start, const index_t stop) const |
Create a constant row view with stride 1. | |
template<int CS = 1> | |
VectorView< T, DYNAMIC > | col (const index_t i, const index_t start=0) |
Create a column view vector. | |
template<int CS = 1> | |
VectorView< T, DYNAMIC > | col (const index_t i, const index_t start, const index_t stop) |
Create a column view vector. | |
template<int CS = 1> | |
const VectorView< T, DYNAMIC > | col (const index_t i, const index_t start=0) const |
Create a constant column view vector. | |
template<int CS = 1> | |
const VectorView< T, DYNAMIC > | col (const index_t i, const index_t start, const index_t stop) const |
Create a constant column view vector. | |
void | matrix_store (const index_t row, const index_t col, const VectorType val) const |
Vector store at a given row,column position | |
void | matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const |
Vector store at a given row,column position with predicated tail | |
VectorType const | matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const |
Vector operation at a given row,column position with predicated tail | |
VectorType const | matrix_op (const index_t row, const index_t col) const |
Vector operation at a given row,column position | |
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, T >::value, bool >::type = true> | |
void | fill_diagonal (const VA &a) |
Fill diagonal of a matrix with a vector. | |
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > | transpose () const |
Create the transposed matrix. | |
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > | create () const |
Create a matrix of same type. | |
![]() | |
VectorView (T *v, const vector_length_t start, const vector_length_t stop) | |
Create a vector view on a buffer. | |
VectorView (const Vector_Base< T > &v) | |
Create a vector on a vector. | |
VectorView (const Vector_Base< T > &v, const index_t start, const index_t stop) | |
Create a vector view on vector. | |
VectorView (const VectorView &other) | |
Create a vector view from another view. | |
VectorView (VectorView &&other) | |
Move a vector view to another view. | |
vector_length_t | length () const |
Vector view dimension. | |
T * | ptr () const |
Pointer to view storage. | |
T * | ptr (const index_t i) const |
Pointer to view storage at index i. | |
const T * | const_ptr () const |
Pointer to view constant storage. | |
const T * | const_ptr (const index_t i) const |
Pointer to view constant storage at index i. | |
T & | operator[] (const index_t i) |
Element at index i. | |
T & | operator[] (const index_t i) const |
Element at index i. | |
void | vector_store (const index_t i, const Vector val) |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
VectorView & | operator= (const _Expr< Derived > &other) |
Assign an expression to a vector view. | |
VectorView & | operator= (const T val) |
Assign a scalar to a vector view. | |
VectorView & | operator+= (const _Expr< Derived > &other) |
Elementwise add an expression to a vector view. | |
VectorView & | operator+= (const VectorView &other) |
Elementwise add a vector view to a vector view. | |
VectorView & | operator+= (const T other) |
Elementwise add a scalar to a vector view. | |
VectorView & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract an expression to a vector view. | |
VectorView & | operator-= (const VectorView &other) |
Elementwise subtract a vector view to a vector view. | |
VectorView & | operator-= (const T other) |
Elementwise subtract a scalar to a vector view. | |
VectorView & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply an expression to a vector view. | |
VectorView & | operator*= (const VectorView &other) |
Elementwise multiply a vector view to a vector view. | |
VectorView & | operator*= (const T other) |
Elementwise multiply a scalar to a vector view. | |
VectorView< T, S *stride > | sub (const index_t start=0, const index_t stop=-1) |
Create a sub vector (a view of a view) | |
const VectorView< T, S *stride > | sub (const index_t start=0, const index_t stop=-1) const |
Create a constant sub vector (a view of a view) | |
+Additional Inherited Members | |
![]() | |
static constexpr vector_length_t | compute_length (const index_t start, const index_t stop) |
Compute the number of elements in the vector view. | |
+
|
+ +inlineexplicit | +
Create matrix view on a buffer (buffer not owned by the view)
+v | buffer |
rows | number of rows |
cols | number of columns |
+
|
+ +inlineexplicit | +
Create matrix view on vector (vector not owned by the view)
+v | vector |
rows | number of rows |
cols | number of columns |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
stop | Stop index in column |
+
|
+ +inline | +
Create a column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Create a constant column view vector.
+CS | column stride |
i | column index |
start | Start index in column |
+
|
+ +inline | +
Number of columns.
+
+
|
+ +inline | +
Create a matrix of same type.
+
+
|
+ +inline | +
+
|
+ +inline | +
Vector operation at a given row,column position
+row | row index |
col | column index |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype
+ +
+
|
+ +inline | +
Vector operation at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Vector store at a given row,column position
+row | row index |
col | column index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.
+ +
+
|
+ +inline | +
Vector store at a given row,column position with predicated tail
+row | row index |
col | column index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column index in this matrix datatype with predication
+ +
+
|
+ +inline | +
Access matrix view element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Access matrix view element at given position.
+r | Row index |
c | Column index |
+
|
+ +inline | +
Elementwise multiply matrix view with expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | expression |
+
|
+ +inline | +
Elementwise multiply matrix view with matrix view.
+other | Other matrix |
+
|
+ +inline | +
Elementwise multiply matrix view constant.
+other | constant |
+
|
+ +inline | +
Add matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Expression |
+
|
+ +inline | +
Add matrix from matrix view.
+other | Other matrix |
+
|
+ +inline | +
Add constant to matrix view.
+other | The constant |
+
|
+ +inline | +
Subtract matrix from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | expression |
+
|
+ +inline | +
Subtract matrix view.
+other | Other matrix view |
+
|
+ +inline | +
Subtract constant.
+other | Other matrix |
+
|
+ +inline | +
Assign matrix view from expression.
+Derived | Datatype representing the abstract syntax tree of the expression |
other | Expression |
+
|
+ +inline | +
Assign matrix view from constant.
+val | The constant |
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
stop | Stop index in row |
+
|
+ +inline | +
Create a row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Create a constant row view with stride 1.
+i | row index |
start | Start index in row |
+
|
+ +inline | +
Number of rows.
+
+
|
+ +inline | +
Number of stride.
+
+
|
+ +inline | +
Create the transposed matrix.
++Content | |
DSP extension specific number definitions | |
Helium specific number definitions | |
Scalar number definitions | |
+Data Structures | |
struct | number_traits< T > |
Properties of a scalar datatype. More... | |
struct | vector_traits< T, arch, typename > |
Properties of a vector datatype linked to a scalar datatype. More... | |
struct | vctpq< T, typename > |
Predicate (only defined for vector architectures) More... | |
Number datatypes expressing different properties of the numbers according to the architecture.
+Those definitions are used to write architecture independents algorithms.
+struct arm_cmsis_dsp::number_traits | +
Properties of a scalar datatype.
+T | datatype |
Needs to contain two static bool : is_float and is_fixed
+Needs to contain a static function one
returning the value 1 for this datatype (used to write some datatype generic algorithms)
struct arm_cmsis_dsp::vector_traits | +
Properties of a vector datatype linked to a scalar datatype.
+T | Type of the scalar |
arch | Architecture. It is defined by the architecture selection code and should never be set by the user. + |
Public Types | |
+typedef T | type |
Scalar datatype. | |
+typedef T | storage_type |
Storage type (for instance for Q15 scalar the storage is int16_t) | |
Static Public Attributes | |
+static constexpr bool | has_vector = false |
True if scalar type has a related vector type. | |
+static constexpr bool | is_float = false |
True if scalar type is a float (half, float or double) | |
+static constexpr bool | is_fixed = false |
True if scalar type is fixed point. | |
struct arm_cmsis_dsp::inner::vctpq | +
Predicate (only defined for vector architectures)
+T | scalar data type |
v | Number of loops |
+Functions | |
template<typename T , typename DST , typename std::enable_if< IsVector< DST >::value &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill (DST &v, const T val, vector_length_t l, const Scalar *=nullptr) |
Fill evaluator for scalar architecture. | |
template<typename T , typename DST , typename std::enable_if< must_use_matrix_idx< DST >() &&SameElementType< DST, T >::value, bool >::type = true> | |
void | _Fill2D (DST &v, const T val, const vector_length_t rows, const vector_length_t cols, const Scalar *=nullptr) |
Fill2D evaluator for scalar architecture. | |
template<typename DA , typename DB , typename std::enable_if< vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval (DA &v, const DB &other, const vector_length_t l, const Scalar *=nullptr) |
Expression evaluator for vector in scalar mode. | |
template<typename DA , typename DB , typename std::enable_if< must_use_matrix_idx_pair< DA, DB >(), bool >::type = true> | |
void | eval2D (DA &v, const DB &other, const vector_length_t rows, const vector_length_t cols, const Scalar *=nullptr) |
2D expression evaluator for scalar archiecture | |
template<typename DA , typename DB , typename std::enable_if< vector_idx_pair< DA, DB >(), bool >::type = true> | |
DotResult< DA > | _dot (const DA &a, const DB &b, const vector_length_t l, const Scalar *=nullptr) |
Dot product evaluator for scalar architectuire. | |
template<typename DA , typename DB , typename std::enable_if< vector_idx_pair< DA, DB >(), bool >::type = true> | |
void | _swap (DA &&a, DB &&b, const vector_length_t l, const Scalar *=nullptr) |
Swap evaluator for scalar architecture. | |
template<typename MA , typename MB > | |
__STATIC_INLINE void | _arm_mat_trans (const MA &src, MB &dst, const Scalar *=nullptr) |
Transposition for scalar architecture. | |
template<typename M , typename V , typename RES > | |
void | _dot_m_v (RES &res, const M &m, const V &v, const Scalar *=nullptr) |
Matrix times vector for scalar architecture. | |
template<typename MA , typename MB , typename RES , typename TMP , typename std::enable_if< number_traits< typename traits< MA >::Scalar >::is_fixed, bool >::type = true> | |
__STATIC_INLINE void | _dot_m_m (const MA &pSrcA, const MB &pSrcB, RES &&pDst, const TMP &BT, const Scalar *=nullptr) |
Matrix times matrix for scalar architecture and fixed point. | |
template<typename MA , typename MB , typename RES , typename std::enable_if< number_traits< typename traits< MA >::Scalar >::is_float, bool >::type = true> | |
__STATIC_INLINE void | _dot_m_m (const MA &pSrcA, const MB &pSrcB, RES &&pDst, const Scalar *=nullptr) |
Matrix times matrix for scalar architecture and float. | |
__STATIC_INLINE void _arm_mat_trans | +( | +const MA & | +src, | +
+ | + | MB & | +dst, | +
+ | + | const Scalar * | + = nullptr |
+
+ | ) | ++ |
Transposition for scalar architecture.
+[in] | src | The source |
dst | The destination |
MA | Source datatype |
MB | Destination datatype |
+
|
+ +inline | +
Dot product evaluator for scalar architectuire.
+[in] | a | Left hand side |
[in] | b | Right hand side |
[in] | l | Vector lenght |
DA | Left hand side datatype (may be expression) |
DB | Right hand side datatype (may be expression) |
<unnamed> | Check vector expressions are compatible |
__STATIC_INLINE void _dot_m_m | +( | +const MA & | +pSrcA, | +
+ | + | const MB & | +pSrcB, | +
+ | + | RES && | +pDst, | +
+ | + | const Scalar * | + = nullptr |
+
+ | ) | ++ |
Matrix times matrix for scalar architecture and float.
+[in] | pSrcA | The source a |
[in] | pSrcB | The source b |
pDst | The destination |
MA | Left hand side datatype |
MB | Right hand side datatype |
RES | Result datatype |
<unnamed> | Check if float |
__STATIC_INLINE void _dot_m_m | +( | +const MA & | +pSrcA, | +
+ | + | const MB & | +pSrcB, | +
+ | + | RES && | +pDst, | +
+ | + | const TMP & | +BT, | +
+ | + | const Scalar * | + = nullptr |
+
+ | ) | ++ |
Matrix times matrix for scalar architecture and fixed point.
+[in] | pSrcA | The source a |
[in] | pSrcB | The source b |
pDst | The destination | |
[in] | BT | Temporary matrix for transposition |
MA | Left hand side datatype |
MB | Right hand side datatype |
RES | Destination datatype |
TMP | Temporary matrix datatype |
<unnamed> | Check fixed point arithmetic used |
+
|
+ +inline | +
Matrix times vector for scalar architecture.
+res | Destination | |
[in] | m | Matrix |
[in] | v | Vector (my be expression) |
M | Matrix datatype |
V | Vector datatype |
RES | Result datatype |
+
|
+ +inline | +
Fill evaluator for scalar architecture.
+v | Destination vector | |
[in] | val | Initialization value |
[in] | l | Length of vector |
T | Scalar datatype |
DST | VEctor / Matrix datatype |
<unnamed> | Test to restrict to vector addressing and compatible datatype |
+
|
+ +inline | +
Fill2D evaluator for scalar architecture.
+v | Matrix value | |
[in] | val | Initialization value |
[in] | rows | Number of rows |
[in] | cols | Number of columns |
T | Scalar datatype |
DST | Matrix datatype |
<unnamed> | Check DST has matrix indexing only |
+
|
+ +inline | +
Swap evaluator for scalar architecture.
+a | Left hand side | |
b | Right hand side | |
[in] | l | Vector length |
DA | Left hand side datatype |
DB | Right hand side datatype |
<unnamed> | Check vectors are compatible |
+
|
+ +inline | +
Expression evaluator for vector in scalar mode.
+v | Vector | |
[in] | other | Expression |
[in] | l | Length of expression (number of samples) |
DA | Destination datatype |
DB | Source datatype |
<unnamed> | Check vectors are compatible |
+
|
+ +inline | +
2D expression evaluator for scalar archiecture
+v | Destination value | |
[in] | other | The expression |
[in] | rows | Number of rows |
[in] | cols | Number of columns |
DA | Destination datatype |
DB | Source datatype |
<unnamed> | Check only support matrix indexing |
+Data Structures | |
struct | Vector_Base< P > |
Storage for a vector. More... | |
struct | Vector< P, L, Allocator > |
Vector template for size knonw at build time. More... | |
struct | Vector< P, DYNAMIC, Allocator > |
Vector template for dynamic vector (size known at runtime) More... | |
struct | VectorView< T, stride > |
Vector view. More... | |
struct | VectorView< T, DYNAMIC > |
Vector view with dynamic stride (not known at build time) More... | |
+Functions | |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator+ (const LHS &a, const RHS &b) |
Addition operator for expressions. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | operator+ (const LHS &a) |
| |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | expr (const LHS &a) |
Identity operator for expression. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | copy (const LHS &a) |
Identity operator for expression. | |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator- (const LHS &a, const RHS &b) |
Subtraction operator for expressions. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | operator- (const LHS &a) |
| |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator* (const LHS &a, const RHS &b) |
Element wise multiplication operator for expressions. | |
struct arm_cmsis_dsp::Vector_Base | +
Storage for a vector.
+P | Type of the scalar |
Public Types | |
+typedef P | element_type |
Type of vector elements. | |
+using | Vector = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
vector_length_t | length () const |
Vector dimension. | |
P * | ptr () const |
Pointer to storage buffer. | |
P * | ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
const P * | const_ptr () const |
Pointer to storage buffer. | |
const P * | const_ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
P * | begin () const |
Iterator begin. | |
P * | end () const |
Iterator end. | |
P & | operator[] (const index_t i) |
Element at index i. | |
P & | operator[] (const index_t i) const |
Element at index i. | |
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true> | |
void | vector_store (const index_t i, const Vector val) const |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
+
|
+ +inline | +
Iterator begin.
+
+
|
+ +inline | +
Pointer to storage buffer.
+
+
|
+ +inline | +
Pointer to storage buffer at index i.
+i | Index in buffer |
+
|
+ +inline | +
Iterator end.
+
+
|
+ +inline | +
+
|
+ +inline | +
Element at index i.
+i | index |
+
|
+ +inline | +
Element at index i.
+i | index |
+
|
+ +inline | +
Pointer to storage buffer.
+
+
|
+ +inline | +
Pointer to storage buffer at index i.
+i | Index in buffer |
Vector operation at index i
+i | index |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i. In the case of a vector, this operation is a load
+ +
+
|
+ +inline | +
Vector operation at index i with predicated tail
+i | index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i with predication. In the case of a vector, this operation is a load
+ +
+
|
+ +inline | +
Vector store at index i
+T | scalar datatype |
i | index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype
+ +
+
|
+ +inline | +
Vector store at index i with predicated tail
+i | index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype with predication
+ +struct arm_cmsis_dsp::Vector | +
Vector template for size knonw at build time.
+P | Type of the scalar |
L | Vector length in number of elements. Negative if length not known at build time. It is the default value |
Allocator | Memory allocator to use. By default it is the macro TMP_ALLOC |
Public Types | |
+using | element_type = P |
Type of vector elements. | |
![]() | |
+typedef P | element_type |
Type of vector elements. | |
+using | Vector = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
Vector () | |
Construct a new vector. | |
Vector (P init_val) | |
Construct a new vector and initialize it. | |
Vector (const std::initializer_list< P > &l) | |
Construct a new vector and initialize it with a list. | |
template<template< int > typename OtherAllocator> | |
Vector (const Vector< P, L, OtherAllocator > &other) | |
Create a vector from a vector using a different memory allocator. | |
template<int S> | |
Vector (const VectorView< P, S > &other) | |
Create a vector from a VectorView. | |
template<typename Derived > | |
Vector (const _Expr< Derived > &other) | |
Create a vector from an expression. | |
template<typename Derived > | |
Vector & | operator= (const _Expr< Derived > &other) |
Copy result of an expression to a vector content. | |
template<typename T , typename std::enable_if< is_scalar< T >(), bool >::type = true> | |
Vector & | operator= (const T other) |
Fill a vector with a constant. | |
template<typename Derived > | |
Vector & | operator+= (const _Expr< Derived > &other) |
Elementwise add the result of an expression to a vector. | |
Vector & | operator+= (const Vector &other) |
Elementwise add vector to another vector. | |
Vector & | operator+= (const P other) |
Elementwise add a constant to a vector. | |
template<typename Derived > | |
Vector & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract the result of an expression from a vector. | |
Vector & | operator-= (const Vector &other) |
Elementwise subtract a vector from a vector. | |
Vector & | operator-= (const P other) |
Elementwise subtract a constant from a vector. | |
template<typename Derived > | |
Vector & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply the result of an expression with a vector. | |
Vector & | operator*= (const Vector &other) |
Elementwise multiply a vector with a vector. | |
Vector & | operator*= (const P other) |
Elementwise multiply a constant with a vector. | |
template<int S = 1> | |
VectorView< P, S > | sub (const index_t start=0, const index_t stop=L) |
Create a vector view. | |
![]() | |
vector_length_t | length () const |
Vector dimension. | |
P * | ptr () const |
Pointer to storage buffer. | |
P * | ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
const P * | const_ptr () const |
Pointer to storage buffer. | |
const P * | const_ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
P * | begin () const |
Iterator begin. | |
P * | end () const |
Iterator end. | |
P & | operator[] (const index_t i) |
Element at index i. | |
P & | operator[] (const index_t i) const |
Element at index i. | |
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true> | |
void | vector_store (const index_t i, const Vector val) const |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
Static Public Member Functions | |
static char * | allocate () |
Allocate a buffer for this vector using the memory allocator. | |
Static Public Attributes | |
+static constexpr vector_length_t | vector_size = sizeof(P)*L |
Length of the vector when known at build time. | |
+
|
+ +inline | +
Construct a new vector.
+The length is known at build time. ++
+
|
+ +inlineexplicit | +
Construct a new vector and initialize it.
+The length is known at build time. +
init_val | Initialization value + |
+
|
+ +inline | +
Construct a new vector and initialize it with a list.
+A vector can be initialized like an array using {} syntax + The length is known at build time. +
l | Initialization list + |
+
|
+ +inlineexplicit | +
Create a vector from a vector using a different memory allocator.
+other | Other vector using a different memory allocator |
+
|
+ +inlineexplicit | +
Create a vector from a VectorView.
+S | The stride of the vector view known at build time |
other | The vector view |
Create a vector from an expression.
+Derived | The type representing the abstract syntax tree |
other | The expression |
It is the mechanism allowing to evaluate an expression and merge all of the operators the of the expression in the same loop
+ +
+
|
+ +inlinestatic | +
Allocate a buffer for this vector using the memory allocator.
+Elementwise multiply the result of an expression with a vector.
+Derived | The type representing the abstract syntax tree of the expression |
other | The expression |
+
|
+ +inline | +
Elementwise multiply a constant with a vector.
+Derived | Constant datatype |
other | The constant |
+
|
+ +inline | +
Elementwise multiply a vector with a vector.
+other | The othr vector |
Elementwise add the result of an expression to a vector.
+Derived | The type representing the abstract syntax tree of the expression |
other | The expression |
+
|
+ +inline | +
Elementwise add a constant to a vector.
+P | The constant datatype |
other | The expression |
+
|
+ +inline | +
Elementwise add vector to another vector.
+other | The vector |
Elementwise subtract the result of an expression from a vector.
+Derived | The type representing the abstract syntax tree of the expression |
other | The expression |
+
|
+ +inline | +
Elementwise subtract a constant from a vector.
+P | Datatype of the constant |
other | The constant |
+
|
+ +inline | +
Elementwise subtract a vector from a vector.
+other | The other vector |
Copy result of an expression to a vector content.
+Derived | The type representing the abstract syntax tree |
other | The expression |
It is the mechanism allowing to evaluate an expression and merge all of the operators the of the expression in the same loop
+ +
+
|
+ +inline | +
Fill a vector with a constant.
+T | The constant datatype |
other | The const |
+
|
+ +inline | +
Create a vector view.
+S | Stride known at build time |
start | Start index for the vector view |
stop | Stop index for the vector view (first element after the vector view) Default is length of the vector if known at build time. |
struct arm_cmsis_dsp::Vector< P, DYNAMIC, Allocator > | +
Vector template for dynamic vector (size known at runtime)
+P | Type of the scalar |
Allocator | Memory allocator to use. By default it is the macro TMP_ALLOC |
Public Member Functions | |
Vector (vector_length_t length, P init_val) | |
Create a new vector. | |
Vector (vector_length_t length) | |
Create a new vector. | |
Vector (const std::initializer_list< P > &l) | |
Create a new vector. | |
template<int K, template< int > typename OtherAllocator> | |
Vector (const Vector< P, K, OtherAllocator > &other) | |
Create a new vector from a vector using a different memory allocator. | |
Vector (const Vector &other) | |
Create a new vector from a vector of same type. | |
template<int S> | |
Vector (const VectorView< P, S > &other) | |
Create a new vector from a vector view. | |
template<typename Derived > | |
Vector (const _Expr< Derived > &other) | |
Create a new vector from an expressipn. | |
template<typename Derived > | |
Vector & | operator= (const _Expr< Derived > &other) |
Fill a vector with an expression. | |
template<typename T , typename std::enable_if< is_scalar< T >(), bool >::type = true> | |
Vector & | operator= (const T other) |
Fill a vector with a scalar. | |
template<typename Derived > | |
Vector & | operator+= (const _Expr< Derived > &other) |
Elementwise add an expression to a vector. | |
Vector & | operator+= (const Vector &other) |
Elementwise add a vector to a vector. | |
Vector & | operator+= (const P other) |
Elementwise add a scalar to a vector. | |
template<typename Derived > | |
Vector & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract an expression to a vector. | |
Vector & | operator-= (const Vector &other) |
Elementwise subtract a vector to a vector. | |
Vector & | operator-= (const P other) |
Elementwise subtract a scalar to a vector. | |
template<typename Derived > | |
Vector & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply an expression with a vector. | |
Vector & | operator*= (const Vector &other) |
Elementwise multiply a vector with a vector. | |
Vector & | operator*= (const P other) |
Elementwise multiply a scalar with a vector. | |
template<int S = 1> | |
VectorView< P, S > | sub (const index_t start=0, const index_t stop=-1) |
Create a vector view. | |
![]() | |
vector_length_t | length () const |
Vector dimension. | |
P * | ptr () const |
Pointer to storage buffer. | |
P * | ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
const P * | const_ptr () const |
Pointer to storage buffer. | |
const P * | const_ptr (const index_t i) const |
Pointer to storage buffer at index i. | |
P * | begin () const |
Iterator begin. | |
P * | end () const |
Iterator end. | |
P & | operator[] (const index_t i) |
Element at index i. | |
P & | operator[] (const index_t i) const |
Element at index i. | |
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true> | |
void | vector_store (const index_t i, const Vector val) const |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
Static Public Member Functions | |
static char * | allocate (vector_length_t length) |
Allocate a buffer for this vector using the memory allocator. | |
+Additional Inherited Members | |
![]() | |
+typedef P | element_type |
Type of vector elements. | |
+using | Vector = typename vector_traits< P >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
+
|
+ +inlineexplicit | +
Create a new vector.
+length | Vector dimension |
init_val | Initialization value |
+
|
+ +inlineexplicit | +
Create a new vector.
+length | Vector dimension |
+
|
+ +inlineexplicit | +
Create a new vector.
+l | Initializer list A vector can be initialized like an array using {} syntax |
+
|
+ +inlineexplicit | +
Create a new vector from a vector using a different memory allocator.
+K | Dimension of other vector (statically known or dynamic) |
other | The vector to copy |
Create a new vector from a vector of same type.
+other | The vector to copy |
+
|
+ +inlineexplicit | +
Create a new vector from a vector view.
+S | Stride of vector view known at build time |
other | The vector to copy |
Create a new vector from an expressipn.
+Derived | Type representing the abstract syntax tree of the expression |
other | The expression to evaluate |
+
|
+ +inlinestatic | +
Allocate a buffer for this vector using the memory allocator.
+length | Vector dimension |
Elementwise multiply an expression with a vector.
+Derived | Type representing the abstract syntax tree of the expression |
other | The expression to evaluate |
+
|
+ +inline | +
Elementwise multiply a scalar with a vector.
+P | Scalar datatype |
other | The scalar |
+
|
+ +inline | +
Elementwise multiply a vector with a vector.
+other | The vector to add |
Elementwise add an expression to a vector.
+Derived | Type representing the abstract syntax tree of the expression |
other | The expression to evaluate |
+
|
+ +inline | +
Elementwise add a scalar to a vector.
+P | Scalar datatype |
other | The scalar |
+
|
+ +inline | +
Elementwise add a vector to a vector.
+other | The vector to add |
Elementwise subtract an expression to a vector.
+Derived | Type representing the abstract syntax tree of the expression |
other | The expression to evaluate |
+
|
+ +inline | +
Elementwise subtract a scalar to a vector.
+P | Scalar datatype |
other | The scalar |
+
|
+ +inline | +
Elementwise subtract a vector to a vector.
+other | The vector to add |
Fill a vector with an expression.
+Derived | Type representing the abstract syntax tree of the expression |
other | The expression to evaluate |
+
|
+ +inline | +
Fill a vector with a scalar.
+T | Scalar datatype |
other | The scalar |
+
|
+ +inline | +
Create a vector view.
+S | stride |
start | Start index of view |
stop | Stop index of view (first index after end of view) By default it is the length of the vector. |
struct arm_cmsis_dsp::VectorView | +
Vector view.
+T | Type of the scalar |
S | Stride known at build time (default 1) |
Public Types | |
+using | Vector = typename vector_traits< T >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
VectorView (T *v, const vector_length_t start, const vector_length_t stop) | |
Create a vector view on a buffer. | |
VectorView (const Vector_Base< T > &v) | |
Create a vector on a vector. | |
VectorView (const Vector_Base< T > &v, const index_t start, const index_t stop) | |
Create a vector view on vector. | |
vector_length_t | length () const |
Vector view dimension. | |
T * | ptr () const |
Pointer to view storage. | |
T * | ptr (const index_t i) const |
Pointer to view storage at index i. | |
const T * | const_ptr () const |
Pointer to view constant storage. | |
const T * | const_ptr (const index_t i) const |
Pointer to view constant storage at index i. | |
T & | operator[] (const index_t i) |
Element at index i. | |
T & | operator[] (const index_t i) const |
Element at index i. | |
void | vector_store (const index_t i, const Vector val) |
Vector store at index i | |
void | vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (const index_t i, const vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (const index_t i) const |
Vector operation at index i | |
VectorView (const VectorView &other) | |
Create a vector view from another view. | |
VectorView (VectorView &&other) | |
Move a vector view to another view. | |
template<typename Derived > | |
VectorView & | operator= (const _Expr< Derived > &other) |
Assign an expression to a vector view. | |
VectorView & | operator= (const T val) |
Assign a scalar to a vector view. | |
template<typename Derived > | |
VectorView & | operator+= (const _Expr< Derived > &other) |
Elementwise add an expression to a vector view. | |
VectorView & | operator+= (const VectorView &other) |
Elementwise add a vector view to a vector view. | |
VectorView & | operator+= (const T other) |
Elementwise add a scalar to a vector view. | |
template<typename Derived > | |
VectorView & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract an expression to a vector view. | |
VectorView & | operator-= (const VectorView &other) |
Elementwise subtract a vector view to a vector view. | |
VectorView & | operator-= (const T other) |
Elementwise subtract a scalar to a vector view. | |
template<typename Derived > | |
VectorView & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply an expression to a vector view. | |
VectorView & | operator*= (const VectorView &other) |
Elementwise multiply a vector view to a vector view. | |
VectorView & | operator*= (const T other) |
Elementwise multiply a scalar to a vector view. | |
template<int S = 1> | |
VectorView< T, S *stride > | sub (const index_t start=0, const index_t stop=-1) |
Create a sub vector (a view of a view) | |
template<int S = 1> | |
const VectorView< T, S *stride > | sub (const index_t start=0, const index_t stop=-1) const |
Create a constant sub vector (a view of a view) | |
Static Public Member Functions | |
static constexpr vector_length_t | compute_length (const index_t start, const index_t stop) |
Compute the number of elements in the vector view. | |
+
|
+ +inlineexplicit | +
Create a vector view on a buffer.
+v | Buffer of samples (not owned by the view) |
start | Start index of the view |
stop | Stop index of the view (first elemnt after the view) |
+
|
+ +inlineexplicit | +
Create a vector on a vector.
+v | Vector storage (not owned by the view) |
+
|
+ +inlineexplicit | +
Create a vector view on vector.
+v | Vector storage (not owned by the view) |
start | Start index of the view |
stop | Stop index of the view (first elemnt after the view) |
+
|
+ +inline | +
Create a vector view from another view.
+other | the other vector view |
The new vector view will point to the same storage as the other vector view. No copy of element is occuring. To copy vector view content, the expr and copy operators are needed.
+ +
+
|
+ +inline | +
Move a vector view to another view.
+other | the other vector view |
The new vector view will point to the same storage as the other vector view. No copy of element is occuring.
+The other vector view is no more valid (points to null storage)
+ +
+
|
+ +inlinestaticconstexpr | +
+
|
+ +inline | +
Pointer to view constant storage.
+
+
|
+ +inline | +
Pointer to view constant storage at index i.
+i | Index |
The stride is used to compute this pointer. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Vector view dimension.
+
+
|
+ +inline | +
Elementwise multiply an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
+
|
+ +inline | +
Elementwise multiply a scalar to a vector view.
+other | the scalar |
+
|
+ +inline | +
Elementwise multiply a vector view to a vector view.
+other | the vector view to add |
+
|
+ +inline | +
Elementwise add an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
+
|
+ +inline | +
Elementwise add a scalar to a vector view.
+other | the scalar |
+
|
+ +inline | +
Elementwise add a vector view to a vector view.
+other | the vector view to add |
+
|
+ +inline | +
Elementwise subtract an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
+
|
+ +inline | +
Elementwise subtract a scalar to a vector view.
+other | the scalar |
+
|
+ +inline | +
Elementwise subtract a vector view to a vector view.
+other | the vector view to add |
+
|
+ +inline | +
Assign an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
Evaluate an expression an assign its result to the vector view
+ +
+
|
+ +inline | +
Assign a scalar to a vector view.
+val | the scalar |
+
|
+ +inline | +
Element at index i.
+i | Index |
The stride is used to compute this reference. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Element at index i.
+i | Index |
The stride is used to compute this reference. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Pointer to view storage.
+
+
|
+ +inline | +
Pointer to view storage at index i.
+i | Index |
The stride is used to compute this pointer. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Create a sub vector (a view of a view)
+S | stride known at build time |
start | Start index |
stop | Stop index (first element after the view) By default it is the vector view length |
+
|
+ +inline | +
Create a constant sub vector (a view of a view)
+S | stride known at build time |
start | Start index |
stop | Stop index (first element after the view) By default it is the vector view length |
Vector operation at index i
+i | index |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i. In the case of a vector, this operation is a load
+ +
+
|
+ +inline | +
Vector operation at index i with predicated tail
+i | index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i with predication. In the case of a vector, this operation is a load
+ +
+
|
+ +inline | +
Vector store at index i
+i | index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype
+ +
+
|
+ +inline | +
Vector store at index i with predicated tail
+i | index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype with predication
+ +struct arm_cmsis_dsp::VectorView< T, DYNAMIC > | +
Vector view with dynamic stride (not known at build time)
+T | Type of the scalar |
Public Types | |
+using | Vector = typename vector_traits< T >::vector |
Type of vectors for a vector architecture and for scalar datatype P. | |
Public Member Functions | |
vector_length_t | compute_length (const index_t start, const index_t stop, const index_t stride) const |
Compute the number of elements in the vector view. | |
VectorView (T *v, const index_t start, const index_t stop, const index_t stride) | |
Create a vector view on a buffer. | |
VectorView (const Vector_Base< T > &v, const index_t stride) | |
Create a vector view on a vector. | |
VectorView (const Vector_Base< T > &v, const index_t start, const index_t stop, const index_t stride) | |
Create a vector view on a vector. | |
vector_length_t | length () const |
Vector view dimension. | |
T * | ptr () const |
Pointer to view storage. | |
T * | ptr (const index_t i) const |
Pointer to view storage at index i. | |
const T * | const_ptr () const |
Pointer to view constant storage. | |
const T * | const_ptr (const index_t i) const |
Pointer to view constant storage at index i. | |
T & | operator[] (index_t i) |
Element at index i. | |
T & | operator[] (index_t i) const |
Element at index i. | |
void | vector_store (index_t i, Vector val) |
Vector store at index i | |
void | vector_store_tail (index_t i, vector_length_t remaining, Vector val) |
Vector store at index i with predicated tail | |
Vector const | vector_op_tail (index_t i, vector_length_t remaining) const |
Vector operation at index i with predicated tail | |
Vector const | vector_op (index_t i) const |
Vector operation at index i | |
VectorView (const VectorView &other) | |
Create a vector view from another view. | |
VectorView (VectorView &&other) | |
Move a vector view to another view. | |
template<typename Derived > | |
VectorView & | operator= (const _Expr< Derived > &other) |
Assign an expression to a vector view. | |
VectorView & | operator= (const T val) |
Assign a scalar to a vector view. | |
template<typename Derived > | |
VectorView & | operator+= (const _Expr< Derived > &other) |
Elementwise add an expression to a vector view. | |
VectorView & | operator+= (const VectorView &other) |
Elementwise add a vector view to a vector view. | |
VectorView & | operator+= (const T other) |
Elementwise add a scalar to a vector view. | |
template<typename Derived > | |
VectorView & | operator-= (const _Expr< Derived > &other) |
Elementwise subtract an expression to a vector view. | |
VectorView & | operator-= (const VectorView &other) |
Elementwise subtract a vector view to a vector view. | |
VectorView & | operator-= (const T other) |
Elementwise subtract a scalar to a vector view. | |
template<typename Derived > | |
VectorView & | operator*= (const _Expr< Derived > &other) |
Elementwise multiply an expression to a vector view. | |
VectorView & | operator*= (const VectorView &other) |
Elementwise multiply a vector view to a vector view. | |
VectorView & | operator*= (const T other) |
Elementwise multiply a scalar to a vector view. | |
index_t | stride () const |
Stride of the vector view. | |
template<int S = 1> | |
VectorView< T, DYNAMIC > | sub (const index_t start=0, const index_t stop=-1) |
Create a sub vector (a view of a view) | |
template<int S = 1> | |
const VectorView< T, DYNAMIC > | sub (const index_t start=0, const index_t stop=-1) const |
Create a constant sub vector (a view of a view) | |
+
|
+ +inlineexplicit | +
Create a vector view on a buffer.
+v | Buffer of samples (not owned by the view) |
start | Start index of the view |
stop | Stop index of the view (first elemnt after the view) |
stride | Stride (only known at runtime) |
+
|
+ +inlineexplicit | +
Create a vector view on a vector.
+v | Vector owning the storage (not owned by the view) |
stride | Stride (only known at runtime) |
start is 0 stop is defined by the length of the vector
+ +
+
|
+ +inlineexplicit | +
Create a vector view on a vector.
+v | Vector owning the storage (not owned by the view) |
start | Start index of the view |
stop | Stop index |
stride | Stride (only known at runtime) |
+
|
+ +inline | +
Create a vector view from another view.
+other | the other vector view |
The new vector view will point to the same storage as the other vector view. No copy of element is occuring. To copy vector view content, the expr and copy operators are needed.
+ +
+
|
+ +inline | +
Move a vector view to another view.
+other | the other vector view |
The new vector view will point to the same storage as the other vector view. No copy of element is occuring.
+The other vector view is no more valid (points to null storage)
+ +
+
|
+ +inline | +
+
|
+ +inline | +
Pointer to view constant storage.
+
+
|
+ +inline | +
Pointer to view constant storage at index i.
+i | Index |
The stride is used to compute this pointer. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Vector view dimension.
+
+
|
+ +inline | +
Elementwise multiply an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
+
|
+ +inline | +
Elementwise multiply a scalar to a vector view.
+other | the scalar |
+
|
+ +inline | +
Elementwise multiply a vector view to a vector view.
+other | the vector view to add |
+
|
+ +inline | +
Elementwise add an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
+
|
+ +inline | +
Elementwise add a scalar to a vector view.
+other | the scalar |
+
|
+ +inline | +
Elementwise add a vector view to a vector view.
+other | the vector view to add |
+
|
+ +inline | +
Elementwise subtract an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
+
|
+ +inline | +
Elementwise subtract a scalar to a vector view.
+other | the scalar |
+
|
+ +inline | +
Elementwise subtract a vector view to a vector view.
+other | the vector view to add |
+
|
+ +inline | +
Assign an expression to a vector view.
+Derived | the datatype representing the abstract syntax tree of the view |
other | the expression |
Evaluate an expression an assign its result to the vector view
+ +
+
|
+ +inline | +
Assign a scalar to a vector view.
+val | the scalar |
+
|
+ +inline | +
Element at index i.
+i | Index |
The stride is used to compute this reference. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Element at index i.
+i | Index |
The stride is used to compute this reference. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Pointer to view storage.
+
+
|
+ +inline | +
Pointer to view storage at index i.
+i | Index |
The stride is used to compute this pointer. The index is scaled by the stride.
+ +
+
|
+ +inline | +
Stride of the vector view.
+
+
|
+ +inline | +
Create a sub vector (a view of a view)
+S | stride known at build time |
start | Start index |
stop | Stop index (first element after the view) By default it is the vector view length |
+
|
+ +inline | +
Create a constant sub vector (a view of a view)
+S | stride known at build time |
start | Start index |
stop | Stop index (first element after the view) By default it is the vector view length |
Vector operation at index i
+i | index |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i. In the case of a vector, this operation is a load
+ +
+
|
+ +inline | +
Vector operation at index i with predicated tail
+i | index |
remaining | Number of remaining samples in the loop |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i with predication. In the case of a vector, this operation is a load
+ +
+
|
+ +inline | +
Vector store at index i
+i | index |
val | Vector value |
On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype
+ +
+
|
+ +inline | +
Vector store at index i with predicated tail
+i | index |
remaining | Number of remaining samples in the loop |
val | Vector value to write at index i with tail predication |
On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype with predication
+ +
+
|
+ +inline | +
Identity operator for expression.
+LHS | Left hand side datatype |
a | Left hand side expression tree |
Used to consider a vector view as an expression and force the copy of this vector view when assigned to another vector entity.
+ +
+
|
+ +inline | +
Identity operator for expression.
+LHS | Left hand side datatype |
a | Left hand side expression tree |
Used to consider a vector view as an expression and force the copy of this vector view when assigned to another vector entity.
+ +
+
|
+ +inline | +
Element wise multiplication operator for expressions.
+LHS | Left hand side datatype |
RHS | Right hand side datatype |
a | Left hand side expression tree |
b | Right hand side expression tree |
elementwise vector * vector (including matrix)
+ +
+
|
+ +inline | +
LHS | Left hand side datatype |
a | Left hand side expression tree |
+vector (including matrix)
+ +
+
|
+ +inline | +
Addition operator for expressions.
+LHS | Left hand side datatype |
RHS | Right hand side datatype |
a | Left hand side expression tree |
b | Right hand side expression tree |
vector + vector (including matrix)
+ +
+
|
+ +inline | +
LHS | Left hand side datatype |
a | Left hand side expression tree |
-vector (including matrix)
+ +
+
|
+ +inline | +
Subtraction operator for expressions.
+LHS | Left hand side datatype |
RHS | Right hand side datatype |
a | Left hand side expression tree |
b | Right hand side expression tree |
vector - vector (including matrix)
+ +C_BinaryOperator< Scalar, Derived > | Unary operator |
►C_BinaryOperator< Scalar, _AddOp< Scalar > > | |
►C_BinaryOperator< Scalar, _MulOp< Scalar > > | |
►C_BinaryOperator< Scalar, _SubOp< Scalar > > | |
C_BinaryOperator< Scalar, DerivedOp > | |
C_Expr< T > | Expression template |
►C_Expr< _Binary< LHS, RHS, DerivedOp > > | |
►C_Expr< _Outer< LHS, RHS, DerivedOp > > | |
►C_Expr< _Unary< LHS, DerivedOp > > | |
C_UnaryOperator< Scalar, Derived > | Unary operator |
►C_UnaryOperator< Scalar, _NegOp< Scalar > > | |
►C_UnaryOperator< Scalar, _NoOp< Scalar > > | |
C_UnaryOperator< Scalar, DerivedOp > | |
CAccumulate< MD, MS, F, S, bool > | Accumulation without saturation |
CAccumulate< MD, MS, F, S, true > | Accumulation without saturation |
Carm_bilinear_interp_instance_f16 | Instance structure for the floating-point bilinear interpolation function |
Carm_bilinear_interp_instance_f32 | Instance structure for the floating-point bilinear interpolation function |
Carm_bilinear_interp_instance_q15 | Instance structure for the Q15 bilinear interpolation function |
Carm_bilinear_interp_instance_q31 | Instance structure for the Q31 bilinear interpolation function |
Carm_bilinear_interp_instance_q7 | Instance structure for the Q15 bilinear interpolation function |
Carm_biquad_cas_df1_32x64_ins_q31 | Instance structure for the high precision Q31 Biquad cascade filter |
Carm_biquad_cascade_df2T_instance_f16 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_df2T_instance_f32 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_df2T_instance_f64 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_stereo_df2T_instance_f16 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_cascade_stereo_df2T_instance_f32 | Instance structure for the floating-point transposed direct form II Biquad cascade filter |
Carm_biquad_casd_df1_inst_f16 | Instance structure for the floating-point Biquad cascade filter |
Carm_biquad_casd_df1_inst_f32 | Instance structure for the floating-point Biquad cascade filter |
Carm_biquad_casd_df1_inst_q15 | Instance structure for the Q15 Biquad cascade filter |
Carm_biquad_casd_df1_inst_q31 | Instance structure for the Q31 Biquad cascade filter |
Carm_cfft_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_instance_f64 | Instance structure for the Double Precision Floating-point CFFT/CIFFT function |
Carm_cfft_instance_q15 | Instance structure for the fixed-point CFFT/CIFFT function |
Carm_cfft_instance_q31 | Instance structure for the fixed-point CFFT/CIFFT function |
Carm_cfft_radix2_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix2_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix2_instance_q15 | Instance structure for the Q15 CFFT/CIFFT function |
Carm_cfft_radix2_instance_q31 | Instance structure for the Radix-2 Q31 CFFT/CIFFT function |
Carm_cfft_radix4_instance_f16 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix4_instance_f32 | Instance structure for the floating-point CFFT/CIFFT function |
Carm_cfft_radix4_instance_q15 | Instance structure for the Q15 CFFT/CIFFT function |
Carm_cfft_radix4_instance_q31 | Instance structure for the Q31 CFFT/CIFFT function |
Carm_dct4_instance_f32 | Instance structure for the floating-point DCT4/IDCT4 function |
Carm_dct4_instance_q15 | Instance structure for the Q15 DCT4/IDCT4 function |
Carm_dct4_instance_q31 | Instance structure for the Q31 DCT4/IDCT4 function |
Carm_fir_decimate_instance_f32 | Instance structure for floating-point FIR decimator |
Carm_fir_decimate_instance_q15 | Instance structure for the Q15 FIR decimator |
Carm_fir_decimate_instance_q31 | Instance structure for the Q31 FIR decimator |
Carm_fir_instance_f16 | Instance structure for the floating-point FIR filter |
Carm_fir_instance_f32 | Instance structure for the floating-point FIR filter |
Carm_fir_instance_f64 | Instance structure for the floating-point FIR filter |
Carm_fir_instance_q15 | Instance structure for the Q15 FIR filter |
Carm_fir_instance_q31 | Instance structure for the Q31 FIR filter |
Carm_fir_instance_q7 | Instance structure for the Q7 FIR filter |
Carm_fir_interpolate_instance_f32 | Instance structure for the floating-point FIR interpolator |
Carm_fir_interpolate_instance_q15 | Instance structure for the Q15 FIR interpolator |
Carm_fir_interpolate_instance_q31 | Instance structure for the Q31 FIR interpolator |
Carm_fir_lattice_instance_f32 | Instance structure for the floating-point FIR lattice filter |
Carm_fir_lattice_instance_q15 | Instance structure for the Q15 FIR lattice filter |
Carm_fir_lattice_instance_q31 | Instance structure for the Q31 FIR lattice filter |
Carm_fir_sparse_instance_f32 | Instance structure for the floating-point sparse FIR filter |
Carm_fir_sparse_instance_q15 | Instance structure for the Q15 sparse FIR filter |
Carm_fir_sparse_instance_q31 | Instance structure for the Q31 sparse FIR filter |
Carm_fir_sparse_instance_q7 | Instance structure for the Q7 sparse FIR filter |
Carm_gaussian_naive_bayes_instance_f16 | Instance structure for Naive Gaussian Bayesian estimator |
Carm_gaussian_naive_bayes_instance_f32 | Instance structure for Naive Gaussian Bayesian estimator |
Carm_iir_lattice_instance_f32 | Instance structure for the floating-point IIR lattice filter |
Carm_iir_lattice_instance_q15 | Instance structure for the Q15 IIR lattice filter |
Carm_iir_lattice_instance_q31 | Instance structure for the Q31 IIR lattice filter |
Carm_linear_interp_instance_f16 | Instance structure for the half floating-point Linear Interpolate function |
Carm_linear_interp_instance_f32 | Instance structure for the floating-point Linear Interpolate function |
Carm_lms_instance_f32 | Instance structure for the floating-point LMS filter |
Carm_lms_instance_q15 | Instance structure for the Q15 LMS filter |
Carm_lms_instance_q31 | Instance structure for the Q31 LMS filter |
Carm_lms_norm_instance_f32 | Instance structure for the floating-point normalized LMS filter |
Carm_lms_norm_instance_q15 | Instance structure for the Q15 normalized LMS filter |
Carm_lms_norm_instance_q31 | Instance structure for the Q31 normalized LMS filter |
Carm_matrix_instance_f16 | Instance structure for the floating-point matrix structure |
Carm_matrix_instance_f32 | Instance structure for the floating-point matrix structure |
Carm_matrix_instance_f64 | Instance structure for the floating-point matrix structure |
Carm_matrix_instance_q15 | Instance structure for the Q15 matrix structure |
Carm_matrix_instance_q31 | Instance structure for the Q31 matrix structure |
Carm_matrix_instance_q7 | Instance structure for the Q7 matrix structure |
Carm_merge_sort_instance_f32 | Instance structure for the sorting algorithms |
Carm_mfcc_instance_f16 | Instance structure for the Floating-point MFCC function |
Carm_mfcc_instance_f32 | Instance structure for the Floating-point MFCC function |
Carm_mfcc_instance_q15 | Instance structure for the Q15 MFCC function |
Carm_mfcc_instance_q31 | Instance structure for the Q31 MFCC function |
Carm_pid_instance_f32 | Instance structure for the floating-point PID Control |
Carm_pid_instance_q15 | Instance structure for the Q15 PID Control |
Carm_pid_instance_q31 | Instance structure for the Q31 PID Control |
Carm_rfft_fast_instance_f16 | Instance structure for the floating-point RFFT/RIFFT function |
Carm_rfft_fast_instance_f32 | Instance structure for the floating-point RFFT/RIFFT function |
Carm_rfft_fast_instance_f64 | Instance structure for the Double Precision Floating-point RFFT/RIFFT function |
Carm_rfft_instance_f32 | Instance structure for the floating-point RFFT/RIFFT function |
Carm_rfft_instance_q15 | Instance structure for the Q15 RFFT/RIFFT function |
Carm_rfft_instance_q31 | Instance structure for the Q31 RFFT/RIFFT function |
Carm_sort_instance_f32 | Instance structure for the sorting algorithms |
Carm_spline_instance_f32 | Instance structure for the floating-point cubic spline interpolation |
Carm_svm_linear_instance_f16 | Instance structure for linear SVM prediction function |
Carm_svm_linear_instance_f32 | Instance structure for linear SVM prediction function |
Carm_svm_polynomial_instance_f16 | Instance structure for polynomial SVM prediction function |
Carm_svm_polynomial_instance_f32 | Instance structure for polynomial SVM prediction function |
Carm_svm_rbf_instance_f16 | Instance structure for rbf SVM prediction function |
Carm_svm_rbf_instance_f32 | Instance structure for rbf SVM prediction function |
Carm_svm_sigmoid_instance_f16 | Instance structure for sigmoid SVM prediction function |
Carm_svm_sigmoid_instance_f32 | Instance structure for sigmoid SVM prediction function |
Cdefault_user_allocator_malloc_free | Malloc memory allocator |
Cfixed_storage_type< M, F, s, bool > | Storage type for a fixed point number |
Cfixed_storage_type< M, F, false > | |
Cfixed_storage_type< M, F, false, test16(M, F, 0)> | Storage type for a fixed point number representable on uint16 |
Cfixed_storage_type< M, F, false, test32(M, F, 0)> | Storage type for a fixed point number representable on uint32 |
Cfixed_storage_type< M, F, false, test64(M, F, 0)> | Storage type for a fixed point number representable on uint64 |
Cfixed_storage_type< M, F, false, test8(M, F, 0)> | Storage type for a fixed point number representable on uint8 |
Cfixed_storage_type< M, F, true > | |
Cfixed_storage_type< M, F, true, test16(M, F, 1)> | Storage type for a fixed point number representable on int16 |
Cfixed_storage_type< M, F, true, test32(M, F, 1)> | Storage type for a fixed point number representable on int32 |
Cfixed_storage_type< M, F, true, test64(M, F, 1)> | Storage type for a fixed point number representable on int64 |
Cfixed_storage_type< M, F, true, test8(M, F, 1)> | Storage type for a fixed point number representable on int8 |
CFixedCastShift< M, FD, FS, S,(FD >FS)> | Changed fractional representation of a fixed point number using a shift |
CFixedCastShift< M, FD, FS, S,(FD< FS)> | Changed fractional representation of a fixed point number using a shift |
CListElem | Simple list of elements |
Cmalloc_allocator< L > | Default memory allocator for vectors and matrixes |
CMatrixView< T, S > | Matrix |
CMatrixView< T, DYNAMIC > | Dynamic Matrix View |
CMemoryPool< BUF_SIZE, UserAllocator > | This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes |
Cnumber_traits< T > | Properties of a scalar datatype |
Cnumber_traits< double > | Features for double |
Cnumber_traits< float > | Features for float |
Cnumber_traits< float16_t > | Feature of float16 datatype |
Cnumber_traits< Q15 > | Q15 features |
Cnumber_traits< Q31 > | Features for Q31 |
Cnumber_traits< Q7 > | Q7 features |
Cnumber_traits< std::tuple< E... > > | Number description for a tuple of numbers |
CQ< M, F, S, T > | Fixed point template |
CQ15DSPVector | Representation of a vector when DSP extension supported |
CQ< M, F, false, uint16_t > | Unsigned fixed point datatypes on 16 bits |
CQ< M, F, false, uint32_t > | Unsigned fixed point datatypes on 32 bits |
CQ< M, F, false, uint64_t > | Unsigned fixed point datatypes on 64 bits |
CQ< M, F, false, uint8_t > | Unsigned fixed point datatypes on 8 bits |
CQ< M, F, true, int16_t > | Signed fixed point datatypes on 16 bits |
CQ< M, F, true, int32_t > | Signed fixed point datatypes on 32 bits |
CQ< M, F, true, int64_t > | Signed fixed point datatypes on 64 bits |
CQ< M, F, true, int8_t > | Signed fixed point datatypes on 8 bits |
►CScalar | |
CSlice | Slice |
Cuser_allocator_aligned_malloc | Memory allocation for aligned buffers |
Cvctpq< T, typename > | Predicate (only defined for vector architectures) |
Cvctpq< float > | Vctpq for this datatype |
Cvctpq< float16_t > | Vctpq for Helium and f16 |
►CVector_Base< P > | Storage for a vector |
Cvector_traits< T, arch, typename > | Properties of a vector datatype linked to a scalar datatype |
Cvector_traits< double, arch, void > | Default vector datatype description for this scalar datatype |
Cvector_traits< float, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | Vector datatype for Helium |
Cvector_traits< float, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > | Vector instructions for float when no Helium or Neon |
Cvector_traits< float16_t > | Float16 vector descrition when no vector architecture |
Cvector_traits< float16_t, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | Vector features for f16 on Helium |
Cvector_traits< Q15, arch, typename std::enable_if< std::is_base_of< Helium, arch >::value >::type > | Vector features for Q15 on Helium |
Cvector_traits< Q15, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > | Vector features for Q15 when no vector architecture |
Cvector_traits< Q15, DSP, typename std::enable_if< true >::type > | Vector description for Q15 with DSP extensions |
Cvector_traits< Q31, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > | Vector features for Q31 when no vector instructions |
Cvector_traits< Q7, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > | Vector descrition when no vector architecture |
Cvector_traits< std::tuple< E... >, arch > | Tuple of compatible vectors |
CVectorView< T, stride > | Vector view |
►CVectorView< T, 1 > | |
CVectorView< T, DYNAMIC > | Vector view with dynamic stride (not known at build time) |
Cvload1_gen_stride< S > | Load with generalized stride (gather load) |
Cvload1_gen_stride< 0, 1, 2, 3 > | Load with generalized stride specialized for <0,1,2,3> |
Cvload1_gen_stride_z< S > | Load with generalized stride (gather load) and tail predicate |
Cvload1_gen_stride_z< 0, 1, 2, 3 > | Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3> |
Cvstore1_gen_stride< S > | Generalized store with strides |
Cvstore1_gen_stride< 0, 1, 2, 3 > | Generalized store with stride (Specialized for <0,1,2,3>) |
Cvstore1_gen_stride_z< S > | Store with generalized strides and tail predicate |
Cvstore1_gen_stride_z< 0, 1, 2, 3 > | Scatter store with tail predicate (specialized for <0,1,2,3>) |
This user manual describes the CMSIS DSP software library, a suite of common compute processing functions for use on Cortex-M and Cortex-A processor based devices.
+This user manual describes the CMSIS DSP software library, a suite of common compute processing functions for use on Cortex-M and Cortex-A processor based devices.
The library is divided into a number of functions each covering a specific category:
The library has generally separate functions for operating on 8-bit integers, 16-bit integers, 32-bit integer and 32-bit floating-point values and 64-bit floating-point values.
The library is providing vectorized versions of most algorithms for Helium and of most f32 algorithms for Neon.
When using a vectorized version, provide a little bit of padding after the end of a buffer (3 words) because the vectorized code may read a little bit after the end of a buffer. You don't have to modify your buffers but just ensure that the end of buffer + padding is not outside of a memory region.
+A Python wrapper is also available with a Python API as close as possible to the C one. It can be used to start developing and testing an algorithm with NumPy and SciPy before writing the C version. Is is available on PyPI.org. It can be installed with: pip install cmsisdsp
.
This extension is a set of C++ headers. They just need to included to start using the features.
+Those headers are not yet part of the pack and you need to get them from the github repository
+More documentation about the DSP++ extension.
The library is released in source form. It is strongly advised to compile the library using -Ofast
optimization to have the best performances.
The library functions are declared in the public file Include/arm_math.h
. Simply include this file to use the CMSIS-DSP library. If you don't want to include everything, you can also rely on individual header files from the Include/dsp/
folder and include only those that are needed in the project.
See CMSIS Documentation for an overview of CMSIS software components, tools and specifications.
diff --git a/main/index.js b/main/index.js index da8fc068..74029a0b 100644 --- a/main/index.js +++ b/main/index.js @@ -1,6 +1,11 @@ var index = [ - [ "Using the Library", "index.html#using", null ], + [ "Introduction", "index.html#autotoc_md0", null ], + [ "Related projects", "index.html#autotoc_md1", [ + [ "Python wrapper", "index.html#autotoc_md2", null ], + [ "Experimental C++ template extension", "index.html#autotoc_md3", null ] + ] ], + [ "Using the CMSIS-DSP Library", "index.html#using", null ], [ "Examples", "index.html#example", null ], [ "Toolchain Support", "index.html#toolchain", null ], [ "Access to CMSIS-DSP", "index.html#pack", null ], diff --git a/main/matrix_8hpp.html b/main/matrix_8hpp.html new file mode 100644 index 00000000..a9e209e0 --- /dev/null +++ b/main/matrix_8hpp.html @@ -0,0 +1,188 @@ + + + + + + + +#include <memory>
#include <cstring>
#include <algorithm>
#include <iostream>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "unroll.hpp"
#include "algorithms.hpp"
#include "vec.hpp"
#include "matrix_impl.hpp"
#include "matrix_view.hpp"
+Data Structures | |
struct | _Outer< LHS, RHS, DerivedOp > |
Outer product operator for expressions. More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Functions | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >(), bool >::type = true> | |
auto | outer (const VA &a, const VB &b) |
Outer product. | |
#include <memory>
#include <cstring>
#include <algorithm>
#include <iostream>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "unroll.hpp"
#include "algorithms.hpp"
#include "vec.hpp"
+Data Structures | |
struct | Slice |
Slice. More... | |
struct | Matrix< P, R, C, Allocator > |
Matrix. More... | |
struct | Matrix< P, DYNAMIC, DYNAMIC, Allocator > |
Matrix. More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Functions | |
template<typename MA , typename MB , typename RES , typename std::enable_if< number_traits< typename traits< MA >::Scalar >::is_float, bool >::type = true> | |
__STATIC_INLINE void | _dot_m_m (const MA &pSrcA, const MB &pSrcB, RES &&pDst, const Scalar *=nullptr) |
Matrix times matrix for scalar architecture and float. | |
#include <memory>
#include <cstring>
#include <algorithm>
#include <iostream>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "unroll.hpp"
#include "algorithms.hpp"
#include "vec.hpp"
#include "matrix_impl.hpp"
+Data Structures | |
struct | MatrixView< T, S > |
Matrix. More... | |
struct | MatrixView< T, DYNAMIC > |
Dynamic Matrix View. More... | |
struct | MatrixView< T, CONSTRAINED_DYNAMIC > |
Dynamic Matrix View. More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Data Structures | |
struct | default_user_allocator_malloc_free |
Malloc memory allocator. More... | |
struct | user_allocator_aligned_malloc |
Memory allocation for aligned buffers. More... | |
struct | malloc_allocator< L > |
Default memory allocator for vectors and matrixes. More... | |
struct | ListElem |
Simple list of elements. More... | |
class | MemoryPool< BUF_SIZE, UserAllocator > |
This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes. More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
+Functions | |
void * | aligned_malloc (std::size_t alignment, std::size_t size) |
Aligned memory allocation. | |
void | aligned_free (void *ptr) |
Free an aligned buffer. | |
►Examples | |
►C++ extension |
+Data Structures | |
struct | _Binary |
Expression for binary operator. More... | |
struct | _Expr |
Expression template. More... | |
struct | _Outer |
Outer product operator for expressions. More... | |
struct | _Unary |
Expression for unary operator. More... | |
struct | Accumulate |
Accumulation without saturation. More... | |
struct | Accumulate< MD, MS, F, S, true > |
Accumulation without saturation. More... | |
struct | default_user_allocator_malloc_free |
Malloc memory allocator. More... | |
class | DSP |
struct | fixed_storage_type |
Storage type for a fixed point number. More... | |
struct | fixed_storage_type< M, F, false, test16(M, F, 0)> |
Storage type for a fixed point number representable on uint16. More... | |
struct | fixed_storage_type< M, F, false, test32(M, F, 0)> |
Storage type for a fixed point number representable on uint32. More... | |
struct | fixed_storage_type< M, F, false, test64(M, F, 0)> |
Storage type for a fixed point number representable on uint64. More... | |
struct | fixed_storage_type< M, F, false, test8(M, F, 0)> |
Storage type for a fixed point number representable on uint8. More... | |
struct | fixed_storage_type< M, F, true, test16(M, F, 1)> |
Storage type for a fixed point number representable on int16. More... | |
struct | fixed_storage_type< M, F, true, test32(M, F, 1)> |
Storage type for a fixed point number representable on int32. More... | |
struct | fixed_storage_type< M, F, true, test64(M, F, 1)> |
Storage type for a fixed point number representable on int64. More... | |
struct | fixed_storage_type< M, F, true, test8(M, F, 1)> |
Storage type for a fixed point number representable on int8. More... | |
struct | FixedCastShift< M, FD, FS, S,(FD >FS)> |
Changed fractional representation of a fixed point number using a shift. More... | |
struct | FixedCastShift< M, FD, FS, S,(FD< FS)> |
Changed fractional representation of a fixed point number using a shift. More... | |
class | Helium |
class | Helium82 |
struct | ListElem |
Simple list of elements. More... | |
struct | malloc_allocator |
Default memory allocator for vectors and matrixes. More... | |
struct | Matrix |
Matrix. More... | |
struct | Matrix< P, DYNAMIC, DYNAMIC, Allocator > |
Matrix. More... | |
struct | MatrixView |
Matrix. More... | |
struct | MatrixView< T, CONSTRAINED_DYNAMIC > |
Dynamic Matrix View. More... | |
struct | MatrixView< T, DYNAMIC > |
Dynamic Matrix View. More... | |
class | MemoryPool |
This class describes a memory pool that can be used to build a memory allocator for vectors and matrixes. More... | |
class | Neon |
struct | number_traits |
Properties of a scalar datatype. More... | |
struct | Q |
Fixed point template. More... | |
struct | Q< M, F, false, uint16_t > |
Unsigned fixed point datatypes on 16 bits. More... | |
struct | Q< M, F, false, uint32_t > |
Unsigned fixed point datatypes on 32 bits. More... | |
struct | Q< M, F, false, uint64_t > |
Unsigned fixed point datatypes on 64 bits. More... | |
struct | Q< M, F, false, uint8_t > |
Unsigned fixed point datatypes on 8 bits. More... | |
struct | Q< M, F, true, int16_t > |
Signed fixed point datatypes on 16 bits. More... | |
struct | Q< M, F, true, int32_t > |
Signed fixed point datatypes on 32 bits. More... | |
struct | Q< M, F, true, int64_t > |
Signed fixed point datatypes on 64 bits. More... | |
struct | Q< M, F, true, int8_t > |
Signed fixed point datatypes on 8 bits. More... | |
class | Scalar |
struct | Slice |
Slice. More... | |
struct | user_allocator_aligned_malloc |
Memory allocation for aligned buffers. More... | |
struct | Vector |
Vector template for size knonw at build time. More... | |
struct | Vector< P, DYNAMIC, Allocator > |
Vector template for dynamic vector (size known at runtime) More... | |
struct | Vector_Base |
Storage for a vector. More... | |
struct | vector_traits |
Properties of a vector datatype linked to a scalar datatype. More... | |
struct | VectorView |
Vector view. More... | |
struct | VectorView< T, DYNAMIC > |
Vector view with dynamic stride (not known at build time) More... | |
+Typedefs | |
+typedef int32_t | index_t |
index datatype. It must be a signed datatype | |
+typedef int32_t | vector_length_t |
Vector length datatype. Iy must be a signed datatype. | |
+using | Q63 = Q< 0, 63 > |
Q63 datatype. | |
+using | Q31 = Q< 0, 31 > |
Q31 datatype. | |
+using | Q15 = Q< 0, 15 > |
Q15 datatype. | |
+using | Q7 = Q< 0, 7 > |
Q7 datatype. | |
+Functions | |
template<typename MA , typename MB , typename std::enable_if< HasMatrixIndexing< MA >::value &&HasMatrixIndexing< MB >::value, bool >::type = true> | |
void | transposeTo (MA &dst, const MB &src) |
Transpose a matrix. | |
template<typename M , typename V , typename std::enable_if< CompatibleStaticMatVecProduct< M, V >::value, bool >::type = true> | |
OutputVector< M, V >::type | dot (const M &m, const V &v) |
Matrix x Vector product. | |
template<typename MA , typename MB , typename std::enable_if< CompatibleStaticMatMatProduct< MA, MB >::value &&number_traits< typename traits< MA >::Scalar >::is_fixed, bool >::type = true> | |
OutputMatrix< MA, MB >::type | dot (const MA &ma, const MB &mb) |
Matrix x Matrix product. | |
template<typename MA , typename MB , typename RES , typename std::enable_if< CompatibleDynamicMatMatProduct< MA, MB >::value &&number_traits< typename traits< MA >::Scalar >::is_float, bool >::type = true> | |
void | dot (RES &&res, const MA &ma, const MB &mb) |
Matrix x Matrix product. | |
template<typename P > | |
Matrix< P, DYNAMIC, DYNAMIC, TMP_ALLOC > | mk_identity (const vector_length_t l) |
Create identity matrix. | |
template<typename P , int L> | |
Matrix< P, L, L, TMP_ALLOC > | mk_identity () |
Create identity matrix. | |
template<typename T > | |
void | PrintType (void) |
Prints a textual representation of a type. | |
constexpr bool | test64 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 64 bits. | |
constexpr bool | test32 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 32 bits. | |
constexpr bool | test16 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 16 bits. | |
constexpr bool | test8 (const int M, const int F, const int S) |
Function to identify the template for fixed number representable on 8 bits. | |
constexpr Q63 | operator""_q63 (long double x) |
q63 literal | |
constexpr Q31 | operator""_q31 (long double x) |
q31 literal | |
constexpr Q15 | operator""_q15 (long double x) |
q15 literal | |
constexpr Q7 | operator""_q7 (long double x) |
q7 literal | |
template<int MA, int FA, int MB, int FB, bool SA, bool SB> | |
Q< MA+MB+1, FA+FB, SA||SB > | mult (const Q< MA, FA, SA > &a, const Q< MB, FB, SB > &b) |
Multiplication of two fixed point numbers A and B. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator+ (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Add two fixed point numbers with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator- (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Subtract two fixed point numbers with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator- (const Q< M, F, S > &a) |
Negate a fixed point number with saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | add (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Add two fixed point numbers without saturation. | |
template<int M, int F, bool S> | |
Q< M, F, S > | sub (const Q< M, F, S > &a, const Q< M, F, S > &b) |
Subtract two fixed point numbers without saturation. | |
template<int M, int F, int N, bool S> | |
Q< M, F, S > | operator>> (const Q< M, F, S > &a, std::integral_constant< int, N >) noexcept |
Shift right a fixed point number with a shift known at build time. | |
template<int M, int F, int N, bool S> | |
Q< M+N, F, S > | operator<< (const Q< M, F, S > &a, std::integral_constant< int, N >) noexcept |
Shift left a fixed point number with a shift known at build time. | |
template<int MD = 0, int MS, int F> | |
Q< MD, F, true > | saturate (const Q< MS, F, true > &src, typename std::enable_if<(MD< MS) &&((MD+F)< 31)>::type *=nullptr) |
Saturate a signed fixed point number. | |
template<int MD = 0, int MS, int F> | |
Q< MD, F, false > | saturate (const Q< MS, F, false > &src, typename std::enable_if<(MD< MS) &&((MD+F)< 31)>::type *=nullptr) |
Saturate an unsigned fixed point number. | |
template<int FD, int M, int FS, bool S> | |
Q< M, FD, S > | toFrac (const Q< M, FS, S > &src) |
Convert between different fractional part formats. | |
template<int MD, int MS, int F, bool S> | |
Q< MD, F, S > | accumulate (const Q< MD, F, S > &a, const Q< MS, F, S > &b) |
Accumulate without saturation. | |
Q7 | operator* (const Q7 &a, const Q7 &b) |
Multiplication operator. | |
Q15 | operator* (const Q15 &a, const Q15 &b) |
Multiplication operator. | |
Q31 | operator* (const Q31 &a, const Q31 &b) |
Multiplication operator. | |
template<int M, int F> | |
bool | operator> (const Q< M, F > &a, const Q< M, F > &b) |
Greater-than comparison operator. | |
template<int M, int F> | |
bool | operator< (const Q< M, F > &a, const Q< M, F > &b) |
Less-than comparison operator. | |
template<int M, int F> | |
bool | operator>= (const Q< M, F > &a, const Q< M, F > &b) |
Greater-than-or-equal comparison operator. | |
template<int M, int F> | |
bool | operator<= (const Q< M, F > &a, const Q< M, F > &b) |
Less-than-or-equal comparison operator. | |
template<int M, int F> | |
bool | operator== (const Q< M, F > a, const Q< M, F > b) |
Equality operator. | |
template<int M, int F> | |
bool | operator!= (const Q< M, F > a, const Q< M, F > b) |
Inequality operator. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator/ (const Q< M, F, S > a, const int32_t b) |
Division operator. | |
template<int M, int F, bool S> | |
Q< M, F, S > | operator+ (const Q< M, F, S > &a) |
No op operator. | |
template<typename DA > | |
constexpr bool | has_vector_inst () |
Determines if vector datatype supports vector instruction on a current architecture. | |
template<typename DA > | |
constexpr bool | has_predicate_inst () |
Determines if datatype has predicated loop for current architecture. | |
template<typename DA > | |
constexpr bool | is_scalar () |
Determines if scalar datatype (not vector, vectorview, matrix, matrixview) | |
template<typename DA > | |
constexpr bool | must_use_matrix_idx () |
Check if datatype can only be used as a matrix (no vector addressing) | |
template<typename DA , typename DB > | |
constexpr bool | vector_idx_pair () |
Check if both datatype have vector indexing are same scalar datatype. | |
template<typename DA > | |
constexpr bool | is_only_vector () |
Check if has vector indexing. | |
template<typename DA , typename DB > | |
constexpr bool | must_use_matrix_idx_pair () |
Check if datatypes have same scalar datatype and no vector indexing. | |
template<typename DA , typename DB > | |
constexpr vector_length_t | static_length () |
Static length. | |
template<typename DA , typename DB > | |
constexpr bool | same_static_length () |
Check compatibility of length. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >() &&is_only_vector< VA >() &&is_only_vector< VB >() &&(!IsDynamic< VA >::value||!IsDynamic< VB >::value), bool >::type = true> | |
DotResult< VA > | dot (const VA &a, const VB &b) |
Dot product. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >() &&(!IsDynamic< VA >::value||!IsDynamic< VB >::value), bool >::type = true> | |
void | swap (VA &&a, VB &&b) |
Swap vectors. | |
template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >(), bool >::type = true> | |
auto | outer (const VA &a, const VB &b) |
Outer product. | |
void * | aligned_malloc (std::size_t alignment, std::size_t size) |
Aligned memory allocation. | |
void | aligned_free (void *ptr) |
Free an aligned buffer. | |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator+ (const LHS &a, const RHS &b) |
Addition operator for expressions. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | operator+ (const LHS &a) |
| |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | expr (const LHS &a) |
Identity operator for expression. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | copy (const LHS &a) |
Identity operator for expression. | |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator- (const LHS &a, const RHS &b) |
Subtraction operator for expressions. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | operator- (const LHS &a) |
| |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator* (const LHS &a, const RHS &b) |
Element wise multiplication operator for expressions. | |
In this file we have kernels that are written in an architecture independant way (using operators of the library)
++Data Structures | |
struct | vctpq< float > |
vctpq for this datatype More... | |
struct | vctpq< float16_t > |
vctpq for Helium and f16 More... | |
struct | vload1_gen_stride |
Load with generalized stride (gather load) More... | |
struct | vload1_gen_stride< 0, 1, 2, 3 > |
Load with generalized stride specialized for <0,1,2,3> More... | |
struct | vload1_gen_stride_z |
Load with generalized stride (gather load) and tail predicate. More... | |
struct | vload1_gen_stride_z< 0, 1, 2, 3 > |
Load with generalized stride (gather load) and tail predicate specialized for <0,1,2,3> More... | |
struct | vstore1_gen_stride |
Generalized store with strides. More... | |
struct | vstore1_gen_stride< 0, 1, 2, 3 > |
Generalized store with stride (Specialized for <0,1,2,3>) More... | |
struct | vstore1_gen_stride_z |
Store with generalized strides and tail predicate. More... | |
struct | vstore1_gen_stride_z< 0, 1, 2, 3 > |
Scatter store with tail predicate (specialized for <0,1,2,3>) More... | |
+Functions | |
Q15DSPVector | vconst (Q15 val) |
Vector const. | |
Q< 33, 30 > | vreduce (const Q< 33, 30 > sum) |
Reduce accumulation value. | |
float32x4_t | vconst (const float v) |
Vector constant. | |
float32x4_t | vconst_tail (const float v, const mve_pred16_t p0) |
Vector constant with tail. | |
float32x4_t | vneg (const float32x4_t a) |
Vector negate. | |
float32x4_t | vneg (const float32x4_t a, const mve_pred16_t p0) |
Vector negate with tail. | |
float32x4_t | vadd (const float32x4_t a, const float32x4_t b) |
Vector + Vector. | |
float32x4_t | vadd (const float32x4_t a, const float b) |
Vector + Scalar. | |
float32x4_t | vadd (const float a, const float32x4_t b) |
Scalar + Vector. | |
float32x4_t | vadd (const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Vector + Vector with tail. | |
float32x4_t | vadd (const float32x4_t a, const float b, const mve_pred16_t p0) |
Vector + scalar with tail. | |
float32x4_t | vadd (const float a, const float32x4_t b, const mve_pred16_t p0) |
Scalar + vector with tail predicate. | |
float32x4_t | vsub (const float32x4_t a, const float32x4_t b) |
Vector - Vector. | |
float32x4_t | vsub (const float32x4_t a, const float b) |
Vector - Scalar. | |
float32x4_t | vsub (const float a, const float32x4_t b) |
Scalar - Vector. | |
float32x4_t | vsub (const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Vector - Vector with predicate. | |
float32x4_t | vsub (const float32x4_t a, const float b, const mve_pred16_t p0) |
Vector - Scalar with predicate. | |
float32x4_t | vsub (const float a, const float32x4_t b, const mve_pred16_t p0) |
Scalar - Vector with predicate. | |
float32x4_t | vmul (const float32x4_t a, const float32x4_t b) |
Vector * Vector. | |
float32x4_t | vmul (const float32x4_t a, const float b) |
Vector * Scalar. | |
float32x4_t | vmul (const float a, const float32x4_t b) |
Scalar * Vector. | |
float32x4_t | vmul (const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Vector * Vector with predicate. | |
float32x4_t | vmul (const float32x4_t a, const float b, const mve_pred16_t p0) |
Vector * Scalar with predicate. | |
float32x4_t | vmul (const float a, const float32x4_t b, const mve_pred16_t p0) |
Scalar * Vector with predicate. | |
float32x4_t | vmacc (const float32x4_t acc, const float32x4_t a, const float32x4_t b) |
Multiply accumulate (Vector * Vector) | |
float32x4_t | vmacc (const float32x4_t acc, const float32x4_t a, const float_t b) |
Multiply accumulate (Vector * Scalar) | |
float32x4_t | vmacc (const float32x4_t acc, const float32x4_t a, const float32x4_t b, const mve_pred16_t p0) |
Multiply accumulate with predicate (Vector * Vector) | |
float | vreduce (const float32x4_t in) |
Vector reduce. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
float32x4_t | vload1 (const float32_t *p) |
Vector load with stride. | |
float32x4_t | vload1 (const float32_t *p, const index_t stride) |
Vector load with dynamic stride. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
float32x4_t | vload1_z (const float32_t *p, const std::size_t nb, const mve_pred16_t p0) |
Vector load with stride and predicate. | |
float32x4_t | vload1_z (const float32_t *p, const index_t stride, const std::size_t nb, const mve_pred16_t p0) |
Vector load with dynamic stride and loop predication. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
void | vstore1 (float32_t *p, const float32x4_t val) |
Store with stride. | |
void | vstore1 (float32_t *p, const index_t stride, const float32x4_t val) |
Store with dynamic stride. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
void | vstore1_z (float32_t *p, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Store with stride and tail predicate. | |
void | vstore1_z (float32_t *p, const index_t stride, const float32x4_t val, const std::size_t nb, const mve_pred16_t p0) |
Store with dynamic stride. | |
float16x8_t | vconst (float16_t v) |
Vector const. | |
float16x8_t | vconst_tail (const float16_t v, const mve_pred16_t p0) |
Vector of const with tail predicate. | |
float16x8_t | vneg (const float16x8_t a) |
Vector negate. | |
float16x8_t | vneg (const float16x8_t a, const mve_pred16_t p0) |
Vector negate with tail predicate. | |
float16x8_t | vadd (const float16x8_t a, const float16x8_t b) |
Vector + Vector. | |
float16x8_t | vadd (const float16x8_t a, const float16_t b) |
Vector + Scalar. | |
float16x8_t | vadd (const float16_t a, const float16x8_t b) |
Scalar + Vector. | |
float16x8_t | vadd (const float16x8_t a, const float16x8_t b, const mve_pred16_t p0) |
Vector + Vector with tail predicate. | |
float16x8_t | vadd (const float16x8_t a, const float16_t b, const mve_pred16_t p0) |
Vector + Scalar with tail predicate. | |
float16x8_t | vadd (const float16_t a, const float16x8_t b, const mve_pred16_t p0) |
Scalar + Vector with tail predicate. | |
template<int S, typename std::enable_if< S==1, bool >::type = true> | |
int16x8_t | vload1 (const Q15 *p) |
Vector load with stride. | |
Q< 33, 30 > | vmacc (const Q< 33, 30 > sum, const int16x8_t vala, const int16x8_t valb) |
Vector accumulate into scalar. | |
double | from_accumulator (const double a) |
Convert from accumulator representation. | |
double | mac (const double acc, const double a, const double b) |
Multiply and accumulate for this datatype. | |
void | accumulate (double &a, const double &b) |
Accumulate. | |
double | mult (double &a, const double &b) |
Multiply. | |
float | from_accumulator (const float a) |
Convert from accumulator representtaion. | |
float | mac (const float acc, const float a, const float b) |
Scalar multiply and accumulate. | |
void | accumulate (float &a, const float &b) |
Scalar accumulate. | |
float | mult (float &a, const float &b) |
Scalar multiply. | |
template<typename A , typename V , std::size_t... Ns> | |
A | vmacc_impl (const A &acc, const V &a, const V &b, std::index_sequence< Ns... >) |
Vector accumulate for tuples of vectors. | |
template<typename A , typename ... E> | |
A | vmacc (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b) |
Vector accumulate for tuples of vectors. | |
template<typename A , typename V , typename B , std::size_t... Ns> | |
A | vmacc_impl (const A &acc, const V &a, const V &b, const B p0, std::index_sequence< Ns... >) |
Predicated vector accumulate for tuple. | |
template<typename A , typename B , typename ... E> | |
A | vmacc (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b, const B p0) |
Predicated vector accumulate for tuples. | |
template<typename A , std::size_t... Ns> | |
auto | vreduce_impl (const A &acc, std::index_sequence< Ns... >) |
Reduce function for tuple. | |
template<typename ... E> | |
auto | vreduce (const std::tuple< E... > &acc) |
Reduce function for tuples. | |
template<typename A , std::size_t... Ns> | |
auto | from_accumulator_impl (const A &acc, std::index_sequence< Ns... >) |
Convert from accumulator value. | |
template<typename ... E> | |
auto | from_accumulator (const std::tuple< E... > &acc) |
Convert from tuple of accumulator values. | |
template<typename A , typename V , std::size_t... Ns> | |
A | mac_impl (const A &acc, const V &a, const V &b, std::index_sequence< Ns... >) |
Multiply accumulate for tuple of scalar. | |
template<typename A , typename ... E> | |
A | mac (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b) |
Multiply accumulate. | |
template<typename A , typename V , typename B , std::size_t... Ns> | |
A | mac_impl (const A &acc, const V &a, const V &b, const B p0, std::index_sequence< Ns... >) |
Multiply accumulate for tuple of scalar. | |
template<typename A , typename B , typename ... E> | |
A | mac (const A &acc, const std::tuple< E... > &a, const std::tuple< E... > &b, const B p0) |
Multiply accumulate. | |
float16_t | from_accumulator (const float16_t a) |
Convert from accumulator datatype. | |
float16_t | mac (const float16_t acc, const float16_t a, const float16_t b) |
Multiply and accumulate. | |
void | accumulate (float16_t &a, const float16_t &b) |
Accumulate. | |
float16_t | mult (float16_t &a, const float16_t &b) |
Multiply. | |
Q15 | from_accumulator (const Q< 33, 30 > a) |
Convert from accumulator type. | |
Q< 33, 30 > | mac (const Q< 33, 30 > acc, const Q15 a, const Q15 b) |
Multiply and accumulate. | |
Q31 | from_accumulator (const Q< 15, 48 > a) |
Convert from accumulator (with no saturation) | |
Q< 15, 48 > | mac (const Q< 15, 48 > acc, const Q31 a, const Q31 b) |
Multiply and accumulate. | |
Q7 | from_accumulator (const Q< 17, 14 > a) |
Convert from accumulator with saturation. | |
Q< 17, 14 > | mac (const Q< 17, 14 > acc, const Q7 a, const Q7 b) |
Multiply and accumulate. | |
Inner implementation of Helium intrinsics
+Inner implementation of generic intrinsics
+void accumulate | +( | +double & | +a, | +
+ | + | const double & | +b | +
+ | ) | ++ |
Accumulate.
+a | Accumulator | |
[in] | b | VAlue to be added |
void accumulate | +( | +float & | +a, | +
+ | + | const float & | +b | +
+ | ) | ++ |
Scalar accumulate.
+a | Accumulator | |
[in] | b | Operand |
void accumulate | +( | +float16_t & | +a, | +
+ | + | const float16_t & | +b | +
+ | ) | ++ |
Accumulate.
+a | Accumulator | |
[in] | b | Value to accumulate |
double from_accumulator | +( | +const double | +a | ) | ++ |
Convert from accumulator representation.
+[in] | a | Value |
float from_accumulator | +( | +const float | +a | ) | ++ |
Convert from accumulator representtaion.
+[in] | a | Value |
float16_t from_accumulator | +( | +const float16_t | +a | ) | ++ |
Convert from accumulator datatype.
+[in] | a | Value |
Q31 from_accumulator | +( | +const Q< 15, 48 > | +a | ) | ++ |
Convert from accumulator (with no saturation)
+[in] | a | Accumulator value |
Q7 from_accumulator | +( | +const Q< 17, 14 > | +a | ) | ++ |
Convert from accumulator with saturation.
+[in] | a | Accumulator value |
Q15 from_accumulator | +( | +const Q< 33, 30 > | +a | ) | ++ |
Convert from accumulator type.
+[in] | a | The accumulator value |
auto from_accumulator | +( | +const std::tuple< E... > & | +acc | ) | ++ |
Convert from tuple of accumulator values.
+[in] | acc | Accumulator |
E | Datatypes for tuple |
Accumulator may use more bits to avoid saturations. At the end of the accumulation, the final result must be converted to the current datatype (it may implies saturation)
+ +auto from_accumulator_impl | +( | +const A & | +acc, | +
+ | + | std::index_sequence< Ns... > | ++ |
+ | ) | ++ |
Convert from accumulator value.
+[in] | acc | The accumulator |
A | Accumulator datatype |
Ns | Tuples indexes |
A mac | +( | +const A & | +acc, | +
+ | + | const std::tuple< E... > & | +a, | +
+ | + | const std::tuple< E... > & | +b | +
+ | ) | ++ |
Multiply accumulate.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
A | Accumulator datatype |
E | Datatypes for tuple |
A mac | +( | +const A & | +acc, | +
+ | + | const std::tuple< E... > & | +a, | +
+ | + | const std::tuple< E... > & | +b, | +
+ | + | const B | +p0 | +
+ | ) | ++ |
Multiply accumulate.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
[in] | p0 | Predicate |
A | Accumulator datatype |
B | Predicate datatype |
E | Datatypes for tuple |
double mac | +( | +const double | +acc, | +
+ | + | const double | +a, | +
+ | + | const double | +b | +
+ | ) | ++ |
Multiply and accumulate for this datatype.
+[in] | acc | The accumulated value |
[in] | a | The left hand side |
[in] | b | The right hand side |
float mac | +( | +const float | +acc, | +
+ | + | const float | +a, | +
+ | + | const float | +b | +
+ | ) | ++ |
Scalar multiply and accumulate.
+[in] | acc | Accumulator |
[in] | a | Operand |
[in] | b | Operand |
float16_t mac | +( | +const float16_t | +acc, | +
+ | + | const float16_t | +a, | +
+ | + | const float16_t | +b | +
+ | ) | ++ |
Multiply and accumulate.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
Q< 15, 48 > mac | +( | +const Q< 15, 48 > | +acc, | +
+ | + | const Q31 | +a, | +
+ | + | const Q31 | +b | +
+ | ) | ++ |
Multiply and accumulate.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
Q< 17, 14 > mac | +( | +const Q< 17, 14 > | +acc, | +
+ | + | const Q7 | +a, | +
+ | + | const Q7 | +b | +
+ | ) | ++ |
Multiply and accumulate.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
Q< 33, 30 > mac | +( | +const Q< 33, 30 > | +acc, | +
+ | + | const Q15 | +a, | +
+ | + | const Q15 | +b | +
+ | ) | ++ |
Multiply and accumulate.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
A mac_impl | +( | +const A & | +acc, | +
+ | + | const V & | +a, | +
+ | + | const V & | +b, | +
+ | + | const B | +p0, | +
+ | + | std::index_sequence< Ns... > | ++ |
+ | ) | ++ |
Multiply accumulate for tuple of scalar.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
[in] | p0 | Predicate |
A | Accumulator datatype |
V | Scalar datatype |
B | Predicate datatype |
Ns | Tuple indexes |
A mac_impl | +( | +const A & | +acc, | +
+ | + | const V & | +a, | +
+ | + | const V & | +b, | +
+ | + | std::index_sequence< Ns... > | ++ |
+ | ) | ++ |
Multiply accumulate for tuple of scalar.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
A | Accumulator datatype |
V | Scalar datatype |
Ns | Tuple indexes |
double mult | +( | +double & | +a, | +
+ | + | const double & | +b | +
+ | ) | ++ |
Multiply.
+a | Left hand side | |
[in] | b | Right hand side |
float mult | +( | +float & | +a, | +
+ | + | const float & | +b | +
+ | ) | ++ |
Scalar multiply.
+a | Operand | |
[in] | b | Operand |
float16_t mult | +( | +float16_t & | +a, | +
+ | + | const float16_t & | +b | +
+ | ) | ++ |
Multiply.
+a | First operand | |
[in] | b | Second operand |
float32x4_t vadd | +( | +const float | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Scalar + Vector.
+[in] | a | Scalar |
[in] | b | Vector |
float32x4_t vadd | +( | +const float | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Scalar + vector with tail predicate.
+[in] | a | Scalar |
[in] | b | Vector |
[in] | p0 | Predicate |
float16x8_t vadd | +( | +const float16_t | +a, | +
+ | + | const float16x8_t | +b | +
+ | ) | ++ |
Scalar + Vector.
+[in] | a | Scalar |
[in] | b | Vector |
float16x8_t vadd | +( | +const float16_t | +a, | +
+ | + | const float16x8_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Scalar + Vector with tail predicate.
+[in] | a | Scalar |
[in] | b | Vector |
[in] | p0 | Predicate |
float16x8_t vadd | +( | +const float16x8_t | +a, | +
+ | + | const float16_t | +b | +
+ | ) | ++ |
Vector + Scalar.
+[in] | a | Vector |
[in] | b | Scalar |
float16x8_t vadd | +( | +const float16x8_t | +a, | +
+ | + | const float16_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector + Scalar with tail predicate.
+[in] | a | Vector |
[in] | b | Scalar |
[in] | p0 | Predicate |
float16x8_t vadd | +( | +const float16x8_t | +a, | +
+ | + | const float16x8_t | +b | +
+ | ) | ++ |
Vector + Vector.
+[in] | a | Vector |
[in] | b | Vector |
float16x8_t vadd | +( | +const float16x8_t | +a, | +
+ | + | const float16x8_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector + Vector with tail predicate.
+[in] | a | Vector |
[in] | b | Vector |
[in] | p0 | predicate |
float32x4_t vadd | +( | +const float32x4_t | +a, | +
+ | + | const float | +b | +
+ | ) | ++ |
Vector + Scalar.
+[in] | a | Vector |
[in] | b | Scalar |
float32x4_t vadd | +( | +const float32x4_t | +a, | +
+ | + | const float | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector + scalar with tail.
+[in] | a | Vector |
[in] | b | Scalar |
[in] | p0 | Predicate |
float32x4_t vadd | +( | +const float32x4_t | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Vector + Vector.
+[in] | a | First operand |
[in] | b | Second operand |
float32x4_t vadd | +( | +const float32x4_t | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector + Vector with tail.
+[in] | a | Vector |
[in] | b | Vector |
[in] | p0 | Predicated |
float32x4_t vconst | +( | +const float | +v | ) | ++ |
Vector constant.
+[in] | v | Constant value |
float16x8_t vconst | +( | +float16_t | +v | ) | ++ |
Vector const.
+[in] | v | Initialization value |
int16x8_t vconst | +( | +Q15 | +val | ) | ++ |
Vector const.
+[in] | val | The value |
float32x4_t vconst_tail | +( | +const float | +v, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector constant with tail.
+[in] | v | Constant value |
[in] | p0 | Prddicate |
float16x8_t vconst_tail | +( | +const float16_t | +v, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector of const with tail predicate.
+[in] | v | The initialization parameter |
[in] | p0 | The predicate |
+
|
+ +inline | +
Vector load with stride.
+[in] | p | Load address |
S | Stride |
<unnamed> | Check stride value |
+
|
+ +inline | +
Vector load with dynamic stride.
+[in] | p | Load address |
[in] | stride | Stride value |
+
|
+ +inline | +
Vector load with stride.
+[in] | p | Load address |
S | Stride |
<unnamed> | Stride check |
In q15, a lane is on 16 bits. So the offset that can be encoded for gather load cannot be bigger than 65535. With a stride of S, the bigger offset is S*7. So S must be <= 65535/7 S <= 9362
+For higher stride, the Helium instruction cannot be used and instead a dynamic stride is used.
+ +
+
|
+ +inline | +
Vector load with dynamic stride and loop predication.
+[in] | p | Load address |
[in] | stride | Stride value |
[in] | nb | Number of remaining loop samples |
[in] | p0 | Predicate for remaining loop samples |
+
|
+ +inline | +
Vector load with stride and predicate.
+[in] | p | Load address |
[in] | nb | Number of remaining loop samples |
[in] | p0 | Predicate for remaining loop samples |
S | Stride |
<unnamed> | Check stride value |
A vmacc | +( | +const A & | +acc, | +
+ | + | const std::tuple< E... > & | +a, | +
+ | + | const std::tuple< E... > & | +b | +
+ | ) | ++ |
Vector accumulate for tuples of vectors.
+[in] | acc | The accumulator |
[in] | a | First operand |
[in] | b | Second operand |
A | Accumulator datatype |
E | Datatype of tuples elements |
A vmacc | +( | +const A & | +acc, | +
+ | + | const std::tuple< E... > & | +a, | +
+ | + | const std::tuple< E... > & | +b, | +
+ | + | const B | +p0 | +
+ | ) | ++ |
Predicated vector accumulate for tuples.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
[in] | p0 | Predicate |
A | Accumulator datatype |
B | Predicate datatype |
E | Dadatype of tuples elements |
float32x4_t vmacc | +( | +const float32x4_t | +acc, | +
+ | + | const float32x4_t | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Multiply accumulate (Vector * Vector)
+[in] | acc | Accumulator |
[in] | a | Vector |
[in] | b | Vector |
float32x4_t vmacc | +( | +const float32x4_t | +acc, | +
+ | + | const float32x4_t | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Multiply accumulate with predicate (Vector * Vector)
+[in] | acc | Accumulator |
[in] | a | Vector |
[in] | b | Vector |
[in] | p0 | Predicate |
float32x4_t vmacc | +( | +const float32x4_t | +acc, | +
+ | + | const float32x4_t | +a, | +
+ | + | const float_t | +b | +
+ | ) | ++ |
Multiply accumulate (Vector * Scalar)
+[in] | acc | Accumulator |
[in] | a | Vector |
[in] | b | Scalar |
Q< 33, 30 > vmacc | +( | +const Q< 33, 30 > | +sum, | +
+ | + | const int16x8_t | +vala, | +
+ | + | const int16x8_t | +valb | +
+ | ) | ++ |
Vector accumulate into scalar.
+[in] | sum | The sum |
[in] | vala | The vala |
[in] | valb | The valb |
A vmacc_impl | +( | +const A & | +acc, | +
+ | + | const V & | +a, | +
+ | + | const V & | +b, | +
+ | + | const B | +p0, | +
+ | + | std::index_sequence< Ns... > | ++ |
+ | ) | ++ |
Predicated vector accumulate for tuple.
+[in] | acc | Accumulator |
[in] | a | First operand |
[in] | b | Second operand |
[in] | p0 | Predicate |
A | Accumulator datatype |
V | Vector datatype |
B | Predicate datatype |
Ns | Tuple indexes |
A vmacc_impl | +( | +const A & | +acc, | +
+ | + | const V & | +a, | +
+ | + | const V & | +b, | +
+ | + | std::index_sequence< Ns... > | ++ |
+ | ) | ++ |
Vector accumulate for tuples of vectors.
+[in] | acc | The accumulator |
[in] | a | First operand |
[in] | b | Second operand |
A | Accumulator datatype |
V | Vector datatype |
Ns | Tuple index |
float32x4_t vmul | +( | +const float | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Scalar * Vector.
+[in] | a | Scalar |
[in] | b | Vector |
float32x4_t vmul | +( | +const float | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Scalar * Vector with predicate.
+[in] | a | Scalar |
[in] | b | Vector |
[in] | p0 | Predicate |
float32x4_t vmul | +( | +const float32x4_t | +a, | +
+ | + | const float | +b | +
+ | ) | ++ |
Vector * Scalar.
+[in] | a | Vector |
[in] | b | Scalar |
float32x4_t vmul | +( | +const float32x4_t | +a, | +
+ | + | const float | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector * Scalar with predicate.
+[in] | a | Vector |
[in] | b | Scalar |
[in] | p0 | Predicate |
float32x4_t vmul | +( | +const float32x4_t | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Vector * Vector.
+[in] | a | Vector |
[in] | b | Vector |
float32x4_t vmul | +( | +const float32x4_t | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector * Vector with predicate.
+[in] | a | Vector |
[in] | b | Vector |
[in] | p0 | Predicate |
float16x8_t vneg | +( | +const float16x8_t | +a | ) | ++ |
Vector negate.
+[in] | a | Vector |
float16x8_t vneg | +( | +const float16x8_t | +a, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector negate with tail predicate.
+[in] | a | Vector |
[in] | p0 | Predicate |
float32x4_t vneg | +( | +const float32x4_t | +a | ) | ++ |
Vector negate.
+[in] | a | Vector value to negate |
float32x4_t vneg | +( | +const float32x4_t | +a, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector negate with tail.
+[in] | a | Value |
[in] | p0 | Predicate |
float vreduce | +( | +const float32x4_t | +in | ) | ++ |
Vector reduce.
+[in] | in | Vector |
Q< 33, 30 > vreduce | +( | +const Q< 33, 30 > | +sum | ) | ++ |
Reduce accumulation value.
+[in] | sum | The sum |
Since the Helium instructions can accumulate vector product into a scalar there is no need to reduce the accumulator value. It is already in scalar form.
+ +auto vreduce | +( | +const std::tuple< E... > & | +acc | ) | ++ |
Reduce function for tuples.
+[in] | acc | The accumulator |
E | Datatypes for tuples |
Some vector instructions sets cannot accumulate vectors into a scalar. They accumulate into this vector. This vector must be reduced to a scalar at the end of the accumulation loop.
+ +auto vreduce_impl | +( | +const A & | +acc, | +
+ | + | std::index_sequence< Ns... > | ++ |
+ | ) | ++ |
Reduce function for tuple.
+[in] | acc | Accumulator |
A | Accumulator datatype |
Ns | Tuple indexes |
Some vector instructions sets cannot accumulate vectors into a scalar. They accumulate into this vector. This vector must be reduced to a scalar at the end of the accumulation loop.
+ +
+
|
+ +inline | +
Store with stride.
+p | Store address | |
[in] | val | Value to store |
S | Stride |
<unnamed> | Check stride value |
+
|
+ +inline | +
Store with dynamic stride.
+p | Store address | |
[in] | stride | Stride value |
[in] | val | Value to store |
+
|
+ +inline | +
Store with stride and tail predicate.
+p | Store address | |
[in] | val | Value to store |
[in] | nb | Number of remaining loop iterations |
[in] | p0 | Predicate for loop |
S | Stride |
<unnamed> | Check stride value |
+
|
+ +inline | +
Store with dynamic stride.
+p | Store address | |
[in] | stride | Stride value |
[in] | val | Value to store |
[in] | nb | Number of remaining loops |
[in] | p0 | Predicate for loop |
float32x4_t vsub | +( | +const float | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Scalar - Vector.
+[in] | a | Scalar |
[in] | b | Vector |
float32x4_t vsub | +( | +const float | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Scalar - Vector with predicate.
+[in] | a | Scalar |
[in] | b | Vector |
[in] | p0 | predicate |
float32x4_t vsub | +( | +const float32x4_t | +a, | +
+ | + | const float | +b | +
+ | ) | ++ |
Vector - Scalar.
+[in] | a | Vector |
[in] | b | Scalar |
float32x4_t vsub | +( | +const float32x4_t | +a, | +
+ | + | const float | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector - Scalar with predicate.
+[in] | a | Vector |
[in] | b | Scalar |
[in] | p0 | predicate |
float32x4_t vsub | +( | +const float32x4_t | +a, | +
+ | + | const float32x4_t | +b | +
+ | ) | ++ |
Vector - Vector.
+[in] | a | Vector |
[in] | b | Vector |
float32x4_t vsub | +( | +const float32x4_t | +a, | +
+ | + | const float32x4_t | +b, | +
+ | + | const mve_pred16_t | +p0 | +
+ | ) | ++ |
Vector - Vector with predicate.
+[in] | a | Vector |
[in] | b | Vector |
[in] | p0 | Predicate |
+Data Structures | |
struct | number_traits< float > |
Features for float. More... | |
struct | vector_traits< float, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > |
Vector instructions for float when no Helium or Neon. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
float | from_accumulator (const float a) |
Convert from accumulator representtaion. | |
float | mac (const float acc, const float a, const float b) |
Scalar multiply and accumulate. | |
void | accumulate (float &a, const float &b) |
Scalar accumulate. | |
float | mult (float &a, const float &b) |
Scalar multiply. | |
+Data Structures | |
struct | number_traits< float16_t > |
Feature of float16 datatype. More... | |
struct | vector_traits< float16_t > |
float16 vector descrition when no vector architecture More... | |
+Namespaces | |
namespace | inner |
+Functions | |
float16_t | from_accumulator (const float16_t a) |
Convert from accumulator datatype. | |
float16_t | mac (const float16_t acc, const float16_t a, const float16_t b) |
Multiply and accumulate. | |
void | accumulate (float16_t &a, const float16_t &b) |
Accumulate. | |
float16_t | mult (float16_t &a, const float16_t &b) |
Multiply. | |
+Data Structures | |
struct | number_traits< Q15 > |
Q15 features. More... | |
struct | vector_traits< Q15, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > |
Vector features for Q15 when no vector architecture. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
Q15 | from_accumulator (const Q< 33, 30 > a) |
Convert from accumulator type. | |
Q< 33, 30 > | mac (const Q< 33, 30 > acc, const Q15 a, const Q15 b) |
Multiply and accumulate. | |
+Data Structures | |
struct | number_traits< Q31 > |
Features for Q31. More... | |
struct | vector_traits< Q31, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value >::type > |
Vector features for Q31 when no vector instructions. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
Q31 | from_accumulator (const Q< 15, 48 > a) |
Convert from accumulator (with no saturation) | |
Q< 15, 48 > | mac (const Q< 15, 48 > acc, const Q31 a, const Q31 b) |
Multiply and accumulate. | |
+Data Structures | |
struct | number_traits< Q7 > |
Q7 features. More... | |
struct | vector_traits< Q7, arch, typename std::enable_if<!std::is_base_of< Helium, arch >::value &&!std::is_base_of< Neon, arch >::value &&!std::is_base_of< DSP, arch >::value >::type > |
Vector descrition when no vector architecture. More... | |
+Namespaces | |
namespace | inner |
+Functions | |
Q7 | from_accumulator (const Q< 17, 14 > a) |
Convert from accumulator with saturation. | |
Q< 17, 14 > | mac (const Q< 17, 14 > acc, const Q7 a, const Q7 b) |
Multiply and accumulate. | |
#include "fixed_point.hpp"
#include <type_traits>
#include "arm_math_types.h"
#include "arm_math_types_f16.h"
#include "num_features/double.hpp"
#include "num_features/float.hpp"
#include "num_features/half.hpp"
#include "num_features/q31.hpp"
#include "num_features/q15.hpp"
#include "num_features/q7.hpp"
#include "DSP/num_features.hpp"
#include "Helium/num_features.hpp"
#include "num_features/group.hpp"
+Data Structures | |
struct | vector_traits< T, arch, typename > |
Properties of a vector datatype linked to a scalar datatype. More... | |
struct | vctpq< T, typename > |
Predicate (only defined for vector architectures) More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
Revision History | |
Deprecated List |
►DSP++ extension | |
Revision History | |
Deprecated List |
#include <utility>
#include <tuple>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "matrix.hpp"
+Namespaces | |
namespace | arm_cmsis_dsp |
#include <memory>
#include <cstring>
#include <algorithm>
#include <iostream>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "unroll.hpp"
#include "algorithms.hpp"
#include "vector_impl.hpp"
#include "vector_view.hpp"
#include "Helium/matrix_multiply.hpp"
#include "DSP/matrix_multiply.hpp"
#include "Scalar/matrix_multiply.hpp"
+Namespaces | |
namespace | arm_cmsis_dsp |
+Functions | |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator+ (const LHS &a, const RHS &b) |
Addition operator for expressions. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | operator+ (const LHS &a) |
| |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | expr (const LHS &a) |
Identity operator for expression. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | copy (const LHS &a) |
Identity operator for expression. | |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator- (const LHS &a, const RHS &b) |
Subtraction operator for expressions. | |
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true> | |
auto | operator- (const LHS &a) |
| |
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true> | |
auto | operator* (const LHS &a, const RHS &b) |
Element wise multiplication operator for expressions. | |
#include <memory>
#include <cstring>
#include <algorithm>
#include <iostream>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "unroll.hpp"
#include "algorithms.hpp"
#include "Scalar/basic.hpp"
#include "DSP/basic.hpp"
#include "Helium/basic.hpp"
#include "Neon/basic.hpp"
+Data Structures | |
struct | Vector_Base< P > |
Storage for a vector. More... | |
struct | Vector< P, L, Allocator > |
Vector template for size knonw at build time. More... | |
struct | Vector< P, DYNAMIC, Allocator > |
Vector template for dynamic vector (size known at runtime) More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |
#include <memory>
#include <cstring>
#include <algorithm>
#include <iostream>
#include "common.hpp"
#include "arch.hpp"
#include <type_traits>
#include "number.hpp"
#include "forward.hpp"
#include "fusion.hpp"
#include "unroll.hpp"
#include "algorithms.hpp"
#include "vector_impl.hpp"
+Data Structures | |
struct | VectorView< T, stride > |
Vector view. More... | |
struct | VectorView< T, DYNAMIC > |
Vector view with dynamic stride (not known at build time) More... | |
+Namespaces | |
namespace | arm_cmsis_dsp |