00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00064 #include <math.h>
00065 #include "arm_math.h"
00066
00067
00068
00069
00070 #define MAX_BLOCKSIZE 32
00071 #define DELTA (0.000001f)
00072
00073
00074
00075
00076
00077
00078
00079
00080 float32_t srcA_buf_f32[MAX_BLOCKSIZE] =
00081 {
00082 -0.4325648115282207, -1.6655843782380970, 0.1253323064748307,
00083 0.2876764203585489, -1.1464713506814637, 1.1909154656429988,
00084 1.1891642016521031, -0.0376332765933176, 0.3272923614086541,
00085 0.1746391428209245, -0.1867085776814394, 0.7257905482933027,
00086 -0.5883165430141887, 2.1831858181971011, -0.1363958830865957,
00087 0.1139313135208096, 1.0667682113591888, 0.0592814605236053,
00088 -0.0956484054836690, -0.8323494636500225, 0.2944108163926404,
00089 -1.3361818579378040, 0.7143245518189522, 1.6235620644462707,
00090 -0.6917757017022868, 0.8579966728282626, 1.2540014216025324,
00091 -1.5937295764474768, -1.4409644319010200, 0.5711476236581780,
00092 -0.3998855777153632, 0.6899973754643451
00093 };
00094
00095
00096
00097
00098 float32_t srcB_buf_f32[MAX_BLOCKSIZE] =
00099 {
00100 1.7491401329284098, 0.1325982188803279, 0.3252281811989881,
00101 -0.7938091410349637, 0.3149236145048914, -0.5272704888029532,
00102 0.9322666565031119, 1.1646643544607362, -2.0456694357357357,
00103 -0.6443728590041911, 1.7410657940825480, 0.4867684246821860,
00104 1.0488288293660140, 1.4885752747099299, 1.2705014969484090,
00105 -1.8561241921210170, 2.1343209047321410, 1.4358467535865909,
00106 -0.9173023332875400, -1.1060770780029008, 0.8105708062681296,
00107 0.6985430696369063, -0.4015827425012831, 1.2687512030669628,
00108 -0.7836083053674872, 0.2132664971465569, 0.7878984786088954,
00109 0.8966819356782295, -0.1869172943544062, 1.0131816724341454,
00110 0.2484350696132857, 0.0596083377937976
00111 };
00112
00113
00114 float32_t refDotProdOut = 5.9273644806352142;
00115
00116
00117
00118
00119 float32_t multOutput[MAX_BLOCKSIZE];
00120 float32_t testOutput;
00121
00122 arm_status status;
00123
00124 int32_t main(void)
00125 {
00126 uint32_t i;
00127 float32_t diff;
00128
00129
00130 arm_mult_f32(srcA_buf_f32, srcB_buf_f32, multOutput, MAX_BLOCKSIZE);
00131
00132
00133
00134 for(i=0; i< MAX_BLOCKSIZE; i++)
00135 {
00136 arm_add_f32(&testOutput, &multOutput[i], &testOutput, 1);
00137 }
00138
00139
00140 diff = fabsf(refDotProdOut - testOutput);
00141
00142
00143 if(diff > DELTA)
00144 {
00145 status = ARM_MATH_TEST_FAILURE;
00146 }
00147
00148 if( status == ARM_MATH_TEST_FAILURE)
00149 {
00150 while(1);
00151 }
00152 }
00153