I have a for loop to identify min and max of a float array. Here is my implementation:
for (int i = 0; i < counter; i++) {
imin = intervals[i] < imin ? intervals[i] : imin;
imax = intervals[i] > imax ? intervals[i] : imax;
}
What is the best way to optimize the code here? I am using -xAVX option and I am running the program in single thread mode. How does this compare to using std::minmax_element?
Should I write some manual AVX code?
Thanks,