Retrieves CPU features and capabilities. More...
#include "common.h"
Go to the source code of this file.
Data Structures | |
struct | qsc_cpuidex_cpu_features |
Contains the CPU feature availability. More... | |
Macros | |
#define | QSC_CPUIDEX_SERIAL_SIZE 12ULL |
The CPU serial number length (in bytes). | |
#define | QSC_CPUIDEX_VENDOR_SIZE 12ULL |
The CPU vendor name length. | |
Enumerations | |
enum | qsc_cpuidex_cpu_type { qsc_cpuid_unknown = 0x00U , qsc_cpuid_amd = 0x01U , qsc_cpuid_intel = 0x02U , qsc_cpuid_via = 0x03U , qsc_cpuid_hygion = 0x04U } |
The detectable CPU architectures. More... | |
Functions | |
QSC_EXPORT_API bool | qsc_cpuidex_features_set (qsc_cpuidex_cpu_features *const features) |
Populate the CPU features structure with detected CPU capabilities. | |
QSC_EXPORT_API void | qsc_cpuidex_print_stats (void) |
Print the detected CPU features to the console. | |
Retrieves CPU features and capabilities.
This header provides functions and type definitions for detecting and retrieving the CPU's supported features and capabilities. It leverages the CPUID instruction and additional methods to identify the availability of hardware-accelerated cryptographic instructions (e.g., AES-NI, AVX, AVX2, AVX512, and ARM NEON), along with other processor attributes such as cache sizes, core counts, and clock frequencies. The header also defines constants for the CPU serial number and vendor string lengths, and enumerates supported CPU manufacturer types.
CPUID, CPU detection, AES-NI, AVX, AVX2, AVX512, NEON, cryptographic instructions, CPU features, hardware acceleration
enum qsc_cpuidex_cpu_type |
QSC_EXPORT_API bool qsc_cpuidex_features_set | ( | qsc_cpuidex_cpu_features *const | features | ) |
Populate the CPU features structure with detected CPU capabilities.
features | [qsc_cpuidex_cpu_features* const] Pointer to a qsc_cpuidex_cpu_features structure to populate. |
QSC_EXPORT_API void qsc_cpuidex_print_stats | ( | void | ) |
Print the detected CPU features to the console.
This function outputs the CPU capabilities (for example, AVX, AESNI, cache size, vendor) to the console.