There are several important functions to simplify using Intel® IPP and give you information about how it is working. These cover return status, system/library queries, memory allocations, and denormalization.
There are many errors and warning messages in Intel® IPP. The ippGetStatusString function decodes the numeric status return value to human readable text.
IppStatus st = ippsAddC_16s_I (3, 0, 0); printf(“%d : %s\n”, st, ippGetStatusString(st));The values are also available in ippdefs.h, but this can greatly simplify error reporting and debugging.
Each domain has a GetLibVersion function which returns information about the library layer dispatched.
const IppLibraryVersion* lib = ippiGetLibVersion();
printf(“%s %s %d.%d.%d.%d\n”, lib->Name, lib->Version,
lib->major, lib->minor, lib->majorBuild, lib->build);
This is often helpful in determining what layer of IPP is executing. If used in combination with ippInitCpu this can be a powerful tool for comparing the output of different implementations on the same machine.
You should also be able to see a change in library version reported after ippInit() when using static linking on a recent machine. This initialization enables the dispatcher to determine the best library layer for your system. Without ippInit the function calls should still work, but using the lowest available optimization level.
Intel IPP functions perform better if they process data with aligned pointers.
The following Intel IPP functions can be used for pointer alignment, memory allocation and deallocation:
void* ippAlignPtr(void* ptr, int alignBytes)Aligns a pointer, can align to the powers of 2, that is 2, 4, 8, 16 and so on.
void* ippMalloc(int length)32-byte aligned memory allocation. Memory can be freed only with the function ippFree.
void ippFree(void* ptr)
frees memory allocated by the function ippMalloc.
Ipp<datatype>* ippsMalloc_<datatype>(int len)
32-byte aligned memory allocation for signal elements of different data types. Memory can be freed only with the function ippsFree.
void ippsFree(void* ptr)
Frees memory allocated by the function ippsMalloc.
Ipp<datatype>* ippiMalloc_<mod>(int widthPixels, int heightPixels, int* pStepBytes)
32-byte aligned memory allocation for images where every line of the image is padded with zeros. Memory can be freed only with the function ippiFree.
void ippiFree(void* ptr)
Frees memory allocated by the function ippiMalloc.
The amount of memory that can be allocated is determined by the operating system and system hardware, but it cannot exceed 2GB.
Intel IPP functions ippFree, ippsFree, and ippiFree can only be used to free memory allocated by the functions ippMalloc, ippsMalloc, and ippiMalloc respectively
Intel IPP functions ippFree, ippsFree, and ippiFree cannot be used to free memory allocated by standard functions like malloc or calloc. The memory allocated by the Intel IPP functions ippMalloc, ippsMalloc, and ippiMalloc cannot be freed by the standard function free