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

standard deviation of large vector in ippsStdDev_32f is zero

zhulei2017
初学者
2,248 次查看

hello, 

I use the ippsStdDev_32f with "ippAlgHintFast" mode to calculate standard deviation of a vector. It seems than the standard deviation value is zero when the length of vector is greater than 10000(maybe 8192). For comparison, the standard deviation value in ippsMeanStdDev_32f is not zero with the same parameters. 

It was described in the document that "ippAlgHintFast is faster but less accurate calculation". However, is it bug to have a result of zero in ippsStdDev_32f?

 

I am using IPP version 2021.7.0, windows10 1809, visual studio 2019.

I tested three hint mode of both two functions in c++:

int iSrcLength = 10000;
float fStdDevValue = 123.0f; //initialize
float fMeanValue = 123.0f; //initialize
std::unique_ptr<float[]> pInput(new float[iSrcLength]);
for (int idx = 0; idx < iSrcLength; ++idx)
{
    pInput[idx] = static_cast<float>(idx);
}
std::cout << "the length of the vector is: " << iSrcLength << std::endl;
if (ippStsNoErr != ippsStdDev_32f(pInput.get(), iSrcLength, &fStdDevValue, ippAlgHintNone))
{
    std::cout << "ERROR:ippsStdDev_32f" << std::endl;
}
std::cout << "StdDev Value in ippsStdDev_32f() with ippAlgHintNone:" << fStdDevValue << std::endl;
    
if (ippStsNoErr != ippsStdDev_32f(pInput.get(), iSrcLength, &fStdDevValue, ippAlgHintFast))
{
    std::cout << "ERROR:ippsStdDev_32f" << std::endl;
}
std::cout << "StdDev Value in ippsStdDev_32f() with ippAlgHintFast:" << fStdDevValue << std::endl;

if (ippStsNoErr != ippsStdDev_32f(pInput.get(), iSrcLength, &fStdDevValue, ippAlgHintAccurate))
{
    std::cout << "ERROR:ippsStdDev_32f" << std::endl;
}
std::cout << "StdDev Value in ippsStdDev_32f() with ippAlgHintAccurate:" << fStdDevValue << std::endl;

if (ippStsNoErr != ippsMeanStdDev_32f(pInput.get(), iSrcLength, &fMeanValue, &fStdDevValue, ippAlgHintNone))
{
    std::cout << "ERROR:ippsMeanStdDev_32f" << std::endl;
}
std::cout << "StdDev Value in ippsMeanStdDev_32f() with ippAlgHintNone:" << fStdDevValue << std::endl;

if (ippStsNoErr != ippsMeanStdDev_32f(pInput.get(), iSrcLength, &fMeanValue, &fStdDevValue, ippAlgHintFast))
{
    std::cout << "ERROR:ippsMeanStdDev_32f" << std::endl;
}
std::cout << "StdDev Value in ippsMeanStdDev_32f() with ippAlgHintFast:" << fStdDevValue << std::endl;

if (ippStsNoErr != ippsMeanStdDev_32f(pInput.get(), iSrcLength, &fMeanValue, &fStdDevValue, ippAlgHintAccurate))
{
    std::cout << "ERROR:ippsMeanStdDev_32f" << std::endl;
}
std::cout << "StdDev Value in ippsMeanStdDev_32f() with ippAlgHintAccurate:" << fStdDevValue << std::endl;

 results:

the length of the vector is: 10000
StdDev Value in ippsStdDev_32f() with ippAlgHintNone:2886.9
StdDev Value in ippsStdDev_32f() with ippAlgHintFast:0
StdDev Value in ippsStdDev_32f() with ippAlgHintAccurate:2886.9
StdDev Value in ippsMeanStdDev_32f() with ippAlgHintNone:2886.9
StdDev Value in ippsMeanStdDev_32f() with ippAlgHintFast:2886.9
StdDev Value in ippsMeanStdDev_32f() with ippAlgHintAccurate:2886.9

 

标签 (1)
0 项奖励
5 回复数
VidyalathaB_Intel
主持人
2,201 次查看

Hi Lei,

 

Thanks for reaching out to us and bringing up this issue.

I could reproduce the issue in the Windows environment with large vector size and could see the mismatch in the results same as yours

 

the length of the vector is: 10000
StdDev Value in ippsStdDev_32f() with ippAlgHintNone:2886.9
StdDev Value in ippsStdDev_32f() with ippAlgHintFast:0
StdDev Value in ippsStdDev_32f() with ippAlgHintAccurate:2886.9
StdDev Value in ippsMeanStdDev_32f() with ippAlgHintNone:2886.9
StdDev Value in ippsMeanStdDev_32f() with ippAlgHintFast:2886.9
StdDev Value in ippsMeanStdDev_32f() with ippAlgHintAccurate:2886.9

 

But the same code when tried running in a Linux environment the results are the same for both APIs

VidyalathaB_Intel_0-1671531405683.png

 

Anyways we will update you with the reason behind the mismatch in the results of standard deviation on Windows and till then we appreciate your patience.

 

Regards,

Vidya.

 

0 项奖励
zhulei2017
初学者
2,152 次查看

Hi Vidya,

 

Thanks for your reply. I haven't tried it in a Linux environment. But, in Windows IPP version 2019.0.4, the results are the same as Linux environment. If there is any update on this issue, please let me know, thanks.

 

Regards,

Lei.

0 项奖励
VidyalathaB_Intel
主持人
2,101 次查看

Hi Lei,


>>If there is any update on this issue, please let me know, thanks.


Sure, we will get back to you if there is any update on this issue and till then we appreciate your patience.


Regards,

Vidya.


0 项奖励
VarshaS_Intel
主持人
1,819 次查看

Hi Lei,

 

Thanks for your patience.

 

The issue raised by you has been fixed in the Intel IPP version 2021.10 which is the latest version and you can download the latest version by using this link Could you please try with the latest version of IPP and let us know if your issue still persists?

 

Have a Good Day!

 

Thanks & Regards,

Varsha

 

 

0 项奖励
VarshaS_Intel
主持人
1,740 次查看

Hi @zhulei2017,

 

We have not heard back from you. The issue raised by you has been fixed in the Intel IPP version 2021.10 which is the latest version and you can download the latest version by using this link 

 

Have a Good Day!

 

Thanks & Regards,

Varsha

 

0 项奖励
回复