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

Maximum Size of Float Image in ippiCrossCorrValid

rsapaico
Beginner
1,451 Views
Hello,
I hope somebody can help me with the following.
I am using Intel IPP 6.1, and I am running on Windows 7 x64 (16GB of memory).
I am trying to use the "ippiCrossCorrValid_NormLevel_8u32f_C1R" function; however, it returns the following error:ippStsMemAllocErr (Not enough memory allocated for the operation).
I have searched in the forum; however I haven't been able to find anything with regard to this problem.
The relevant part of my code is something like (the pointers to the sample and template have been defined previously without any problem):
[cpp]IppStatus ippsta; IppSize ippszSam = {16443,3284}; int iStepSam = ippszSam.width; IppSize ippszTmpl = {4899,3280}; int iStepTmpl = ippszTmpl.width; int iXncc = ippszSam.width - ippszTmpl.width + 1; // result width int iYncc = ippszSam.height - ippszTmpl.height + 1; // result height int iStepncc = iXncc * sizeof(float); // result step size IppiSize ippszncc = { iXncc , iYncc }; std::vector vfNCC( iXncc * iYncc ); // result container float* pfNCC = &(vfNCC[0]); // Calling the correlation routine ippsta = ippiCrossCorrValid_NormLevel_8u32f_C1R( pucSam, iStepSam, ippszSam, pucTemplate, iStepTmpl, ippszTmpl, pfNCC, iStepncc );[/cpp]
I have seen in the following page that the maximum allowed size for an image should be ~2^29:
However, in this case, even if the Sample image is converted to float, it will require less than 2^28 bytes (16443 x 3284 x 4 bytes).
Therefore, I don't have it clear why the IPP function is returning the "ippStsMemAllocErr" status. So, I would like to ask a couple of things:
1. For the above function, and the above image sizes, what is the number of bytes allocated in memory? Is my assumption correct?
2. Is the maximum allowed size actually ~2^29 bytes?
If so, why is the call to the IPP functions returning an error?
If not, then which is the maximum allowed size when dealing with images?
If there is any other information that I may have missed, please kindly let me know.
Thank you very much in advance for your kind cooperation.
Best regards,
Luis
0 Kudos
1 Solution
igorastakhov
New Contributor II
1,451 Views
Hi ALL,

I see your problems - the main issue here is IPP API constrains - first of all IPP uses it's own malloc that is just a wrapper over runtime malloc - and the 1st constrain is that ippMalloc has int parameter for allocation size - so you (and we internally) can't allocate more than 2Gb; second - ippiCrossCorr API constrains - there is a plan to remove any internal memory allocations in the future IPP versionsand to provide additional parameter for all functions that require additional memory buffer - pBuffer - so it will be customer responsibility on providing required memory buffers according to ippiCrossCorrGetBufferSize() (also planned).

PS just for Sergey K: actually there is no full-size buffer for transposition - after allFFT by rows done - only 4 - 16 columns are transposed at once (depends on arch and cache size) - sothe cyclic buffer for this purpose is rather small.

Regards,
Igor

View solution in original post

0 Kudos
22 Replies
igorastakhov
New Contributor II
1,452 Views
Hi ALL,

I see your problems - the main issue here is IPP API constrains - first of all IPP uses it's own malloc that is just a wrapper over runtime malloc - and the 1st constrain is that ippMalloc has int parameter for allocation size - so you (and we internally) can't allocate more than 2Gb; second - ippiCrossCorr API constrains - there is a plan to remove any internal memory allocations in the future IPP versionsand to provide additional parameter for all functions that require additional memory buffer - pBuffer - so it will be customer responsibility on providing required memory buffers according to ippiCrossCorrGetBufferSize() (also planned).

PS just for Sergey K: actually there is no full-size buffer for transposition - after allFFT by rows done - only 4 - 16 columns are transposed at once (depends on arch and cache size) - sothe cyclic buffer for this purpose is rather small.

Regards,
Igor
0 Kudos
SergeyKostrov
Valued Contributor II
158 Views
Quoting igorastakhov
...the 1st constrain is that ippMalloc has int parameter for allocation size - so you (and we internally) can't allocate more than 2Gb...

Igor,

Is that a restriction for32-bit and 64-bit platforms, or for 32-bit platforms only?

Best regards,
Sergey
0 Kudos
Reply