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

IPPiMalloc implementation for windows DDK.

longrider
Beginner
300 Views
I am writing aWindows Driver(WIN DDK) that calls ipp libraries for certain signal processing features. I am developing a memory manager module that implements ippMalloc, ippFree, IppsMalloc_, ippsFree, ippiMalloc_mod ,and ippifree, my memory functions calls windows DDK ExAllocatePoolWithTag and aligns to 32 byte boundary instead of C runtime malloc ,free. I link my functions throuh a object file that overrides theintel supplied memory functions.
Execept ippiMalloc everything is straight forward to implement, in IPPiMalloc_mod function, I understood
stride = width*sizeof(datatype)*no_of_channels, datatype is Ipp8u,Ipp16u,Ipp32u...etc. and the
totalsize to allocate is = stride*height;
1. Is my formula to calculate the size is correct?
2. What is the difference between C4 and AC4 data type difference in memory allocation?.
3. I assume ippiFree is same as ippsfree. is that correct?.
4. Is there any other "special stuff" to take into consideration to implement ippimalloc?
thanks
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
300 Views

Hello,

Note that IPP memory allocation functions do care on providing 32-bytes aligned memory block. Your formulae for calculation of step through the image (stride) is correct.
The implementation of ippMalloc, ippsMalloc and ippiMalloc is close each other but it is recommended to use corresponding functions (if you allocate block with ippsMalloc you need to free it with ippsFree)

You may take a look on IPP Windows kernel mode driver sample provided in IPP sample package.

Regards,
Vladimir
0 Kudos
longrider
Beginner
300 Views

Hello,

Note that IPP memory allocation functions do care on providing 32-bytes aligned memory block. Your formulae for calculation of step through the image (stride) is correct.
The implementation of ippMalloc, ippsMalloc and ippiMalloc is close each other but it is recommended to use corresponding functions (if you allocate block with ippsMalloc you need to free it with ippsFree)

You may take a look on IPP Windows kernel mode driver sample provided in IPP sample package.

Regards,
Vladimir
Thanks vladmir providing the right pointer. I did not see the example code. I was implementing all the ipp*Malloc, but by simple overriding of malloc, calloc, free, realloc itself solves my requirments. Can you answer my other question also?. The effect of IPPstaticInitUsage in Windows Driver.
regds
0 Kudos
Vladimir_Dudnik
Employee
300 Views
Yes, you can use ippStaticInit function in OS kernel mode drivers. The documentation should be updated (it was overlooked somehow at release time)

Vladimir

0 Kudos
Reply