Class SystemInfo
Provides properties to check the current system's configuration
public static class SystemInfo
- Inheritance
-
SystemInfo
- Inherited Members
Remarks
These properties are largely concerned with indicating if the system has access to various SIMD instruction sets, but also has other important info to share, such as the system's RAM size or the number of logical CPU cores.
Properties
CpuCacheLineSize
Gets the L1 cache size of the CPU in bytes
public static int CpuCacheLineSize { get; }
Property Value
- int
The L1 cache size of the CPU in bytes
Remarks
This is useful for determining multi-threaded structure padding or SIMD prefetch sizes.
CpuLogicalCoreCount
Gets the number of logical CPU cores available in the system
public static int CpuLogicalCoreCount { get; }
Property Value
- int
The number of logical CPU cores available in the system
HasAltiVec
Gets a value indicating whether the CPU has AltiVec features
public static bool HasAltiVec { get; }
Property Value
- bool
A value indicating whether the CPU has AltiVec features
Remarks
The value of this property will always be false on CPUs that aren't using PowerPC instruction sets.
HasArmSimd
Gets a value indicating whether the CPU has ARM SIMD (ARMv6) features
public static bool HasArmSimd { get; }
Property Value
- bool
A value indicating whether the CPU has ARM SIMD (ARMv6) features
Remarks
ARM SIMD (ARMv6) features are different from ARM NEON features, which are a different instruction set.
The value of this property will always be false on CPUs that aren't using ARM instruction sets.
HasAvx
Gets a value indicating whether the CPU has AVX features
public static bool HasAvx { get; }
Property Value
- bool
A value indicating whether the CPU has AVX features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasAvx2
Gets a value indicating whether the CPU has AVX2 features
public static bool HasAvx2 { get; }
Property Value
- bool
A value indicating whether the CPU has AVX2 features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasAvx512F
Gets a value indicating whether the CPU has AVX-512F (foundation) features
public static bool HasAvx512F { get; }
Property Value
- bool
A value indicating whether the CPU has AVX-512F (foundation) features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasLasx
Gets a value indicating whether the CPU has LASX (LOONGARCH SIMD) features
public static bool HasLasx { get; }
Property Value
- bool
A value indicating whether the CPU has LASX (LOONGARCH SIMD) features
Remarks
The value of this property will always be false on CPUs that aren't using LOONGARCH instruction sets.
HasLsx
Gets a value indicating whether the CPU has LSX (LOONGARCH SIMD) features
public static bool HasLsx { get; }
Property Value
- bool
A value indicating whether the CPU has LSX (LOONGARCH SIMD) features
Remarks
The value of this property will always be false on CPUs that aren't using LOONGARCH instruction sets.
HasMmx
Gets a value indicating whether the CPU has MMX features
public static bool HasMmx { get; }
Property Value
- bool
A value indicating whether the CPU has MMX features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasNeon
Gets a value indicating whether the CPU has NEON (ARM SIMD) features
public static bool HasNeon { get; }
Property Value
- bool
A value indicating whether the CPU has NEON (ARM SIMD) features
Remarks
The value of this property will always be false on CPUs that aren't using ARM instruction sets.
HasSse
Gets a value indicating whether the CPU has SSE features
public static bool HasSse { get; }
Property Value
- bool
A value indicating whether the CPU has SSE features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasSse2
Gets a value indicating whether the CPU has SSE2 features
public static bool HasSse2 { get; }
Property Value
- bool
A value indicating whether the CPU has SSE2 features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasSse3
Gets a value indicating whether the CPU has SSE3 features
public static bool HasSse3 { get; }
Property Value
- bool
A value indicating whether the CPU has SSE3 features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasSse41
Gets a value indicating whether the CPU has SSE4.1 features
public static bool HasSse41 { get; }
Property Value
- bool
A value indicating whether the CPU has SSE4.1 features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
HasSse42
Gets a value indicating whether the CPU has SSE4.2 features
public static bool HasSse42 { get; }
Property Value
- bool
A value indicating whether the CPU has SSE4.2 features
Remarks
The value of this property will always be false on CPUs that aren't using Intel instruction sets.
RamSize
Gets the amount of RAM configured in the system in MiB
public static int RamSize { get; }
Property Value
SimdAlignment
Gets the alignment this system needs for available and known SIMD instructions in bytes
public static nuint SimdAlignment { get; }
Property Value
- nuint
The alignment this system needs for available and known SIMD instructions in bytes
Remarks
The value of this property is the minimum number of bytes to which a pointer must be aligned to be compatible with SIMD instructions on the current machine.
For example, if the machine supports SSE only, it will be 16, but if it supports AVX-512F, it will be 64 (etc).
The values of this property are only for instruction sets SDL knows about, so if your SDL build doesn't have HasAvx512F,
then it might be 16 for the SSE support it sees and not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
Plan accordingly.