From cb55282a0eb06c27bf9448f7b7b9fd4a8c92339f Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Fri, 23 Apr 2021 09:37:46 +0200 Subject: [PATCH] CMSIS-DSP: Improved absmax and absmin tests. --- Testing/Source/Benchmarks/StatsF16.cpp | 29 ++++++++++++++++++++++++++ Testing/Source/Benchmarks/StatsF32.cpp | 29 ++++++++++++++++++++++++++ Testing/Source/Benchmarks/StatsQ15.cpp | 29 ++++++++++++++++++++++++++ Testing/Source/Benchmarks/StatsQ31.cpp | 29 ++++++++++++++++++++++++++ Testing/Source/Benchmarks/StatsQ7.cpp | 29 ++++++++++++++++++++++++++ Testing/bench.txt | 8 +++++++ Testing/bench_f16.txt | 2 ++ 7 files changed, 155 insertions(+) diff --git a/Testing/Source/Benchmarks/StatsF16.cpp b/Testing/Source/Benchmarks/StatsF16.cpp index be1c9ed2..2a85b992 100755 --- a/Testing/Source/Benchmarks/StatsF16.cpp +++ b/Testing/Source/Benchmarks/StatsF16.cpp @@ -18,6 +18,19 @@ } + void StatsF16::test_absmax_f16() + { + + float16_t result; + uint32_t indexval; + + arm_absmax_f16(inap, + this->nb, + &result, + &indexval); + + } + void StatsF16::test_max_no_idx_f16() { @@ -46,6 +59,22 @@ + } + + void StatsF16::test_absmin_f16() + { + + float16_t result; + uint32_t indexval; + + + arm_absmin_f16(inap, + this->nb, + &result, + &indexval); + + + } void StatsF16::test_mean_f16() diff --git a/Testing/Source/Benchmarks/StatsF32.cpp b/Testing/Source/Benchmarks/StatsF32.cpp index 4f2fc48b..3811ff4c 100755 --- a/Testing/Source/Benchmarks/StatsF32.cpp +++ b/Testing/Source/Benchmarks/StatsF32.cpp @@ -18,6 +18,19 @@ } + void StatsF32::test_absmax_f32() + { + + float32_t result; + uint32_t indexval; + + arm_absmax_f32(inap, + this->nb, + &result, + &indexval); + + } + void StatsF32::test_max_no_idx_f32() { @@ -46,6 +59,22 @@ + } + + void StatsF32::test_absmin_f32() + { + + float32_t result; + uint32_t indexval; + + + arm_absmin_f32(inap, + this->nb, + &result, + &indexval); + + + } void StatsF32::test_mean_f32() diff --git a/Testing/Source/Benchmarks/StatsQ15.cpp b/Testing/Source/Benchmarks/StatsQ15.cpp index b6147772..ed9f0f02 100755 --- a/Testing/Source/Benchmarks/StatsQ15.cpp +++ b/Testing/Source/Benchmarks/StatsQ15.cpp @@ -18,6 +18,19 @@ } + void StatsQ15::test_absmax_q15() + { + + q15_t result; + uint32_t indexval; + + arm_absmax_q15(inap, + this->nb, + &result, + &indexval); + + } + void StatsQ15::test_min_q15() { @@ -32,6 +45,22 @@ + } + + void StatsQ15::test_absmin_q15() + { + + q15_t result; + uint32_t indexval; + + + arm_absmin_q15(inap, + this->nb, + &result, + &indexval); + + + } void StatsQ15::test_mean_q15() diff --git a/Testing/Source/Benchmarks/StatsQ31.cpp b/Testing/Source/Benchmarks/StatsQ31.cpp index 2e21d4b8..6445c5c1 100755 --- a/Testing/Source/Benchmarks/StatsQ31.cpp +++ b/Testing/Source/Benchmarks/StatsQ31.cpp @@ -18,6 +18,19 @@ } + void StatsQ31::test_absmax_q31() + { + + q31_t result; + uint32_t indexval; + + arm_absmax_q31(inap, + this->nb, + &result, + &indexval); + + } + void StatsQ31::test_min_q31() @@ -34,6 +47,22 @@ + } + + void StatsQ31::test_absmin_q31() + { + + q31_t result; + uint32_t indexval; + + + arm_absmin_q31(inap, + this->nb, + &result, + &indexval); + + + } void StatsQ31::test_mean_q31() diff --git a/Testing/Source/Benchmarks/StatsQ7.cpp b/Testing/Source/Benchmarks/StatsQ7.cpp index 9d6ded83..fc4e8c41 100755 --- a/Testing/Source/Benchmarks/StatsQ7.cpp +++ b/Testing/Source/Benchmarks/StatsQ7.cpp @@ -18,6 +18,19 @@ } + void StatsQ7::test_absmax_q7() + { + + q7_t result; + uint32_t indexval; + + arm_absmax_q7(inap, + this->nb, + &result, + &indexval); + + } + void StatsQ7::test_min_q7() @@ -34,6 +47,22 @@ + } + + void StatsQ7::test_absmin_q7() + { + + q7_t result; + uint32_t indexval; + + + arm_absmin_q7(inap, + this->nb, + &result, + &indexval); + + + } void StatsQ7::test_mean_q7() diff --git a/Testing/bench.txt b/Testing/bench.txt index ba6caaff..ea5dcbf5 100755 --- a/Testing/bench.txt +++ b/Testing/bench.txt @@ -44,6 +44,8 @@ group Root { Kullback Leibler divergence:test_kullback_leibler_f32 Vector logsumexp dot product:test_logsumexp_dot_prod_f32 Vector max with no index:test_max_no_idx_f32 + Vector absolute maximum:test_absmax_f32 + Vector absolute minimum:test_absmin_f32 } -> PARAM1_ID } @@ -108,6 +110,8 @@ group Root { Vector root mean square:test_rms_q31 Vector standard deviation:test_std_q31 Vector variance:test_var_q31 + Vector absolute maximum:test_absmax_q31 + Vector absolute minimum:test_absmin_q31 } -> PARAM1_ID } @@ -144,6 +148,8 @@ group Root { Vector root mean square:test_rms_q15 Vector standard deviation:test_std_q15 Vector variance:test_var_q15 + Vector absolute maximum:test_absmax_q15 + Vector absolute minimum:test_absmin_q15 } -> PARAM1_ID } @@ -177,6 +183,8 @@ group Root { Vector average:test_mean_q7 Vector minimum:test_min_q7 Vector energy:test_power_q7 + Vector absolute maximum:test_absmax_q7 + Vector absolute minimum:test_absmin_q7 } -> PARAM1_ID } diff --git a/Testing/bench_f16.txt b/Testing/bench_f16.txt index afcf5183..5bb18578 100755 --- a/Testing/bench_f16.txt +++ b/Testing/bench_f16.txt @@ -44,6 +44,8 @@ group Root { Kullback Leibler divergence:test_kullback_leibler_f16 Vector logsumexp dot product:test_logsumexp_dot_prod_f16 Vector max with no index:test_max_no_idx_f16 + Vector absolute maximum:test_absmax_f16 + Vector absolute minimum:test_absmin_f16 } -> PARAM1_ID }