Quantcast
Channel: Intel® Many Integrated Core Architecture
Viewing all articles
Browse latest Browse all 1347

Optimizing a Maximum Search on the Xeon Phi

$
0
0
Hello,
I am currently trying to optimize an argmax search. That means i want to know the index of the biggest element in an array. But i need to multiply two arrays to get the desired array where to search in.
The two arrays are aligned to 64 Bytes. The code looks like this:

		current_max = 0.;
		index_max = 0;
                #pragma ivdep
		for(i=0;i<4096;i++) {
			prod = array_one[i]*array_two[i];
			if(current_max< prod) {
				current_max= prod;
				index_max = i;
			}
		}

Is there a possibility to speed this up or are there any libraries which can do this search? I already tried to put the calculation of the product out of the loop which sped it up a bit.


Viewing all articles
Browse latest Browse all 1347

Trending Articles



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