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

How to use ippInitCpu(ippCpuSSE3) in IPP 9.0

sumit_j_
Beginner
711 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
711 Views

I think you need ippSetCpuFeatures.

0 Kudos
sumit_j_
Beginner
711 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

0 Kudos
Shaojuan_Z_Intel
Employee
711 Views

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

0 Kudos
sumit_j_
Beginner
711 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

 

0 Kudos
Igor_A_Intel
Employee
711 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

0 Kudos
sumit_j_
Beginner
711 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

 

0 Kudos
Igor_A_Intel
Employee
711 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 

0 Kudos
Reply