1 
2 #include "RTE_Components.h"
3 #include  CMSIS_device_header
4 
5 #if defined(MPS3)
6 #include "cmsis_driver_config.h"
7 #include "stdout_USART.h"
8 #endif
9 
10 #include <iostream>
11 
12 #include <dsppp/memory_pool.hpp>
13 #include <dsppp/matrix.hpp>
14 
15 using namespace arm_cmsis_dsp;
16 
17 
main(void)18 int main(void)
19 {
20 #if defined(MPS3)
21     stdout_init();
22 #endif
23 
24     std::cout << "Dot product example\r\n";
25 
26     constexpr int NB = 32;
27 
28     Vector<float32_t,NB> a;
29     Vector<float32_t,NB> b;
30     Vector<float32_t,NB> c;
31     Vector<float32_t,NB> d;
32 
33     float32_t scale = 0.5;
34 
35     for(int i = 0;i< NB;i++)
36     {
37         a[i] = b[i] = c[i] = d[i] = i;
38     }
39 
40     float32_t r;
41 
42     r = dot(scale*(a+b),c*d);
43 
44     std::cout << "Result = " << r << "\r\n";
45 
46 
47 #if defined(MPS3)
48     while(1);
49 #endif
50 }
51 
52 
53