#Get CPU microarchitecture using predefined macro

6 messages · Page 1 of 1 (latest)

split vault
#

Short version:
Is there a macro that returns the microarchitecture of the CPU in gcc/g++?

Long version:
I'm currently trying to create a CPU information auditor and one of the features I'm implementing is to fetch the CPU's microarchitecture.

I've made a previous post like 2 days ago about dynamic map keys and I've found a solution to the problem. I tried to add a map of IDs that relate to specific microarchitectures. But if I implement what I tried, I've noticed the compilation time becomes quite slow (around 3 seconds). Is there some kind of way to retrieve that sort of information using some sort of macro that's either defined in linux or windows?

pseudo pebbleBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

outer yarrow
#

@split vault take a look tools like __builtin_cpu_supports and __builtin_cpu_is

#

There are tons of preprocessor macros for checking support for specific cpu functionality, such as __AVX512F__

split vault
#

!solved