I have the following double loop where I compute the element of matrix Fisher_M[FX][FY].
I tried to optimize it by putting an OMP pragma #pragma omp parallel for schedule(dynamic, num_threads), but the gain is not as good as expected.
Is there a way to do a reduction with OpenMP (of sum) to compute the element Fisher_M[FX][FY] quickly? Or maybe this is doable with MAGMA or CUDA?
#define num_threads 8
#pragma omp parallel for schedule(dynamic, num_threads)
for(int i=0; i<CO_CL_WL.size(); i++){
for(int j=0; j<CO_CL_WL.size(); j++){
if( CO_CL_WL[i][j] != 0 || CO_CL_WL_D[i][j] != 0){
Fisher_M[FX][FY] += CO_CL_WL[i][j]*CO_CL_WL_D[i][j];
}
}
}