I use function Simd::Fill from Simd Library. And it works fine in the most cases. But there is a strange behavior sometimes. For example, in this case:
#include "Simd/SimdLib.hpp"
typedef Simd::View<Simd::Allocator> View;
View Create(size_t w, size_t h, uint8_t color)
{
View image(w, h, View::Gray8);
Simd::Fill(image, color);
return image;
}
int main()
{
View image;
image = Create(200, 150, 127);
image.Save("image.pgm");
return 0;
}
Saved "image.pgm":
There is a strange noise in the image. It is similar to memory corruption, but I can't find where is it. Could anybody help me?