CPU Properties Problem

CPU Properties Problem

Portrait de adem metin cali

Hi all,

I have a i7-Q720 cpu.But when i run the code that is in attachment and i find it in the Intel Ipp7.1 users guide,i see wrong informations.According to the code's output,my cpu does not support SSE2,SSE3,SSSE3,SSE41 and SSE42.But according to the intel web page(http://ark.intel.com/products/43122/Intel-Core-i7-720QM-Processor-6M-Cac...), i have SSE42 instruction set.I use visual studio 12 and ipp7.1.1(r37466).What is the reason of this situation???

Adem Metin CALI

Fichier attachéTaille
Téléchargement code.png24.23 Ko
24 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Sergey Kostrov

Please take a look at a comment in ippcore.h header file:

...
/*
// Name: ippGetEnabledCpuFeatures
// Purpose: Detects unabled features for loaded libraries
// Returns: Features mask
// Features mask values are defined in the ippdefs.h
...
*/
IPPAPI( Ipp64u, ippGetEnabledCpuFeatures, ( void ) )
...

i7-Q720 CPU supports SSE2, SSE3, SSSE3, SSE41 and SSE42 instruction sets.

Portrait de adem metin cali

Hi Sergey,

First of all thanks for your interest.I looked in ippcore.h and i understand what you meant.When i run the program with default linking method and multithreaded static library,i get wrong results,but when i run the program with single threaded static library, iget right result.Is it about that multithreaded static library is deprecated???

Adem Metin CALI

Portrait de Sergey Kostrov

>>...when i run the program with single threaded static library, iget right result.Is it about that multithreaded static
>>library is deprecated?

It is very strange and results should be identical.

Portrait de adem metin cali

No Sergey, results are not identical,i checked it twice.When i run the program with default linking method or multithreaded static linking,i get wrong results.But when irun the program with single threaded linking method,i get the right results.

Adem Metin CALI

Portrait de Sergey Kostrov

Please post a final version of your test-case. Thanks in advance.

Portrait de adem metin cali

Thanks again for your interest and sorry for my delay Sergey.I put the screenshots  of the exes and the codes.You can easily understand their linking methods with their names.And good luck with that...

Adem Metin CALI

Fichiers joints: 

Portrait de Sergey Kostrov

Could you try to do it in a different way ( or something like this )?

[ Additional Test 1 ]
...
... (( fn & ippCPUID_SSE2 ) != 0) ? 'Y' : 'N'...
... (( fn & ippCPUID_SSE3 ) != 0) ? 'Y' : 'N'...
... (( fn & ippCPUID_SSSE3 ) != 0) ? 'Y' : 'N'...
... (( fn & ippCPUID_SSE41 ) != 0) ? 'Y' : 'N'...
... (( fn & ippCPUID_SSE42 ) != 0) ? 'Y' : 'N'...
...

or

[ Additional Test 2 ]
...
ipp32u iMask = ( ipp32u )fn;
... (( iMask & ippCPUID_SSE2 ) != 0) ? 'Y' : 'N'...
... (( iMask & ippCPUID_SSE3 ) != 0)? 'Y' : 'N'...
... (( iMask & ippCPUID_SSSE3 ) != 0) ? 'Y' : 'N'...
... (( iMask & ippCPUID_SSE41 ) != 0) ? 'Y' : 'N'...
... (( iMask & ippCPUID_SSE42 ) != 0) ? 'Y' : 'N'...
...

Take into account that explicit '... != 0' is used.

It also makes sense to verify the same bits extractions in VS Watch Window. It is still Not clear if this is a bug in IPP or in Microsoft C++ compiler.

Portrait de adem metin cali

Hi Sergey,

i run the tests and results are same.Without single threaded static library i can not see the right properties of my cpu.i put the results screen shots in attachment.

Adem Metin CALI

Fichiers joints: 

Portrait de Sergey Kostrov

Thank for the update and I will take a look at your test case next week.

Portrait de adem metin cali

I thank you Sergey.You strive very much.I think that this situation is about deprecation of multithraded version of ipp.

Adem Metin CALI

Portrait de Sergey Kostrov

>>...I think that this situation is about deprecation of multithraded version of ipp.

A deprecation period for some functionality is for about 2 years. Even if some IPP functions are marked as deprecated it doesn't mean that they are removed. However some issues are always possible. I'll keep you informed about results of my tests.

Portrait de Sergey Kostrov

I think you're mixing support of some Intel instruction sets for a CPU with support of some Intel instruction sets for IPP library.

For example, let's say you have a latest Intel CPU, like Haswell, which supports all officially released Intel instruction sets. When it comes to IPP at a lowest level different Waterfall DLLs could be used and because of this calls to ippGetEnabledCpuFeatures will show what features of IPP (!) are supported after some Waterfall DLL is loaded ( but something is wrong in case of static linking / you're right here ).

