Software Archive
Read-only legacy content
17060 Discussions

How to find if multicore is enabled

anandakumaryg
Beginner
426 Views
Hi,

Could any one help me to check if multicore property is enabled through c++..

Thanks,
Ananda
0 Kudos
4 Replies
gaston-hillar
Valued Contributor I
426 Views
Quoting - anandakumaryg
Hi,

Could any one help me to check if multicore property is enabled through c++..

Thanks,
Ananda

Hi Ananda,

What do you mean with "multicore property"? Do you want to know the number of available physical cores andlogical cores?
Do you want to check whether Hyper-Threading is enabled through C++?

You can use CPUID info to check Hyper-Threading, the number of available physical and logical cores, and more information about the CPU. However, I don't know about a "multicore property".

If you have more than 1 physical core, you have a multicore CPU.

Cheers,

Gaston
0 Kudos
gaston-hillar
Valued Contributor I
426 Views
Quoting - anandakumaryg
Hi,

Could any one help me to check if multicore property is enabled through c++..

Thanks,
Ananda

Hi Ananda,

This post http://software.intel.com/en-us/articles/hyper-threading-technology-multi-core-and-mobile-intel-pentium-processor-m-toolbox/

can help you. It uses C++ and a library to detect logical and physical cores.

It doesn't work with the newest microprocessors. However, today Khang Nguyen (Intel) added a comment telling me there is going to be a new version soon. :)

Hope it helps.

Cheers,

Gastn
0 Kudos
anandakumaryg
Beginner
426 Views
Quoting - Gastn C. Hillar

Hi Ananda,

This post http://software.intel.com/en-us/articles/hyper-threading-technology-multi-core-and-mobile-intel-pentium-processor-m-toolbox/

can help you. It uses C++ and a library to detect logical and physical cores.

It doesn't work with the newest microprocessors. However, today Khang Nguyen (Intel) added a comment telling me there is going to be a new version soon. :)

Hope it helps.

Cheers,

Gastn


Hi Gaston,

Thanks for the reply.

Whether the above mentioned code will work for Intel Xeon processor ? When I ran the HTMCSample.exe. Its not returing correct number of physical processor and number of cores per processor. In my Pc I am having 4 cores and 2 physical processor.

Thanks,
Ananda


0 Kudos
levicki
Valued Contributor I
426 Views
Please tell us the models of your CPUs.

If they are Nehalem based, old detection methods might give wrong results. Unfortunately, last time I checked Intel's documentation wasn't updated to include the proper detection for number of cores on Nehalem CPUs.

Hi there Gaston! How's it going? :)
0 Kudos
Reply