|
Thank you, but the request is to get this value from registry, not from API.
|
|
|
|
|
The information can also be found by the following powershell command:
PS C:\Users\rjmac> Get-WmiObject Win32_Processor
Caption : Intel64 Family 6 Model 142 Stepping 9
DeviceID : CPU0
Manufacturer : GenuineIntel
MaxClockSpeed : 2701
Name : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
SocketDesignation : U3E1
|
|
|
|
|
Yes, I could do that even with cmd, but I need to do this task with my code (VC++).
|
|
|
|
|
Then I guess the registry key that you already referred is what you need to look at.
|
|
|
|
|
Then someone who has AMD processor could take a look on that location and tell me what value has PROCESSOR_IDENTIFIER key (on location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment ) 
|
|
|
|
|
You could always try and find someone where you are who has an AMD system.
|
|
|
|
|
Maybe it is just a feeling, but is hard to find on someone who has AMD processor.
|
|
|
|
|
What problem are you actually trying to solve?
|
|
|
|
|
To know what is there, in PROCESSOR_ARCHITECTURE and PROCESSOR_IDENTIFIER from HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment when machine has AMD processor.
|
|
|
|
|
Yes, but what problem are you actually trying to solve?
|
|
|
|
|
To know from registry if the machine has AMD or Intel processor. I guess is possible that.
|
|
|
|
|
OK, last try: what actual problem are you trying to resolve? Knowing whether it is AMD or Intel will not make any difference to the execution of your application, so I can only assume that you have found some other issue which you are keeping secret from us.
|
|
|
|
|
Richard, I am sorry if I was evasive ... Thank you for your patience.
I am working on some code which execute some depending of what kind of processor:
BOOL bIsIntel = FALSE;
SYSTEM_INFO si;
GetSystemInfo(&si);
bIsIntel = (si.wProcessorArchitecture == xxx);
if(bIsIntel)
{
}
else
{
}
Furthermore, the code is critical as speed of execution. So, I noticed that GetSystemInfo is taking a time, specially on older machines. So, I intend to retrieve from registry if the machine is AMD or Intel. That is all. I am not hiding anything. If I omitting anything, please tell me, and I will write here.
P.S. I don't have any AMD machine, or my colleagues ... if I would, I had tested myself.
|
|
|
|
|
_Flaviu wrote: I noticed that GetSystemInfo is taking a time That is most likely because it has to go to the registry to get the information. You have placed that code in the wrong place. It should be called once at the beginning of the program to set a global or class variable that can then be tested at processor speed.
However, the chances of you being able to adjust the speed of your code at the point you show is not very likely. The compiler will optimise any code as much as possible, and whichever processor executes that code will further optimise it through the use of its own pipelining mechanism. Your time would be better spent working on real problems.
|
|
|
|
|
One way would be to run a registry-watching program (e.g., Process Explorer) while this piece of code executes. Then you can see what key(s) are being read.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Very good idea. I think I would try this solution too, however, the location from HARDWARE\... seem to show what I need it.
|
|
|
|
|
What if the underlying API retrieved the information from the registry?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
That is why I guess I can get this information directly from registry, not from API. It is a presume though ...
|
|
|
|
|
You can find the vendor identifier with CPUID. The same mechanism can be used to find out what features the CPU supports, which is normally more useful than merely knowing the vendor, obviously it depends on what you want.
|
|
|
|
|
- As someone already mentioned, the CPUID instruction gives you this information. It may be called using compiler intrinsics (#include <intrin.h>) on the Microsoft compiler. See here for fuller documentation. Pay attention to the EAX=0 function (Get Manufacturer ID).
- It appears that the same information may be found in the Registry at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\VendorIdentifier
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
|
please, help me .i cant find the 1000 factorial program.
|
|
|
|
|
Assuming you mean 1 * 2 * 3 * ... * 998 *999 * 1000, then I have bad news for you. The result when written out has 2568 digits in all. That is far more than even a 64 bit integer can express. So, either you have misunderstood your assignment, or you are supposed to be working with some arbitrary precision library. In either case, we don't do homework for you. If you have tried something and are stuck, we're happy to help point you in the right direction.
|
|
|
|
|
You may have a look at boost multiprecision library . This page gmp_int - 1.58.0[^] looks promising (see the code sample).
|
|
|
|
|
It's in the top cupboard by the door.
|
|
|
|