Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Binary Search and Other Alternatives

$
0
0

Hey,

I am trying to implement a lookup table based on binary search of the incoming element, and if the element doesn't exist, then pick the nearest element. 

The problem I am facing is that the loop in which these lookup table computations are performed doesn't get vectorized because of the binary search implementation (binary search contains do while loop where loop count is not fixed, and hence that while loop is not vectorized. Even if I convert it to a do loop, there are exit statements which disable vectorization.)

Is it even possible to vectorize these loops? Maybe some other better search technique which can enable vectorization?

I am attaching the code as well as the opt-report. Compiler used is ifort.

Thanks.
Amlesh


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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