Module cpuinfo

Available on crate feature dep_sdl3 only.
Expand description

CPU feature detection for SDL.

These functions are largely concerned with reporting if the system has access to various SIMD instruction sets, but also has other important info to share, such as system RAM size and number of logical CPU cores.

CPU instruction set checks, like SDL_HasSSE() and SDL_HasNEON(), are available on all platforms, even if they don’t make sense (an ARM processor will never have SSE and an x86 processor will never have NEON, for example, but these functions still exist and will simply return false in these cases).

Constants§

SDL_CACHELINE_SIZE
A guess for the cacheline size used for padding.

Functions§

SDL_GetCPUCacheLineSize
Determine the L1 cache line size of the CPU.
SDL_GetNumLogicalCPUCores
Get the number of logical CPU cores available.
SDL_GetSIMDAlignment
Report the alignment this system needs for SIMD allocations.
SDL_GetSystemRAM
Get the amount of RAM configured in the system.
SDL_HasARMSIMD
Determine whether the CPU has ARM SIMD (ARMv6) features.
SDL_HasAVX
Determine whether the CPU has AVX features.
SDL_HasAVX2
Determine whether the CPU has AVX2 features.
SDL_HasAVX512F
Determine whether the CPU has AVX-512F (foundation) features.
SDL_HasAltiVec
Determine whether the CPU has AltiVec features.
SDL_HasLASX
Determine whether the CPU has LASX (LOONGARCH SIMD) features.
SDL_HasLSX
Determine whether the CPU has LSX (LOONGARCH SIMD) features.
SDL_HasMMX
Determine whether the CPU has MMX features.
SDL_HasNEON
Determine whether the CPU has NEON (ARM SIMD) features.
SDL_HasSSE
Determine whether the CPU has SSE features.
SDL_HasSSE2
Determine whether the CPU has SSE2 features.
SDL_HasSSE3
Determine whether the CPU has SSE3 features.
SDL_HasSSE41
Determine whether the CPU has SSE4.1 features.
SDL_HasSSE42
Determine whether the CPU has SSE4.2 features.