How to use ippInitCpu(ippCpuSSE3) in IPP 9.0

How to use ippInitCpu(ippCpuSSE3) in IPP 9.0

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

 

 

publicaciones de 8 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

I think you need ippSetCpuFeatures.

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

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

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

 

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

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

 

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 

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya