Hi,
I call ippDotProd function with the same arguments and get different outputs from run to run.
Code example:
#include "stdafx.h"
#include <ipp.h>
#include <iostream>
#include <conio.h>
#include <vector>
void Test()
{
static const int NTAPS = 163;
std::vector<Ipp32fc> data(NTAPS, { 100.0f, 500.012346f });
std::vector<Ipp32f> taps(NTAPS, 1.0f);
Ipp32fc dp;
auto status = ippsDotProd_32f32fc(taps.data(), data.data(), NTAPS, &dp);
char str[100];
sprintf_s(str, "dp.im = %.8f", (double)dp.im);
std::cout << str;
}
int main()
{
Test();
_getch();
return 0;
}
Output:
dp.im = 81502.06250000
or
dp.im = 81502.02343750
I use:
IPP Version 2019 Update 3
Microsoft Visual Studio Professional 2017
Windows 10
Intel Core i5-9600K CPU @ 3.70GHz 3.70 GHz
I running example in debug. Release always print
dp.im = 81502.06250000
Thank you for reporting the issue. We will investigate this at our end and get back to you with an update.
Evgeny,
Please try to check if the problem would exist in the case of allocated memory aligned. It could be easily done by using if the ippsMalloc_32fc, ippsMalloc_32f, and ippsFree IPP functions.
Gennady
Gennady,
Thank you for answer. I tried to test with ippMalloc/ippFree functions. And I got a stable results from run to run. Debug always print dp.im = 81502.02343750.
I try also \Zp16 option for Visual C++ compiler and also get different results from run to run in the original test with std::vector.
Tell me please 1) why the results can differ in debug/release 2) why \Zp16 option didn't help me.
For more complete information about compiler optimizations, see our Optimization Notice.