- Code: Select all
`nrows`

- Code: Select all
`ncolumns`

- Code: Select all
`rowMin,rowMax`

- Code: Select all
`columnMin,columnMax`

- Code: Select all
`#pragma omp for schedule(dynamic,1)`

for (int i=0; i < nrows; i++)

{

int rowMin = -min(depth, i);

int rowMax = min(depth,(hight-i-1));

for (int j=0; j < ncolumns; j++)

{

int columnMin = -min(depth, j);

int columnMax = min(depth,(width-j-1));

int count = 0;

for (int irow = rowMin; irow <= rowMax; irow++)

{

for (int jcol=columnMin; jcol<=columnMax; jcol++)

{

count++;

for (int k=0; k< color; k++)

{

result[i][j * color+k] += array[i+irow][(j+jcol) * color+k];

}

}

}

for (int k=0; k< color; k++)

{

result[i][j* color+k] -= array[i][j * color+k];

result[i][j* color+k] /= (count-1);

}

}

}

I would appreciate any ideas to get better performance here. Is there a better pattern to access return and array?

Chyntia