Hi
I am trying to optimize the simple Sum of Product Code using #pragma directives.
Snippet of the code is shown below
#include <stdio.h>
unsigned char a[64];
unsigned char b[64];
int sum = 0;
main()
{
int i;
for(i = 0; i< 64; i++)
{
a[i] = b[i] = i;
}
//#pragma UNROLL(2)
//#pragma MUST_ITERATE( , , 2)
for(i = 0; i< 64; i= i++)
sum = sum + (a[i] * b[i]);
}
In the code above, I tried using both UNROLL and MUST_ITERATE pragma to unroll the loop two times. But, in both case, loop does not look to get unrolled and thereby reducing time.
Timing remained same with and without using pragma directives.
Apperciate your help in guidance to use #pragma directives