Hello,
I am trying to calculate performance of simple Matrix to Matrix Multiplication code. I am using TSCL and TSCH for calculating my Clock cycles and from there I am calculating How much time it is taking to do that particular nested loop. My code is as follows:
A = (double*)malloc(dimension*dimension*sizeof(double));
B = (double*)malloc(dimension*dimension*sizeof(double));
C = (double*)malloc(dimension*dimension*sizeof(double));
for(i = 0; i < dimension; i++)
{
for(j = 0; j < dimension; j++)
{
A[dimension*i+j] = (i+j);
B[dimension*i+j] = (i-j);
C[dimension*i+j] = 0.0;
}
}
TSCL = 0;
TSCH = 0;
t_start_l = TSCL;
t_start_h = TSCH;
for(i = 0; i < dimension; i++)
{
for(j = 0; j < dimension; j++)
{
tmp = 0.0;
for(k = 0; k < dimension; k++)
{
tmp += A[dimension*i+k] *B[dimension*k+j];
C[dimension*i+j] = tmp;
}
}
}
t_stop_l = TSCL;
t_stop_h = TSCH;
t_overhead_l = t_stop_l - t_start_l;
t_overhead_h = t_stop_h - t_start_h;
Now, Number of clock cycle is Delta= t_overhead_l- t_overhead_h. Below are some values which I am getting with No optimizations and No particular special properties.
[C66xx_0] Enter the size of dimension : 10
[C66xx_0] Time Taken during Matrix multiplication is: , t_overhead_h = 0 t_overhead_l=59958
[C66xx_1] Enter the size of dimension : 100
[C66xx_1] Time Taken during Matrix multiplication is: , t_overhead_h = 0 t_overhead_l=64627173
[C66xx_2] Enter the size of dimension : 500
[C66xx_2] Time Taken during Matrix multiplication is: , t_overhead_h = 2 t_overhead_l=-547958635
[C66xx_3] Enter the size of dimension : 1000
[C66xx_3] Time Taken during Matrix multiplication is: , t_overhead_h = 15 t_overhead_l=-124803967
[C66xx_4] Enter the size of dimension : 1024
[C66xx_4] Time Taken during Matrix multiplication is: , t_overhead_h = 16 t_overhead_l=320899090
[C66xx_5] Enter the size of dimension : 1500
Now, My Questions are as below:
1. Why values are negative for dimension size 500 and 1000, but why not for 1024.
2. Why System hangs at dimension size of 1500, It does not give me any error nor any message for half an hour.
Apart from this, is there any other way to calculate the time and If I am using and enabling clock from CCS it is giving me some other values, from the values which I am getting, Does those
CPU values are for total program if I will selected as CPU execution cycles.
Thanks and Regards,
Arun