In another words, ippGetCpuFeatures is for detecting supported Intel instruction sets, or features, and ippGetEnabledCpuFeatures is for detecting supported Intel instruction sets in IPP, once again, because different Waterfall DLLs could be used with the same application in case of dynamic linking ( again, something is wrong in case of static linking / you're right here ).

Portrait de Sergey Kostrov

Continued...

I created my own test-case and tested it on two systems with Ivy Bridge and Pentium 4 CPUs using Intel C++ compilers v12.x and v13.x. I confirm that something is wrong and here are results:

Outputs on an Ivy Bridge system:

IPP version: 7.1.1

[ Dynamic linking built with ICC v13.x ]

Is IPP SSE feature enabled: 1
Is IPP SSE2 feature enabled: 0
Is IPP SSE3 feature enabled: 0
Is IPP SSE4.1 feature enabled: 0
Is IPP SSE4.2 feature enabled: 0

[ Static linking built with ICC v13.x ]

Is IPP SSE feature enabled: 1
Is IPP SSE2 feature enabled: 1
Is IPP SSE3 feature enabled: 1
Is IPP SSE4.1 feature enabled: 1
Is IPP SSE4.2 feature enabled: 1

Outputs on a Pentium 4 system:

IPP version: 7.0.205

[ Dynamic linking built with ICC v12.x ]

Is IPP SSE feature enabled: 1
Is IPP SSE2 feature enabled: 0
Is IPP SSE3 feature enabled: 0
Is IPP SSE4.1 feature enabled: 0
Is IPP SSE4.2 feature enabled: 0

[ Static linking built with ICC v12.x ]

Is IPP SSE feature enabled: 1
Is IPP SSE2 feature enabled: 1
Is IPP SSE3 feature enabled: 0
Is IPP SSE4.1 feature enabled: 0
Is IPP SSE4.2 feature enabled: 0

A test-case is attached.

Fichiers joints: 

Fichier attachéTaille
Téléchargement test040.cpp1.85 Ko
Portrait de Sergey Kostrov

>>...i see wrong informations.According to the code's output,my cpu does not support SSE2,SSE3,SSSE3,
>>SSE41 and SSE42...

I'd like to go back to your first question and my question is: What do you want to verify, that is, supported Intel CPU instruction sets or supported IPP features?

Portrait de adem metin cali

Hi Sergey,

According to Intel Integrated Performance Primitives for Windows* OS User's Guide IPP7.1 (318254-016US) on page 15 and 16,the output of the example code is the hardware optimizations used by this library layer.Actually, i want to see the supported intel cpu instruction sets because my cpu is older than ipp version.

I know that this question is irrelevant but why do you use scope resolution operator  with ippInit function??? does it have a special purpose???As i know ipp is a C library and every function that you include  in your source file is in global scope.In addition scope resolution operator is a C++ operator.                                                                                                                                                                                     Thanks again for your interest.With my best regard.

Adem Metin CALI

Portrait de Sergey Kostrov

>>...i want to see the supported intel cpu instruction sets...

In that case use ippGetCpuFeatures function.

Portrait de Sergey Kostrov

>>...i want to see the supported intel cpu instruction sets...

In that case use ippGetCpuFeatures function.

Portrait de adem metin cali

Ok, I understood that ippGetEnabledCpuFeatures gives the supported cpu features for library and ippGetCpuFeatures  gives the cpu features.My first question is that am i wrong for my first sentence and second question is that does intel gurantees performance  with a upper instruction set ???

Adem Metin CALI

Portrait de Sergey Kostrov

You should use ippStaticInit or ippInit for automatic selection the highest Intel instruction set supported by a CPU. If automatic selection is Not needed ( a developer controls initialization ) then ippStaticInitCpu or ippInitCpu need to be used.

Also, take a look at ippEnableCpu since it allows to select a target CPU ( see enumeration IppCpuType in ippdefs.h )

>>...does intel gurantees performance with a upper instruction set ?..

Yes.

Portrait de Sergey Kostrov

>>...I know that this question is irrelevant but why do you use scope resolution operator with ippInit function?

It is a matter of coding standards and you could ignore it.

Portrait de adem metin cali

Hi Sergey,

Thanks your reply.Can you give me more detail about your coding standards?? is it your coding habits or is it documented ???

Adem Metin CALI

Portrait de Sergey Kostrov

In overall, I follow ( and convince everybody to follow ) a Hungarian notation created by Microsoft software developers many years ago ( ~20+ ).

Portrait de adem metin cali

Actually i use Bjarne Stroustrups C++ Style and Technique FAQ to build my develop and he does not suggest Hungarian Notation so i didn't examine Hungarian Notation.Thanks your reply and interest.

Adem Metin CALI

Connectez-vous pour laisser un commentaire.