diff --git a/Testing/Include/Benchmarks/MicroBenchmarksF32.h b/Testing/Include/Benchmarks/MicroBenchmarksF32.h new file mode 100755 index 00000000..005c6c3b --- /dev/null +++ b/Testing/Include/Benchmarks/MicroBenchmarksF32.h @@ -0,0 +1,22 @@ +#include "Test.h" +#include "Pattern.h" +class MicroBenchmarksF32:public Client::Suite + { + public: + MicroBenchmarksF32(Testing::testID_t id); + virtual void setUp(Testing::testID_t,std::vector& params,Client::PatternMgr *mgr); + virtual void tearDown(Testing::testID_t,Client::PatternMgr *mgr); + private: + #include "MicroBenchmarksF32_decl.h" + + Client::Pattern input1; + Client::Pattern input2; + Client::LocalPattern output; + + + int nbSamples; + + float32_t *inp1; + float32_t *inp2; + float32_t *outp; + }; diff --git a/Testing/Include/Benchmarks/MicroBenchmarksQ15.h b/Testing/Include/Benchmarks/MicroBenchmarksQ15.h new file mode 100755 index 00000000..a718cc95 --- /dev/null +++ b/Testing/Include/Benchmarks/MicroBenchmarksQ15.h @@ -0,0 +1,22 @@ +#include "Test.h" +#include "Pattern.h" +class MicroBenchmarksQ15:public Client::Suite + { + public: + MicroBenchmarksQ15(Testing::testID_t id); + virtual void setUp(Testing::testID_t,std::vector& params,Client::PatternMgr *mgr); + virtual void tearDown(Testing::testID_t,Client::PatternMgr *mgr); + private: + #include "MicroBenchmarksQ15_decl.h" + + Client::Pattern input1; + Client::Pattern input2; + Client::LocalPattern output; + + + int nbSamples; + + q15_t *inp1; + q15_t *inp2; + q15_t *outp; + }; diff --git a/Testing/Include/Benchmarks/MicroBenchmarksQ31.h b/Testing/Include/Benchmarks/MicroBenchmarksQ31.h new file mode 100755 index 00000000..e07a9bc2 --- /dev/null +++ b/Testing/Include/Benchmarks/MicroBenchmarksQ31.h @@ -0,0 +1,22 @@ +#include "Test.h" +#include "Pattern.h" +class MicroBenchmarksQ31:public Client::Suite + { + public: + MicroBenchmarksQ31(Testing::testID_t id); + virtual void setUp(Testing::testID_t,std::vector& params,Client::PatternMgr *mgr); + virtual void tearDown(Testing::testID_t,Client::PatternMgr *mgr); + private: + #include "MicroBenchmarksQ31_decl.h" + + Client::Pattern input1; + Client::Pattern input2; + Client::LocalPattern output; + + + int nbSamples; + + q31_t *inp1; + q31_t *inp2; + q31_t *outp; + }; diff --git a/Testing/Include/Benchmarks/MicroBenchmarksQ7.h b/Testing/Include/Benchmarks/MicroBenchmarksQ7.h new file mode 100755 index 00000000..e41f3c6f --- /dev/null +++ b/Testing/Include/Benchmarks/MicroBenchmarksQ7.h @@ -0,0 +1,22 @@ +#include "Test.h" +#include "Pattern.h" +class MicroBenchmarksQ7:public Client::Suite + { + public: + MicroBenchmarksQ7(Testing::testID_t id); + virtual void setUp(Testing::testID_t,std::vector& params,Client::PatternMgr *mgr); + virtual void tearDown(Testing::testID_t,Client::PatternMgr *mgr); + private: + #include "MicroBenchmarksQ7_decl.h" + + Client::Pattern input1; + Client::Pattern input2; + Client::LocalPattern output; + + + int nbSamples; + + q7_t *inp1; + q7_t *inp2; + q7_t *outp; + }; diff --git a/Testing/Source/Benchmarks/MicroBenchmarksF32.cpp b/Testing/Source/Benchmarks/MicroBenchmarksF32.cpp new file mode 100755 index 00000000..0cdfb435 --- /dev/null +++ b/Testing/Source/Benchmarks/MicroBenchmarksF32.cpp @@ -0,0 +1,105 @@ +#include "MicroBenchmarksF32.h" +#include "Error.h" + +static void add_while_f32( + const float32_t * pSrcA, + const float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A + B */ + + /* Add and store result in destination buffer. */ + *pDst++ = (*pSrcA++) + (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +static void add_for_f32( + const float32_t * pSrcA, + const float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + int32_t i; + + blkCnt = blockSize; + + for(i=0; iinp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksF32::test_for_f32() + { + add_for_f32(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksF32::test_array_f32() + { + add_array_f32(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + + void MicroBenchmarksF32::setUp(Testing::testID_t id,std::vector& params,Client::PatternMgr *mgr) + { + + + std::vector::iterator it = params.begin(); + this->nbSamples = *it; + + input1.reload(MicroBenchmarksF32::INPUT1_F32_ID,mgr,this->nbSamples); + input2.reload(MicroBenchmarksF32::INPUT2_F32_ID,mgr,this->nbSamples); + + + output.create(this->nbSamples,MicroBenchmarksF32::OUT_SAMPLES_F32_ID,mgr); + + this->inp1=input1.ptr(); + this->inp2=input2.ptr(); + this->outp=output.ptr(); + + } + + void MicroBenchmarksF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) + { + } diff --git a/Testing/Source/Benchmarks/MicroBenchmarksQ15.cpp b/Testing/Source/Benchmarks/MicroBenchmarksQ15.cpp new file mode 100755 index 00000000..3cc28f97 --- /dev/null +++ b/Testing/Source/Benchmarks/MicroBenchmarksQ15.cpp @@ -0,0 +1,105 @@ +#include "MicroBenchmarksQ15.h" +#include "Error.h" + +static void add_while_q15( + const q15_t * pSrcA, + const q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A + B */ + + /* Add and store result in destination buffer. */ + *pDst++ = (*pSrcA++) + (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +static void add_for_q15( + const q15_t * pSrcA, + const q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + int32_t i; + + blkCnt = blockSize; + + for(i=0; iinp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksQ15::test_for_q15() + { + add_for_q15(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksQ15::test_array_q15() + { + add_array_q15(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + + void MicroBenchmarksQ15::setUp(Testing::testID_t id,std::vector& params,Client::PatternMgr *mgr) + { + + + std::vector::iterator it = params.begin(); + this->nbSamples = *it; + + input1.reload(MicroBenchmarksQ15::INPUT1_Q15_ID,mgr,this->nbSamples); + input2.reload(MicroBenchmarksQ15::INPUT2_Q15_ID,mgr,this->nbSamples); + + + output.create(this->nbSamples,MicroBenchmarksQ15::OUT_SAMPLES_Q15_ID,mgr); + + this->inp1=input1.ptr(); + this->inp2=input2.ptr(); + this->outp=output.ptr(); + + } + + void MicroBenchmarksQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) + { + } diff --git a/Testing/Source/Benchmarks/MicroBenchmarksQ31.cpp b/Testing/Source/Benchmarks/MicroBenchmarksQ31.cpp new file mode 100755 index 00000000..4eeae2ba --- /dev/null +++ b/Testing/Source/Benchmarks/MicroBenchmarksQ31.cpp @@ -0,0 +1,105 @@ +#include "MicroBenchmarksQ31.h" +#include "Error.h" + +static void add_while_q31( + const q31_t * pSrcA, + const q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A + B */ + + /* Add and store result in destination buffer. */ + *pDst++ = (*pSrcA++) + (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +static void add_for_q31( + const q31_t * pSrcA, + const q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + int32_t i; + + blkCnt = blockSize; + + for(i=0; iinp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksQ31::test_for_q31() + { + add_for_q31(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksQ31::test_array_q31() + { + add_array_q31(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + + void MicroBenchmarksQ31::setUp(Testing::testID_t id,std::vector& params,Client::PatternMgr *mgr) + { + + + std::vector::iterator it = params.begin(); + this->nbSamples = *it; + + input1.reload(MicroBenchmarksQ31::INPUT1_Q31_ID,mgr,this->nbSamples); + input2.reload(MicroBenchmarksQ31::INPUT2_Q31_ID,mgr,this->nbSamples); + + + output.create(this->nbSamples,MicroBenchmarksQ31::OUT_SAMPLES_Q31_ID,mgr); + + this->inp1=input1.ptr(); + this->inp2=input2.ptr(); + this->outp=output.ptr(); + + } + + void MicroBenchmarksQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) + { + } diff --git a/Testing/Source/Benchmarks/MicroBenchmarksQ7.cpp b/Testing/Source/Benchmarks/MicroBenchmarksQ7.cpp new file mode 100755 index 00000000..f49e4468 --- /dev/null +++ b/Testing/Source/Benchmarks/MicroBenchmarksQ7.cpp @@ -0,0 +1,105 @@ +#include "MicroBenchmarksQ7.h" +#include "Error.h" + +static void add_while_q7( + const q7_t * pSrcA, + const q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A + B */ + + /* Add and store result in destination buffer. */ + *pDst++ = (*pSrcA++) + (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +static void add_for_q7( + const q7_t * pSrcA, + const q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + int32_t i; + + blkCnt = blockSize; + + for(i=0; iinp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksQ7::test_for_q7() + { + add_for_q7(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + void MicroBenchmarksQ7::test_array_q7() + { + add_array_q7(this->inp1,this->inp2,this->outp,this->nbSamples); + } + + + void MicroBenchmarksQ7::setUp(Testing::testID_t id,std::vector& params,Client::PatternMgr *mgr) + { + + + std::vector::iterator it = params.begin(); + this->nbSamples = *it; + + input1.reload(MicroBenchmarksQ7::INPUT1_Q7_ID,mgr,this->nbSamples); + input2.reload(MicroBenchmarksQ7::INPUT2_Q7_ID,mgr,this->nbSamples); + + + output.create(this->nbSamples,MicroBenchmarksQ7::OUT_SAMPLES_Q7_ID,mgr); + + this->inp1=input1.ptr(); + this->inp2=input2.ptr(); + this->outp=output.ptr(); + + } + + void MicroBenchmarksQ7::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) + { + }