CMSIS-DSP: Improved benchmarking code.

pull/19/head
Christophe Favergeon 6 years ago
parent 69f0f0f7bc
commit 08385a3112

@ -4,95 +4,46 @@
void BasicMathsBenchmarksF32::vec_mult_f32()
{
arm_mult_f32(this->inp1,this->inp2,this->outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_add_f32()
{
float32_t *inp1=input1.ptr();
float32_t *inp2=input2.ptr();
float32_t *outp=output.ptr();
arm_add_f32(inp1,inp2,outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_sub_f32()
{
float32_t *inp1=input1.ptr();
float32_t *inp2=input2.ptr();
float32_t *outp=output.ptr();
arm_sub_f32(inp1,inp2,outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_abs_f32()
{
float32_t *inp1=input1.ptr();
float32_t *inp2=input2.ptr();
float32_t *outp=output.ptr();
arm_abs_f32(inp1,outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_negate_f32()
{
float32_t *inp1=input1.ptr();
float32_t *outp=output.ptr();
arm_negate_f32(inp1,outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_offset_f32()
{
float32_t *inp1=input1.ptr();
float32_t *inp2=input2.ptr();
float32_t *outp=output.ptr();
arm_offset_f32(inp1,1.0,outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_scale_f32()
void BasicMathsBenchmarksF32::vec_scale_f32()
{
float32_t *inp1=input1.ptr();
float32_t *inp2=input2.ptr();
float32_t *outp=output.ptr();
arm_scale_f32(inp1,1.0,outp,this->nb);
arm_scale_f32(inp1,1.0,outp,this->nb);
}
void BasicMathsBenchmarksF32::vec_dot_f32()
{
float32_t *inp1=input1.ptr();
float32_t *inp2=input2.ptr();
float32_t result;
arm_dot_prod_f32(inp1,inp2,this->nb,&result);
arm_dot_prod_f32(inp1,inp2,this->nb,&result);
}
void BasicMathsBenchmarksF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
{
@ -110,6 +61,12 @@
switch(id)
{
case BasicMathsBenchmarksF32::VEC_MULT_F32_1:
case BasicMathsBenchmarksF32::VEC_ADD_F32_2:
case BasicMathsBenchmarksF32::VEC_SUB_F32_3:
case BasicMathsBenchmarksF32::VEC_ABS_F32_4:
case BasicMathsBenchmarksF32::VEC_OFFSET_F32_6:
case BasicMathsBenchmarksF32::VEC_SCALE_F32_7:
/* This an overhead doing this because ptr() function is doing lot of checks
to ensure patterns are fresh.
So for small benchmark lengths it is better doing it in the setUp function
@ -118,6 +75,16 @@
this->inp2=input2.ptr();
this->outp=output.ptr();
break;
case BasicMathsBenchmarksF32::VEC_NEGATE_F32_5:
this->inp1=input1.ptr();
this->outp=output.ptr();
break;
case BasicMathsBenchmarksF32::VEC_DOT_F32_8:
this->inp1=input1.ptr();
this->inp2=input2.ptr();
break;
}
}

Loading…
Cancel
Save