IPP and dlopen()

IPP and dlopen()

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);
     ippsFFTGetSize_C_64fc_t ptr_ippsFFTGetSize_C_64fc= (ippsFFTGetSize_C_64fc_t)dlsym(handle, "ippsFFTGetSize_C_64fc");
     if ((error = dlerror()) != NULL)  {
         fputs(error, stderr);
    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?

2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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.


Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!