Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
6595 Discussions

How to use ippInitCpu(ippCpuSSE3) in IPP 9.0

sumit_j_
Beginner
268 Views

Hi All,

I have working with code which is using following  IPP-6.0 API

IppStatus status = ippInitCpu(ippCpuSSE3);
 if (status != ippStsNoErr)
 {

     throw IPException(SOURCE, "ippInitCpuFailed - %s", ippGetStatusString(status));

 }

For some reason I am forcing CPU to use SSE3. But the latest ipp library  -IPP_2017_3_210 – doesn’t have these function and neither IPP legacy has this. But, I want to  force CPU to use SSE3 in latest IPP version but I am not getting the right way of doing it. 

I read IppInit() activates CPU based on system configuration but it doesn't talks about forcing some particular setting.

Plz suggest how I can use latest IPP API to achieve same thing.

Regards,

Sumit Jha

 

 

0 Kudos
7 Replies
BMart1
New Contributor II
268 Views

I think you need ippSetCpuFeatures.

sumit_j_
Beginner
268 Views

HI Bruno,

I know that i can use "ippSetCpuFeatures" this get same result  but i don't how to use  it for same. I need some sample/example.

 

Regards,

Sumit Jha

Shaojuan_Z_Intel
Employee
268 Views

ippSetCpuFeatures(ippCPUID_SSE3)? Is this what you are looking for?

sumit_j_
Beginner
268 Views

Hi Shaojuam,

I was using ippSetCpuFeatures(ippCPUID_SSE3) as follows-

status = ippGetCpuFeatures(&cpuMask, 0);
if (ippStsNoErr == status) 
{
enabledCpuMask = ippGetEnabledCpuFeatures();
if ((enabledCpuMask & ippCPUID_SSE3) && (cpuMask & ippCPUID_SSE3))
{
 status = ippSetCpuFeatures( ippCPUID_SSE3);
}
}

But , this is giving error by error status - ippStsFeaturesCombination

so I am using -

Ipp64u M7_FM = ippCPUID_MMX | ippCPUID_SSE | ippCPUID_SSE2 | ippCPUID_SSE3;
status = ippSetCpuFeatures(M7_FM); // ippCPUID_SSE3;

This works fine.

Can you tell me why  "ippSetCpuFeatures( ippCPUID_SSE3);" is failing but other  is working fine.

Regards,

sumit jha

 

Igor_A_Intel
Employee
268 Views

hi Jha,

ippStsFeaturesCombination is not error status - all error statuses are < 0, and warnings are > 0. This warning just tells you that SSE3 can't be enabled solely without SSE and SSE2 and that these features will be enabled too.

regards,Igor

sumit_j_
Beginner
268 Views

Hi Igor,

Thank you for your reply.

Just for clarification, basically you are saying to enable SSE3, I need to enable other dependency too.

Following code does same and hence it is correct.  Am i right ?

Ipp64u M7_FM = ippCPUID_MMX | ippCPUID_SSE | ippCPUID_SSE2 | ippCPUID_SSE3;
status = ippSetCpuFeatures(M7_FM); // ippCPUID_SSE3;

What will happen if I ignore this warning and do only 

status = ippSetCpuFeatures(ippCPUID_SSE3);

Thanks,

Sumit Jha

 

Igor_A_Intel
Employee
268 Views

Hi Sumit Jha,

in this case all previous SSE extensions will be enabled automatically - SSE3 code can't work without SSE2 and SSE as is inherited from them. Therefore you can ignore this warning.

Regards, Igor 

Reply