Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. AMD or Intel

AMD or Intel

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminhardwarearchitecturequestionworkspace
24 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ _Flaviu

    Maybe it is just a feeling, but is hard to find on someone who has AMD processor.

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #11

    What problem are you actually trying to solve?

    _ 1 Reply Last reply
    0
    • L Lost User

      What problem are you actually trying to solve?

      _ Offline
      _ Offline
      _Flaviu
      wrote on last edited by
      #12

      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.

      L 1 Reply Last reply
      0
      • _ _Flaviu

        Thank you, but the request is to get this value from registry, not from API.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #13

        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

        _ 1 Reply Last reply
        0
        • _ _Flaviu

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #14

          Yes, but what problem are you actually trying to solve?

          _ 1 Reply Last reply
          0
          • L Lost User

            Yes, but what problem are you actually trying to solve?

            _ Offline
            _ Offline
            _Flaviu
            wrote on last edited by
            #15

            To know from registry if the machine has AMD or Intel processor. I guess is possible that.

            L 1 Reply Last reply
            0
            • D David Crow

              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

              _ Offline
              _ Offline
              _Flaviu
              wrote on last edited by
              #16

              That is why I guess I can get this information directly from registry, not from API. It is a presume though ...

              1 Reply Last reply
              0
              • _ _Flaviu

                To know from registry if the machine has AMD or Intel processor. I guess is possible that.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #17

                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.

                _ 1 Reply Last reply
                0
                • _ _Flaviu

                  Is there any reliable location in windows registry that tell if the architecture of the machine is AMD or Intel ? If there is, where is this location ? I know this location:

                  HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

                  and Identifier key, but my machine is Intel ... and I don't know what would be this value on AMD case ... is this a reliable location ? P.S. Also, I know that I could find here:

                  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

                  PROCESSOR_ARCHITECTURE has AMD64 value, even if I have Intel machine ...

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #18

                  You can find the vendor identifier with [CPUID](https://docs.microsoft.com/en-us/cpp/intrinsics/cpuid-cpuidex?view=vs-2019). 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.

                  1 Reply Last reply
                  0
                  • L Lost User

                    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.

                    _ Offline
                    _ Offline
                    _Flaviu
                    wrote on last edited by
                    #19

                    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)
                    {
                    // execute some code (I cannot write here what kind of code)
                    }
                    else
                    {
                    // execute else code
                    }

                    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.

                    L D 2 Replies Last reply
                    0
                    • _ _Flaviu

                      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)
                      {
                      // execute some code (I cannot write here what kind of code)
                      }
                      else
                      {
                      // execute else code
                      }

                      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.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #20

                      _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.

                      1 Reply Last reply
                      0
                      • _ _Flaviu

                        Is there any reliable location in windows registry that tell if the architecture of the machine is AMD or Intel ? If there is, where is this location ? I know this location:

                        HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

                        and Identifier key, but my machine is Intel ... and I don't know what would be this value on AMD case ... is this a reliable location ? P.S. Also, I know that I could find here:

                        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

                        PROCESSOR_ARCHITECTURE has AMD64 value, even if I have Intel machine ...

                        D Offline
                        D Offline
                        Daniel Pfeffer
                        wrote on last edited by
                        #21

                        1. 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](https://en.wikipedia.org/wiki/CPUID) for fuller documentation. Pay attention to the EAX=0 function (Get Manufacturer ID). 2. 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.

                        _ 1 Reply Last reply
                        0
                        • D Daniel Pfeffer

                          1. 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](https://en.wikipedia.org/wiki/CPUID) for fuller documentation. Pay attention to the EAX=0 function (Get Manufacturer ID). 2. 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.

                          _ Offline
                          _ Offline
                          _Flaviu
                          wrote on last edited by
                          #22

                          Thank you all of you.

                          1 Reply Last reply
                          0
                          • _ _Flaviu

                            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)
                            {
                            // execute some code (I cannot write here what kind of code)
                            }
                            else
                            {
                            // execute else code
                            }

                            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.

                            D Offline
                            D Offline
                            David Crow
                            wrote on last edited by
                            #23

                            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

                            _ 1 Reply Last reply
                            0
                            • D David Crow

                              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

                              _ Offline
                              _ Offline
                              _Flaviu
                              wrote on last edited by
                              #24

                              Very good idea. I think I would try this solution too, however, the location from HARDWARE\... seem to show what I need it.

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups