Func ippsMean_32fc Lose Accuracy on AVX Platform

Func ippsMean_32fc Lose Accuracy on AVX Platform

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[i] = (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

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello Paul,

Thanks for your report. We are working with engineer owner to have some further check.


Leave a Comment

Please sign in to add a comment. Not a member? Join today