- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
My problem is wrong output from function ippiFilter_32f_C1R for 64-bit version, for 32-bit version it works correctly
Here is my code:
Ipp32f* convolution(float **a, float **filter, int width, int height, int coreSize, int newWidth, int newHeight)
{
Ipp32f *src1 = new Ipp32f[width * height];
Ipp32f *src2 = new Ipp32f[coreSize * coreSize];
Ipp32f *dst = new Ipp32f[newWidth * newHeight];
IppiSize src1Size = { width, height };
IppiSize src2Size = { coreSize, coreSize };
IppiSize dstSize = { newWidth, newHeight };
IppiPoint anchor = { coreSize - 1 , coreSize - 1 };
int k = 0;
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
src1
k++;
}
}
k = 0;
for (int i = coreSize - 1; i >= 0; i--)
{
for (int j = coreSize - 1; j >= 0; j--)
{
src2
k++;
}
}
ippiFilter_32f_C1R(src1, width * sizeof(Ipp32f), dst, newWidth * sizeof(Ipp32f), dstSize, src2, src2Size, anchor);
delete []src1;
delete []src2;
return dst;
}
The difference between the outputs of this function appears, when width = 19, height = 24, coreSize = 3, newWidth = 17, newHeight = 22
Thanks,
Alexandr
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Alexander, which version of IPP has been used? is that sequential or threaded mode? are there any specific CPU type where the problem happens?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
ipp version 8.2 from Composer XE 2015, sequential mode, microsoft visual c++ compliler, processor Intel Core i5-3450 CPU 3.10 GHz x64, 64bit operation system Windows 10.
Can you test code, which I sent on Win32 and x64 platform with function parameters width = 19, height = 24, coreSize = 3, newWidth = 17, newHeight = 22?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Alexander.
Thanks for using IPP library and your test case.
Could you provide please input data values to understand difference? The small calculation error for float data and different CPU letters is normal situation for IPP. If difference is very big - it can be a bug.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Andrey.
The most simple test:
Look at the function, I sent (first post):
Ipp32f* convolution(float **a, float **filter, int width, int height, int coreSize, int newWidth, int newHeight)
Let width = 19, height = 24, coreSize = 3, newWidth = 17, newHeight = 22, each element of "a" equals 1.0f, each element of "filter" equals 1.0f,
then result of ippiFilter_32f_C1R must be array of 17x22(374) elements, each element equals 9.
I attached result of this function, when I built my test application on x86 configuration and x64.
As you can see, when application was built on x64, some elements equals 9 and some elements uninitialized.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Alexandr, we see the problem with IPP v.8.2.3 between 32 and 64 bits code. This problem has gone with the latest 9.0. update 1. You need slightly modify code because of some ippiFilter_32f_C1R from 8.2. has been replaced by ippiFilterBorderInit_32f+ippiFilterBorder_32f_C1R functions. See the code you need to modify:
#if 0 status = ippiFilter_32f_C1R(src1, width * sizeof(Ipp32f), dst, newWidth * sizeof(Ipp32f), dstSize, src2, src2Size, anchor);
#else
{ Ipp32f borderValue[1] = { 0.0f }; IppiFilterBorderSpec* pSpec; Ipp8u* pBuffer;
int specSize; int bufferSize; Ipp32f* pSrc; Ipp32f* src2Dir;
status = ippiFilterBorderGetSize(src2Size, dstSize, ipp32f, ipp32f, 1, &specSize, &bufferSize);
pSpec = (IppiFilterBorderSpec*)ippsMalloc_8u(specSize);
pBuffer = ippsMalloc_8u(bufferSize); src2Dir = ippsMalloc_32f(src2Size.width*src2Size.height);
for (k = 0; k < src2Size.width*src2Size.height; k++) { src2Dir
status = ippiFilterBorderInit_32f(src2Dir, src2Size, ipp32f, 1, ippRndNear, pSpec);
pSrc = src1 + ((src2Size.height - 1) / 2)*width + (src2Size.width - 1) / 2;
status = ippiFilterBorder_32f_C1R(pSrc, width * sizeof(Ipp32f), dst, newWidth * sizeof(Ipp32f), dstSize, ippBorderInMem, borderValue, pSpec,pBuffer);
ippsFree(pSpec); ippsFree(pBuffer); ippsFree(src2Dir);
}
#endif
