Opened 5 years ago
#13180 new Support Requests
Loop vectorisation using boost multi_array
Reported by: | Owned by: | Ronald Garcia | |
---|---|---|---|
Milestone: | To Be Determined | Component: | multi_array |
Version: | Boost 1.65.0 | Severity: | Optimization |
Keywords: | Cc: |
Description
Dear all
I am trying to optimize a huge code that uses boost multi-arrays. And when I compile the code with the -qopt-report=2 -qopt-report-phase=vec options, I notice in the compilation report that most loops are not vectorized.
I thus made a simple program to understand why, and I noticed that a loop that uses C array is vectorized, while the same loop using boost multi array is not (see test_vector.cpp) (see attached .cpp file). I get the following message:
LOOP BEGIN at test_vector.cpp(29,5) remark #15520: loop was not vectorized: loop with multiple exits cannot be vectorized unless it meets search loop idiom criteria LOOP END
A way to overcome this would be to use the data pointer in combination with the #pragma ivdep
statement, but this becomes complicated when working on multimensional arrays.
I thus would like to know if I am doing something wrong (for instance in the boost array initialisation), and if there is a way to fix this?
I am using the icpc compiler, version 16.0.4, with boost library version 1.65. The program is compiled as follows:
icpc -Ilibs/cpp/boost_1_65_0/ -O3 -qopt-report=2 -qopt-report-phase=vec test_vector.cpp
Thanks a lot
Nicolas Barrier
Test code