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

IPP and dlopen()

wwalas
Beginner
350 Views

Hi, I`m quite new to IPP. While I`ve been reading docs about linking against IPP one question emerged.
For educational purposes I`ve written code that uses dlopen() interface to obtain IPP routines.

    std::string ippcore ("/opt/intel/ipp/lib/ia32/libippcore.so.7.1");
    std::string ipps ("/opt/intel/ipp/lib/ia32/libipps.so.7.1");
     typedef IppStatus (*ippsFFTGetSize_C_64fc_t)(int, int, IppHintAlgorithm, int*, int*, int*);
     char *error;
     void *handle = dlopen (ipps.c_str(), RTLD_LAZY);
     if (!handle) {
         fputs (dlerror(), stderr);
         exit(1);
     }
     ippsFFTGetSize_C_64fc_t ptr_ippsFFTGetSize_C_64fc= (ippsFFTGetSize_C_64fc_t)dlsym(handle, "ippsFFTGetSize_C_64fc");
     if ((error = dlerror()) != NULL)  {
         fputs(error, stderr);
         exit(1);
     }
    if (ptr_ippsFFTGetSize_C_64fc(logN_samples, IPP_FFT_NODIV_BY_ANY, ippAlgHintAccurate, &specSize, &specBufferSize, &workBufferSize) != ippStsNoErr)
        std::cout<<"ERROR: Cannot retrieve FFT structures sizes\n"<<std::endl;

My questions are:

1. Is it proper way of using IPP?

2. When calling ptr_ippsFFTGetSize_C_64fc, is the called routine C-optimized or CPU-optizmied?

0 Kudos
1 Reply
Sergey_K_Intel
Employee
350 Views
Hi! For me - i don't know the dispatcher well - it's hard to say for sure. I would suppose, that CPU-omptimized functions will be called anyway. But, you can make the same experiment with ippsGetLibVersion function and printout the library version string returned. Regards, Sergey
0 Kudos
Reply