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

CrossCorrNormGetBufferSize returns ippStsNoErr and pBufferSize = 0

bluqu
Beginner
2,204 Views

Provided the following inputs, the CrossCorrNormGetBufferSize function returns ippStsNoErr and pBufferSize = 0:

  • src1Len = 205
  • src2Len = 1632
  • dstLen = 1632
  • lowLag = 0
  • dataType = ipp32fc
  • algType = ippsNormNone

Is this an expected result? Follow on calls to the CrossCorrNorm function with pBufferSize = 0 result in an output of all zeros. Are there restrictions on the input parameters to this function?

0 Kudos
1 Solution
ShanmukhS_Intel
Moderator
1,839 Views

Hi,

 

The get buffer size API sometimes returns 0 depending on input length. IPP internally calculates whether it is expected to allocate buffer size or not. As a test sample, if you change src1Len = 205 to more than 255, for example, set src1Len = 256, then you can get the size of the buffer would not be zero anymore.

 

In addition, you could test the example provided in this link, print the buffer size before ippsMalloc and you could see the buffer size as 0 and you could see the correct results as well.

 

Best Regards,

Shanmukh.SS

 

 

View solution in original post

0 Kudos
8 Replies
ShanmukhS_Intel
Moderator
2,173 Views

Hi,

 

Thanks for posting in Intel communities.

 

Could you please share with us the IPP version details, environment details, and complete source code, so that it helps us in analyzing the issue better?

 

Best Regards,

Shanmukh.ss

 

0 Kudos
bluqu
Beginner
2,162 Views

I tested 2 different versions of IPP: 2017.0.1 (r53196) and 2019.0.3 (r61817). Both version showed the same result.

 

I am developing on a CentOS 7 system and compiling with devtoolset-11 (gcc 11.2.1)

 

The below source code replicates the behavior I am seeing:

#include "ipp.h"
#include <stdio.h>
int main()
{
int src1Len = 205;
int src2Len = 1632;
int dstLen = 1632;
int bufSize = 0;
int lowLag = 0;
IppStatus status = ippsCrossCorrNormGetBufferSize(src1Len, src2Len, dstLen, lowLag, ipp32fc, ippsNormNone, &bufSize);

printf("%s \n", ippGetStatusString(status));
printf("bufSize %i \n", bufSize);

return 0;
}

The output I am seeing is:

ippStsNoErr: No errors
bufSize 0

 

0 Kudos
ShanmukhS_Intel
Moderator
2,072 Views

Hi,


Thanks for sharing the sample reproducer.


We are able to reproduce it on our end. We will get back to you soon with an update.


Best Regards,

Shanmukh.SS



0 Kudos
ShanmukhS_Intel
Moderator
2,017 Views

Hi Brandon,


In continuation of the earlier thread, could you please let us know the compilation command used for the compilation of your code?


Best Regards,

Shanmukh.SS



0 Kudos
bluqu
Beginner
1,946 Views

The compilation command used was:

g++ test.cpp -o ipptest -I <location of ipp.h> -lippi -lipps -lippcore

 

0 Kudos
ShanmukhS_Intel
Moderator
1,840 Views

Hi,

 

The get buffer size API sometimes returns 0 depending on input length. IPP internally calculates whether it is expected to allocate buffer size or not. As a test sample, if you change src1Len = 205 to more than 255, for example, set src1Len = 256, then you can get the size of the buffer would not be zero anymore.

 

In addition, you could test the example provided in this link, print the buffer size before ippsMalloc and you could see the buffer size as 0 and you could see the correct results as well.

 

Best Regards,

Shanmukh.SS

 

 

0 Kudos
bluqu
Beginner
1,814 Views

Thank you. I confirmed that src1Len > 255 does produce buffer sizes > 0.

0 Kudos
ShanmukhS_Intel
Moderator
1,761 Views

Hi,


Thanks for accepting our solution. If you have any other queries, please post a new question as this thread will no loner be monitored by Intel.


Best Regards,

Shanmukh.SS


0 Kudos
Reply