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

Multithreading

li__steve
Beginner
563 Views
I am trying to use theIPP multithreaded library. I wrote a console app and have a loop to keep calling one function, specifically ippiResizeSqrPixel_8u_C1R(). But Task Manager is reporting thatmy app isonly using one thread. I am wondering if I have my app setup incorrectly.

I am using Microsoft Visual Studio 2008. I put _IPP_PARALLEL_STATIC in my preprocessor definitions, and it seems to be linking the *_t libraries. Is that all I need? When I look at the dependency of my console app, I do not see the OpenMPdll asa dependency. Is that normal?

Here is my console app:

#include "stdafx.h"

#include

int _tmain(int argc, _TCHAR* argv[])

{

IppStatus status;

int widthIn = 1920;

int heightIn = 1080;

int widthOut = 720;

int heightOut = 480;

int interpolation = IPPI_INTER_CUBIC2P_BSPLINE;

const Ipp8u *pSrc = (Ipp8u*)ippMalloc( widthIn * heightIn );

IppiSize srcSize = { widthIn, heightIn };

Ipp8u *pDst = (Ipp8u*)ippMalloc( widthOut * heightOut );

IppiSize dstSize = { widthOut, heightOut };

IppiRect srcRoi = { 0, 0, widthIn, heightIn, };

IppiRect dstRoi = { 0, 0, widthOut, heightOut, };

int srcStep = widthIn;

int dstStep = widthOut;

const double xFactor = (double)widthOut / widthIn;

const double yFactor = (double)heightOut / heightIn;

int workBufferSize = 0;

status = ippiResizeGetBufSize( srcRoi, dstRoi, 1, interpolation, &workBufferSize );

ASSERT( ippStsNoErr == status );

Ipp8u *pWorkBuffer = (Ipp8u*)ippMalloc( workBufferSize );

ASSERT( pWorkBuffer != NULL );

for( int n=0; ; n++ )

{

status = ippiResizeSqrPixel_8u_C1R( pSrc, srcSize, srcStep, srcRoi, pDst, dstStep, dstRoi, xFactor, yFactor, 0, 0, interpolation, pWorkBuffer );

ASSERT( ippStsNoErr == status );

}

return 0;

}

Your help is appreciated.
Steve

0 Kudos
3 Replies
Thomas_B_3
Beginner
563 Views
Hi Steve,

did you check wether the functions you are using are threaded at all (esp. ippiResizeSqrPixel_xyz)?? See ThreadedFunctionsList.txt in the IPP-documentation.

BEst regards,
TJ

0 Kudos
li__steve
Beginner
563 Views
I found the problem. I forgot to call ippStaticInit().
0 Kudos
Naveen_G_Intel
Employee
563 Views
Hi Steve,
You are right, ippStaticInit() need to call. This function sets the most appropriate processor-specific static code of the Intel IPP software.

Thanks,
Naveen Gv
0 Kudos
Reply