SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_cpuinfo.h
1#ifndef SDL3PP_CPUINFO_H_
2#define SDL3PP_CPUINFO_H_
3
4#include <SDL3/SDL_cpuinfo.h>
5#include "SDL3pp_stdinc.h"
6#include "SDL3pp_version.h"
7
8namespace SDL {
9
35constexpr int CACHELINE_SIZE = SDL_CACHELINE_SIZE;
36
48inline int GetNumLogicalCPUCores() { return SDL_GetNumLogicalCPUCores(); }
49
62inline int GetCPUCacheLineSize() { return SDL_GetCPUCacheLineSize(); }
63
75inline bool HasAltiVec() { return SDL_HasAltiVec(); }
76
88inline bool HasMMX() { return SDL_HasMMX(); }
89
106inline bool HasSSE() { return SDL_HasSSE(); }
107
124inline bool HasSSE2() { return SDL_HasSSE2(); }
125
142inline bool HasSSE3() { return SDL_HasSSE3(); }
143
160inline bool HasSSE41() { return SDL_HasSSE41(); }
161
178inline bool HasSSE42() { return SDL_HasSSE42(); }
179
194inline bool HasAVX() { return SDL_HasAVX(); }
195
210inline bool HasAVX2() { return SDL_HasAVX2(); }
211
226inline bool HasAVX512F() { return SDL_HasAVX512F(); }
227
243inline bool HasARMSIMD() { return SDL_HasARMSIMD(); }
244
256inline bool HasNEON() { return SDL_HasNEON(); }
257
270inline bool HasLSX() { return SDL_HasLSX(); }
271
284inline bool HasLASX() { return SDL_HasLASX(); }
285
295inline int GetSystemRAM() { return SDL_GetSystemRAM(); }
296
319inline size_t GetSIMDAlignment() { return SDL_GetSIMDAlignment(); }
320
321#if SDL_VERSION_ATLEAST(3, 4, 0)
322
342inline int GetSystemPageSize() { return SDL_GetSystemPageSize(); }
343
344#endif // SDL_VERSION_ATLEAST(3, 4, 0)
345
347
348} // namespace SDL
349
350#endif /* SDL3PP_CPUINFO_H_ */
int GetNumLogicalCPUCores()
Get the number of logical CPU cores available.
Definition: SDL3pp_cpuinfo.h:48
bool HasLASX()
Determine whether the CPU has LASX (LOONGARCH SIMD) features.
Definition: SDL3pp_cpuinfo.h:284
bool HasAVX2()
Determine whether the CPU has AVX2 features.
Definition: SDL3pp_cpuinfo.h:210
bool HasAVX()
Determine whether the CPU has AVX features.
Definition: SDL3pp_cpuinfo.h:194
bool HasSSE42()
Determine whether the CPU has SSE4.2 features.
Definition: SDL3pp_cpuinfo.h:178
bool HasARMSIMD()
Determine whether the CPU has ARM SIMD (ARMv6) features.
Definition: SDL3pp_cpuinfo.h:243
bool HasSSE3()
Determine whether the CPU has SSE3 features.
Definition: SDL3pp_cpuinfo.h:142
bool HasSSE41()
Determine whether the CPU has SSE4.1 features.
Definition: SDL3pp_cpuinfo.h:160
int GetCPUCacheLineSize()
Determine the L1 cache line size of the CPU.
Definition: SDL3pp_cpuinfo.h:62
bool HasMMX()
Determine whether the CPU has MMX features.
Definition: SDL3pp_cpuinfo.h:88
bool HasAVX512F()
Determine whether the CPU has AVX-512F (foundation) features.
Definition: SDL3pp_cpuinfo.h:226
constexpr int CACHELINE_SIZE
A guess for the cacheline size used for padding.
Definition: SDL3pp_cpuinfo.h:35
size_t GetSIMDAlignment()
Report the alignment this system needs for SIMD allocations.
Definition: SDL3pp_cpuinfo.h:319
bool HasSSE()
Determine whether the CPU has SSE features.
Definition: SDL3pp_cpuinfo.h:106
bool HasAltiVec()
Determine whether the CPU has AltiVec features.
Definition: SDL3pp_cpuinfo.h:75
int GetSystemRAM()
Get the amount of RAM configured in the system.
Definition: SDL3pp_cpuinfo.h:295
int GetSystemPageSize()
Report the size of a page of memory.
Definition: SDL3pp_cpuinfo.h:342
bool HasLSX()
Determine whether the CPU has LSX (LOONGARCH SIMD) features.
Definition: SDL3pp_cpuinfo.h:270
bool HasSSE2()
Determine whether the CPU has SSE2 features.
Definition: SDL3pp_cpuinfo.h:124
bool HasNEON()
Determine whether the CPU has NEON (ARM SIMD) features.
Definition: SDL3pp_cpuinfo.h:256
Main include header for the SDL3pp library.