Opened 5 years ago

#13180 new Support Requests

Loop vectorisation using boost multi_array

Reported by: Nicolas Barrier <nicolas.barrier@…> 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

Attachments (1)

test_vector.cpp (668 bytes ) - added by Nicolas Barrier <nicolas.barrier@…> 5 years ago.
Test code

Download all attachments as: .zip

Change History (1)

by Nicolas Barrier <nicolas.barrier@…>, 5 years ago

Attachment: test_vector.cpp added

Test code

Note: See TracTickets for help on using tickets.