Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Overriding data dependency and force vectorization

$
0
0

I have a loop which inside a parallel construct which goes like this 

# pragma omp parallel ... //directives
{
// other loops 
....

#pragma omp for
for (i=1; i<=nx; i++) for (j=1; j<=ny; j++) for (k=1; k<=nz; k++)
 {
	  p_sparse_s[i][j][k] = RLL[i][j][k] + (riri_sparse2 / noemer_sparse) * p_sparse_s[i][j][k];
 }

// other loops
....
}

On inspecting it seems this loop is not being vectorized because of assumed dependency. On further inspecting with dependence analysis there is no dependency ( as evident from the code ). How should the directive be changed so that I enforce vectorization.

Also I tried using ivdep directive still the compiler didn't vectorised.


Viewing all articles
Browse latest Browse all 1175

Trending Articles