Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Func ippsMean_32fc Lose Accuracy on AVX Platform

paul_shu
Beginner
521 Views

Recently, I find the ippsMean_32fc function is not accurate enough with ippAlgHintAccurate or ippAlgHintNone mode on AVX support machine. And I have verified that it can work well on none-AVX machine or ippAlgHintFast mode on AVX machine. So I just want to know if this is a bug of IPP library. If it is, when it can be fixed? Because it will affect the stability of our product on AVX platform.

My test code is:

#include "ipp.h"
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
    const int dataLen = 1000;
    float *data = new float[dataLen*2];
    for(int i = 0; i<dataLen*2; ++i) data = (float)rand() / RAND_MAX;

    float resAcc[2] = {0.0f, 0.0f};
    float resFast[2] = {0.0f, 0.0f};
    float resNone[2] = {0.0f, 0.0f};

    Ipp32fc *pData = (Ipp32fc*)data;
    Ipp32fc *pResAcc = (Ipp32fc*)resAcc;
    Ipp32fc *pResFast = (Ipp32fc*)resFast;
    Ipp32fc *pResNone = (Ipp32fc*)resNone;

    ippsMean_32fc(pData, dataLen, pResAcc, ippAlgHintAccurate);
    ippsMean_32fc(pData, dataLen, pResFast, ippAlgHintFast);
    ippsMean_32fc(pData, dataLen, pResNone, ippAlgHintNone);

    printf("Accurate: %f, %f\n", ((float*)pResAcc)[0], ((float*)pResAcc)[1]);
    printf("Fast: %f, %f\n", ((float*)pResFast)[0], ((float*)pResFast)[1]);
    printf("None: %f, %f\n", ((float*)pResNone)[0], ((float*)pResNone)[1]);

    return 0;
}

AVX platform output:

Accurate: 0.497964, 0.496415
Fast: 0.496592, 0.496415
None: 0.497964, 0.496415

non-AVX platform output:

Accurate: 0.496592, 0.496415
Fast: 0.496592, 0.496415
None: 0.496592, 0.496415

My IPP version should be v7.0.x which is contained in Intel® Parallel Composer 2011 Update 9

0 Kudos
1 Reply
Chao_Y_Intel
Moderator
521 Views
Hello Paul, Thanks for your report. We are working with engineer owner to have some further check. regards, Chao
0 Kudos
Reply