| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Cpuinfo
Contents
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 and hasSSE, 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). A guess for the cacheline size used for padding.hasNEON
Most x86 processors have a 64 byte cache line. The 64-bit PowerPC processors have a 128 byte cache line. We use the larger value to be generally safe.
FFI conventions
Unsuffixed aliases are unsafe foreign imports; aliases suffixed Safe are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under SDL3.Sys.Bindgen.Cpuinfo.Unsafe); functions curated unsafe-only export only the unsuffixed one. Each alias's documentation records its flavor and rationale.
Full conventions: SDL3.Sys.
Since: 3.2.0
Synopsis
- module SDL3.Sys.Bindgen.Cpuinfo
- getNumLogicalCPUCores :: IO Int32
- getNumLogicalCPUCoresSafe :: IO Int32
- getCPUCacheLineSize :: IO Int32
- getCPUCacheLineSizeSafe :: IO Int32
- hasAltiVec :: IO Bool
- hasAltiVecSafe :: IO Bool
- hasMMX :: IO Bool
- hasMMXSafe :: IO Bool
- hasSSE :: IO Bool
- hasSSESafe :: IO Bool
- hasSSE2 :: IO Bool
- hasSSE2Safe :: IO Bool
- hasSSE3 :: IO Bool
- hasSSE3Safe :: IO Bool
- hasSSE41 :: IO Bool
- hasSSE41Safe :: IO Bool
- hasSSE42 :: IO Bool
- hasSSE42Safe :: IO Bool
- hasAVX :: IO Bool
- hasAVXSafe :: IO Bool
- hasAVX2 :: IO Bool
- hasAVX2Safe :: IO Bool
- hasAVX512F :: IO Bool
- hasAVX512FSafe :: IO Bool
- hasARMSIMD :: IO Bool
- hasARMSIMDSafe :: IO Bool
- hasNEON :: IO Bool
- hasNEONSafe :: IO Bool
- hasLSX :: IO Bool
- hasLSXSafe :: IO Bool
- hasLASX :: IO Bool
- hasLASXSafe :: IO Bool
- getSystemRAM :: IO Int32
- getSystemRAMSafe :: IO Int32
- getSIMDAlignment :: IO Word64
- getSIMDAlignmentSafe :: IO Word64
- getSystemPageSize :: IO Int32
- getSystemPageSizeSafe :: IO Int32
Documentation
module SDL3.Sys.Bindgen.Cpuinfo
Function aliases
getNumLogicalCPUCores :: IO Int32 Source #
Get the number of logical CPU cores available.
- Returns
- the total number of logical CPU cores. On CPUs that include technologies such as hyperthreading, the number of logical cores may be more than the number of physical cores.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetNumLogicalCPUCores. The safe flavor isgetNumLogicalCPUCoresSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumLogicalCPUCores, defined atSDL3/SDL_cpuinfo.h 73:33
Since: 3.2.0
getNumLogicalCPUCoresSafe :: IO Int32 Source #
Get the number of logical CPU cores available.
- Returns
- the total number of logical CPU cores. On CPUs that include technologies such as hyperthreading, the number of logical cores may be more than the number of physical cores.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetNumLogicalCPUCores. The unsafe flavor isgetNumLogicalCPUCores. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumLogicalCPUCores, defined atSDL3/SDL_cpuinfo.h 73:33
Since: 3.2.0
getCPUCacheLineSize :: IO Int32 Source #
Determine the L1 cache line size of the CPU.
This is useful for determining multi-threaded structure padding or SIMD prefetch sizes.
- Returns
- the L1 cache line size of the CPU, in bytes.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetCPUCacheLineSize. The safe flavor isgetCPUCacheLineSizeSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetCPUCacheLineSize, defined atSDL3/SDL_cpuinfo.h 87:33
Since: 3.2.0
getCPUCacheLineSizeSafe :: IO Int32 Source #
Determine the L1 cache line size of the CPU.
This is useful for determining multi-threaded structure padding or SIMD prefetch sizes.
- Returns
- the L1 cache line size of the CPU, in bytes.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetCPUCacheLineSize. The unsafe flavor isgetCPUCacheLineSize. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetCPUCacheLineSize, defined atSDL3/SDL_cpuinfo.h 87:33
Since: 3.2.0
hasAltiVec :: IO Bool Source #
Determine whether the CPU has AltiVec features.
This always returns false on CPUs that aren't using PowerPC instruction sets.
- Returns
- true if the CPU has AltiVec features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasAltiVec. The safe flavor ishasAltiVecSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAltiVec, defined atSDL3/SDL_cpuinfo.h 101:34
Since: 3.2.0
hasAltiVecSafe :: IO Bool Source #
Determine whether the CPU has AltiVec features.
This always returns false on CPUs that aren't using PowerPC instruction sets.
- Returns
- true if the CPU has AltiVec features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasAltiVec. The unsafe flavor ishasAltiVec. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAltiVec, defined atSDL3/SDL_cpuinfo.h 101:34
Since: 3.2.0
Determine whether the CPU has MMX features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has MMX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasMMX. The safe flavor ishasMMXSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasMMX, defined atSDL3/SDL_cpuinfo.h 114:34
Since: 3.2.0
hasMMXSafe :: IO Bool Source #
Determine whether the CPU has MMX features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has MMX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasMMX. The unsafe flavor ishasMMX. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasMMX, defined atSDL3/SDL_cpuinfo.h 114:34
Since: 3.2.0
Determine whether the CPU has SSE features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE2,hasSSE3,hasSSE41,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasSSE. The safe flavor ishasSSESafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE, defined atSDL3/SDL_cpuinfo.h 132:34
Since: 3.2.0
hasSSESafe :: IO Bool Source #
Determine whether the CPU has SSE features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE2,hasSSE3,hasSSE41,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasSSE. The unsafe flavor ishasSSE. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE, defined atSDL3/SDL_cpuinfo.h 132:34
Since: 3.2.0
Determine whether the CPU has SSE2 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE2 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE3,hasSSE41,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasSSE2. The safe flavor ishasSSE2Safe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE2, defined atSDL3/SDL_cpuinfo.h 150:34
Since: 3.2.0
hasSSE2Safe :: IO Bool Source #
Determine whether the CPU has SSE2 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE2 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE3,hasSSE41,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasSSE2. The unsafe flavor ishasSSE2. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE2, defined atSDL3/SDL_cpuinfo.h 150:34
Since: 3.2.0
Determine whether the CPU has SSE3 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE3 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE2,hasSSE41,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasSSE3. The safe flavor ishasSSE3Safe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE3, defined atSDL3/SDL_cpuinfo.h 168:34
Since: 3.2.0
hasSSE3Safe :: IO Bool Source #
Determine whether the CPU has SSE3 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE3 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE2,hasSSE41,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasSSE3. The unsafe flavor ishasSSE3. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE3, defined atSDL3/SDL_cpuinfo.h 168:34
Since: 3.2.0
Determine whether the CPU has SSE4.1 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE4.1 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE2,hasSSE3,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasSSE41. The safe flavor ishasSSE41Safe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE41, defined atSDL3/SDL_cpuinfo.h 186:34
Since: 3.2.0
hasSSE41Safe :: IO Bool Source #
Determine whether the CPU has SSE4.1 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE4.1 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE2,hasSSE3,hasSSE42
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasSSE41. The unsafe flavor ishasSSE41. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE41, defined atSDL3/SDL_cpuinfo.h 186:34
Since: 3.2.0
Determine whether the CPU has SSE4.2 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE4.2 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE2,hasSSE3,hasSSE41
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasSSE42. The safe flavor ishasSSE42Safe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE42, defined atSDL3/SDL_cpuinfo.h 204:34
Since: 3.2.0
hasSSE42Safe :: IO Bool Source #
Determine whether the CPU has SSE4.2 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has SSE4.2 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasSSE,hasSSE2,hasSSE3,hasSSE41
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasSSE42. The unsafe flavor ishasSSE42. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasSSE42, defined atSDL3/SDL_cpuinfo.h 204:34
Since: 3.2.0
Determine whether the CPU has AVX features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has AVX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasAVX2,hasAVX512F
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasAVX. The safe flavor ishasAVXSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAVX, defined atSDL3/SDL_cpuinfo.h 220:34
Since: 3.2.0
hasAVXSafe :: IO Bool Source #
Determine whether the CPU has AVX features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has AVX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasAVX2,hasAVX512F
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasAVX. The unsafe flavor ishasAVX. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAVX, defined atSDL3/SDL_cpuinfo.h 220:34
Since: 3.2.0
Determine whether the CPU has AVX2 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has AVX2 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasAVX,hasAVX512F
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasAVX2. The safe flavor ishasAVX2Safe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAVX2, defined atSDL3/SDL_cpuinfo.h 236:34
Since: 3.2.0
hasAVX2Safe :: IO Bool Source #
Determine whether the CPU has AVX2 features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has AVX2 features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasAVX,hasAVX512F
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasAVX2. The unsafe flavor ishasAVX2. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAVX2, defined atSDL3/SDL_cpuinfo.h 236:34
Since: 3.2.0
hasAVX512F :: IO Bool Source #
Determine whether the CPU has AVX-512F (foundation) features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has AVX-512F features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasAVX,hasAVX2
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasAVX512F. The safe flavor ishasAVX512FSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAVX512F, defined atSDL3/SDL_cpuinfo.h 252:34
Since: 3.2.0
hasAVX512FSafe :: IO Bool Source #
Determine whether the CPU has AVX-512F (foundation) features.
This always returns false on CPUs that aren't using Intel instruction sets.
- Returns
- true if the CPU has AVX-512F features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasAVX,hasAVX2
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasAVX512F. The unsafe flavor ishasAVX512F. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasAVX512F, defined atSDL3/SDL_cpuinfo.h 252:34
Since: 3.2.0
hasARMSIMD :: IO Bool Source #
Determine whether the CPU has ARM SIMD (ARMv6) features.
This is different from ARM NEON, which is a different instruction set.
This always returns false on CPUs that aren't using ARM instruction sets.
- Returns
- true if the CPU has ARM SIMD features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasNEON
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasARMSIMD. The safe flavor ishasARMSIMDSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasARMSIMD, defined atSDL3/SDL_cpuinfo.h 269:34
Since: 3.2.0
hasARMSIMDSafe :: IO Bool Source #
Determine whether the CPU has ARM SIMD (ARMv6) features.
This is different from ARM NEON, which is a different instruction set.
This always returns false on CPUs that aren't using ARM instruction sets.
- Returns
- true if the CPU has ARM SIMD features or false if not.
- Thread safety
- It is safe to call this function from any thread.
- See also
hasNEON
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasARMSIMD. The unsafe flavor ishasARMSIMD. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasARMSIMD, defined atSDL3/SDL_cpuinfo.h 269:34
Since: 3.2.0
Determine whether the CPU has NEON (ARM SIMD) features.
This always returns false on CPUs that aren't using ARM instruction sets.
- Returns
- true if the CPU has ARM NEON features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasNEON. The safe flavor ishasNEONSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasNEON, defined atSDL3/SDL_cpuinfo.h 282:34
Since: 3.2.0
hasNEONSafe :: IO Bool Source #
Determine whether the CPU has NEON (ARM SIMD) features.
This always returns false on CPUs that aren't using ARM instruction sets.
- Returns
- true if the CPU has ARM NEON features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasNEON. The unsafe flavor ishasNEON. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasNEON, defined atSDL3/SDL_cpuinfo.h 282:34
Since: 3.2.0
Determine whether the CPU has LSX (LOONGARCH SIMD) features.
This always returns false on CPUs that aren't using LOONGARCH instruction sets.
- Returns
- true if the CPU has LOONGARCH LSX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasLSX. The safe flavor ishasLSXSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasLSX, defined atSDL3/SDL_cpuinfo.h 296:34
Since: 3.2.0
hasLSXSafe :: IO Bool Source #
Determine whether the CPU has LSX (LOONGARCH SIMD) features.
This always returns false on CPUs that aren't using LOONGARCH instruction sets.
- Returns
- true if the CPU has LOONGARCH LSX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasLSX. The unsafe flavor ishasLSX. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasLSX, defined atSDL3/SDL_cpuinfo.h 296:34
Since: 3.2.0
Determine whether the CPU has LASX (LOONGARCH SIMD) features.
This always returns false on CPUs that aren't using LOONGARCH instruction sets.
- Returns
- true if the CPU has LOONGARCH LASX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_HasLASX. The safe flavor ishasLASXSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasLASX, defined atSDL3/SDL_cpuinfo.h 310:34
Since: 3.2.0
hasLASXSafe :: IO Bool Source #
Determine whether the CPU has LASX (LOONGARCH SIMD) features.
This always returns false on CPUs that aren't using LOONGARCH instruction sets.
- Returns
- true if the CPU has LOONGARCH LASX features or false if not.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_HasLASX. The unsafe flavor ishasLASX. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_HasLASX, defined atSDL3/SDL_cpuinfo.h 310:34
Since: 3.2.0
getSystemRAM :: IO Int32 Source #
Get the amount of RAM configured in the system.
- Returns
- the amount of RAM configured in the system in MiB.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetSystemRAM. The safe flavor isgetSystemRAMSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetSystemRAM, defined atSDL3/SDL_cpuinfo.h 321:33
Since: 3.2.0
getSystemRAMSafe :: IO Int32 Source #
Get the amount of RAM configured in the system.
- Returns
- the amount of RAM configured in the system in MiB.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetSystemRAM. The unsafe flavor isgetSystemRAM. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetSystemRAM, defined atSDL3/SDL_cpuinfo.h 321:33
Since: 3.2.0
getSIMDAlignment :: IO Word64 Source #
Report the alignment this system needs for SIMD allocations.
This will return 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 return 16, but if it supports AVX-512F, it'll return 64 (etc). This only reports values for instruction sets SDL knows about, so if your SDL build doesn't have , then it might return 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.hasAVX512F
- Returns
- the alignment in bytes needed for available, known SIMD instructions.
- Thread safety
- It is safe to call this function from any thread.
- See also
alignedAlloc,alignedFree
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetSIMDAlignment. The safe flavor isgetSIMDAlignmentSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetSIMDAlignment, defined atSDL3/SDL_cpuinfo.h 345:36
Since: 3.2.0
getSIMDAlignmentSafe :: IO Word64 Source #
Report the alignment this system needs for SIMD allocations.
This will return 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 return 16, but if it supports AVX-512F, it'll return 64 (etc). This only reports values for instruction sets SDL knows about, so if your SDL build doesn't have , then it might return 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.hasAVX512F
- Returns
- the alignment in bytes needed for available, known SIMD instructions.
- Thread safety
- It is safe to call this function from any thread.
- See also
alignedAlloc,alignedFree
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetSIMDAlignment. The unsafe flavor isgetSIMDAlignment. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetSIMDAlignment, defined atSDL3/SDL_cpuinfo.h 345:36
Since: 3.2.0
getSystemPageSize :: IO Int32 Source #
Report the size of a page of memory.
Different platforms might have different memory page sizes. In current times, 4 kilobytes is not unusual, but newer systems are moving to larger page sizes, and esoteric platforms might have any unexpected size.
Note that this function can return 0, which means SDL can't determine the page size on this platform. It will not set an error string to be retrieved with getError in this case! In this case, defaulting to 4096 is often a reasonable option.
- Returns
- the size of a single page of memory, in bytes, or 0 if SDL can't determine this information.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetSystemPageSize. The safe flavor isgetSystemPageSizeSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetSystemPageSize, defined atSDL3/SDL_cpuinfo.h 366:33
Since: 3.4.0
getSystemPageSizeSafe :: IO Int32 Source #
Report the size of a page of memory.
Different platforms might have different memory page sizes. In current times, 4 kilobytes is not unusual, but newer systems are moving to larger page sizes, and esoteric platforms might have any unexpected size.
Note that this function can return 0, which means SDL can't determine the page size on this platform. It will not set an error string to be retrieved with getError in this case! In this case, defaulting to 4096 is often a reasonable option.
- Returns
- the size of a single page of memory, in bytes, or 0 if SDL can't determine this information.
- Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetSystemPageSize. The unsafe flavor isgetSystemPageSize. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetSystemPageSize, defined atSDL3/SDL_cpuinfo.h 366:33
Since: 3.4.0