When I compile even the simplest program using a C++ standard library algorithm execution policy, I get a page or two of warnings from include/c++/14.0.1/pstl/algorithm_impl.h
– centred on the message below repeated:
_PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
I get this even when using the sequenced policy (std::execution::seq
). Here is an example of a program which will produce the warnings:
#include <algorithm>
#include <execution>
#include <array>
int main()
{
std::array<int, 1024> arr{};
std::for_each(std::execution::seq, arr.begin(), arr.end(), [](int x) {});
return 0;
}
The warnings only appear with my own builds of GCC (which otherwise run fine). If I use the standard system package of GCC (Ubuntu 23.10) there are no such warnings. I compile using a command such as ~/my/build/of/g++ test.cpp -ltbb
. Can I silence these warnings in the same way that my system’s GCC does?