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

Optimization of memcpy Use - Tell Compiler all Pointers are Aligned

$
0
0

Hello,

I have a simple loop as following:

#pragma omp parallel for
__assume_aligned(mO, 32);
__assume(numColsPad % 32 == 0);
__assume_aligned(vO, 32);
for (ii = 0; ii < numRows; ii++)
	{
		memcpy(&mO[ii * numColsPad], vO, numCols * sizeof(float));
	}

Though I tell the compiler all information needed to use the optimized memcpy it complains the destination should be aligned.
Is there a way to tell it that mO[ii * numColsPad] is aligned for any ii within any thread?


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>