2

I am using Boost MultiArrays in Visual Studio 2013. I compiled Boost using the native x64 C++ compiler of Visual STudio. I am getting a lot of warnings of type 'info C5002'. Next to the warning, I also get the reason code for the warning. Here is my code and a small sample of warnings I get.

#include <iostream>
#include <math.h>
#include <fstream>
#include "boost/multi_array.hpp"

using namespace std;

typedef boost::multi_array<float, 2> Grid;
int main()
{
    Grid myGrid;
    myGrid.resize(boost::extents[100][100]);
    return 0;
}

Example Warning :

1> --- Analyzing function: bool __cdecl std::_Equal<__int64 const * __ptr64,__int64 const * __ptr64>(__int64 const * __ptr64,__int64 const * __ptr64,__int64 const * __ptr64) 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2736) : info C5002: loop not vectorized due to reason '500'

I literally get 100s of identical warnings for my simple 10 lines code. In fact, I get C5002 info, even when there is no code except #include "boost/multi_array.hpp"

My concern is the loss of efficiency due to failure to vectorize. I have benchmarked my multiarrays and indeed they run far slower than native arrays, even in release mode. Please see here : Boost MultiArrays performance is poor

I would like to know if there is a way to have the compiler vectorize properly so that I do not suffer loss of runtime efficiency while using Multiarrays.

Community
  • 1
  • 1
The Vivandiere
  • 3,059
  • 3
  • 28
  • 50
  • 1
    This is not actually a warning, it's an informational message about why the optimizer was unable to auto-vectorize a piece of code. See the docs on auto-vectorization: http://msdn.microsoft.com/en-us/library/jj658585.aspx . If you want to silence the messages, you should be able to disable them by not setting the /Qvec-report compiler option. – mattnewport Jun 30 '14 at 22:46
  • @mattnewport, I updated the question. My real concern is the loss of efficieny I am experiencing while using MultiArrays which is most likely due the fact that the compiler cannot vectorize multiarrays. – The Vivandiere Jun 30 '14 at 22:54

1 Answers1

0

This warning probably comes from a place where Boost.MA check for equality between the current size and the desired new size. (using std::equal). This is a small comparison between 2 or 3 elements (number of dimensions).

Admittely, Boost.MA has not the best design with respect to layout but in this case, this has nothing to do with the performance of any critical (large N) operation.

alfC
  • 14,261
  • 4
  • 67
  • 118