how to get CPU caps

Started by
8 comments, last by original vesoljc 21 years, 7 months ago
subject says it all... i''m using VC++6 and dx8 sdk. i''ve seen this thing in AMD''s sdk, but is there anything more "general"? like: GetCPUCaps(DEFAULT_CPU) Abnormal behavior of abnormal brain makes me normal...
Abnormal behavior of abnormal brain makes me normal...
Advertisement
What sort of caps? Be more specific


Goblineye Entertainment
The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
IsProcessorFeaturePresent() may be what you are looking for.
hrm this may be along the same lines
so hopefully im not hijacking a thread-
but is there another way to get processor
specifications besides digging through the
registry and/or decoding cryptic cpu signatures?

would be nice if there was a GetCPUSpeed() function

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

-eldee;another space monkey;[ Forced Evolution Studios ]
Unfortunately, IsProcessorFeaturePresent() only works on NT.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
tornado: vendor name, cpu family, version, revision, speed, mmx, sse, 3dnow, etc...

Abnormal behavior of abnormal brain makes me normal...
Abnormal behavior of abnormal brain makes me normal...
There was some code to do this sort of thing that was code of the day on flipcode a while back. It uses asm but should be fairly easy to use. Not sure if this is the kind of thing you want. Anyway here is the link

EDIT - If you look down in the comments I think there is something about detecting the speed

[edited by - Grambo on August 27, 2002 6:59:27 PM]
--24 Beers in a Case.24 Hours in a Day.Coincedence? I think not!www.gramb0.co.uk
quote:Original post by original vesoljc
tornado: vendor name, cpu family, version, revision, speed, mmx, sse, 3dnow, etc...

Abnormal behavior of abnormal brain makes me normal...


OK, All of this info you can get with the CPUID instruction.
For the CPU speed, you can use the RDTCS instruction.
Basically: Goto Intel and AMD websites and find the specs for the CPUID instruction.
In your application, use CPUID to find the vendor of the CPU (Which works the same way for both vendors) and from that point use the CPUID instruction reference for each vendor to get more info about the CPU.
Like said, goto sites like codeguru.com, thecodeproject.com etc. - you'll probably find neat stuff over there
If you're looking for anything specific and really can't find it, I might be able to help you (Wrote a library that gets all of the info you specified a couple of months ago ) - So post here, or email me.

Btw: Look over at Intel's developers section, they have an article that explains how to use the RDTSC instruction to get the speed of the CPU.

[edit] Dohh forgot to mention: CPUID and RDTSC are assembly instructions, so you'll have to use some inlined assembly to get things done [/edit]

Goblineye Entertainment
The road to success is always under construction

[edited by - Tornado on August 27, 2002 7:57:46 PM]
Goblineye EntertainmentThe road to success is always under construction
Heres another Processor Detection code of the day, this one is more recent and has more features than the other one.

[edited by - Grambo on August 27, 2002 7:44:22 PM]
--24 Beers in a Case.24 Hours in a Day.Coincedence? I think not!www.gramb0.co.uk
Both of those COTD's report back a single processor, how would you query if a second is available?

[EDIT] Ok, a quick search found GetNativeSystemInfo() [/EDIT]

[edited by - RobTheBloke on August 27, 2002 8:23:27 PM]

This topic is closed to new replies.

Advertisement