One of our x64 AVX code tests we have fails when run on ARM
The test results say:
-------------------------------------------------------------------------------
AVX Stacking, Entropy
One image
-------------------------------------------------------------------------------
/Users/amonra/.vs/DSS/DeepSkyStackerTest/AvxStackingTest.cpp:381
...............................................................................
/Users/amonra/.vs/DSS/DeepSkyStackerTest/AvxStackingTest.cpp:416: FAILED:
REQUIRE( avxEntropy.getRedEntropyLayer()[10] == 1.0f )
with expansion:
0.99993f == 1.0f
The test code:
TEST_CASE("AVX Stacking, Entropy", "[AVX][Stacking][Entropy]")
{
SECTION("One image")
{
constexpr int W = 61;
constexpr int H = 37;
typedef float T;
DSSRect rect(0, 0, W, H); // left, top, right, bottom
std::shared_ptr<CMemoryBitmap> pTempBitmap = std::make_shared<CGrayBitmapT<T>>();
REQUIRE(pTempBitmap->Init(W, H) == true);
std::shared_ptr<CMemoryBitmap> pBitmap = std::make_shared<CGrayBitmapT<T>>();
REQUIRE(pBitmap->Init(W, H) == true);
auto* pGray = dynamic_cast<CGrayBitmapT<T>*>(pBitmap.get());
for (int i = 0; i < W * H; ++i)
pGray->m_vPixels[i] = 100.0f;
std::shared_ptr<CMemoryBitmap> pEntropyCoverage = std::make_shared<CGrayBitmapT<float>>();
REQUIRE(pEntropyCoverage->Init(W, H) == true);
TestEntropyInfo entropyInfo;
entropyInfo.Init(pTempBitmap, 10, nullptr);
AvxEntropy avxEntropy(*pTempBitmap, entropyInfo, pEntropyCoverage.get());
CPixelTransform pixTransform;
CTaskInfo taskInfo; // Determines if method is ENTROPY or not.
taskInfo.SetMethod(MBP_ENTROPYAVERAGE, 2, 5);
CBackgroundCalibration backgroundCalib;
backgroundCalib.SetMode(BCM_NONE, BCI_LINEAR, RBCM_MAXIMUM);
AvxStacking avxStacking(0, H, *pBitmap, *pTempBitmap, rect, avxEntropy);
REQUIRE(avxStacking.stack(pixTransform, taskInfo, backgroundCalib, std::shared_ptr<CMemoryBitmap>{}, 1) == 0);
for (int i = 0; i < 10; ++i)
REQUIRE(avxEntropy.getRedEntropyLayer()[i] == Approx(1.0f).epsilon(1e-4f));
REQUIRE(avxEntropy.getRedEntropyLayer()[10] == 1.0f);
The test passes when run on x64 hardware.
The full code for the AvxStacking class is a bit large to post inline. Sadly the attach file option won't let me attach cpp files
D.
Topic:
App & System Services
SubTopic:
Core OS