| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Cpuinfo.FunPtr
Synopsis
- sDL_GetNumLogicalCPUCores :: FunPtr (IO CInt)
- sDL_GetCPUCacheLineSize :: FunPtr (IO CInt)
- sDL_HasAltiVec :: FunPtr (IO CBool)
- sDL_HasMMX :: FunPtr (IO CBool)
- sDL_HasSSE :: FunPtr (IO CBool)
- sDL_HasSSE2 :: FunPtr (IO CBool)
- sDL_HasSSE3 :: FunPtr (IO CBool)
- sDL_HasSSE41 :: FunPtr (IO CBool)
- sDL_HasSSE42 :: FunPtr (IO CBool)
- sDL_HasAVX :: FunPtr (IO CBool)
- sDL_HasAVX2 :: FunPtr (IO CBool)
- sDL_HasAVX512F :: FunPtr (IO CBool)
- sDL_HasARMSIMD :: FunPtr (IO CBool)
- sDL_HasNEON :: FunPtr (IO CBool)
- sDL_HasLSX :: FunPtr (IO CBool)
- sDL_HasLASX :: FunPtr (IO CBool)
- sDL_GetSystemRAM :: FunPtr (IO CInt)
- sDL_GetSIMDAlignment :: FunPtr (IO CSize)
- sDL_GetSystemPageSize :: FunPtr (IO CInt)
Documentation
sDL_GetNumLogicalCPUCores :: FunPtr (IO CInt) 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.
- C declaration
SDL_GetNumLogicalCPUCores, defined atSDL3/SDL_cpuinfo.h 73:33
Since: 3.2.0
sDL_GetCPUCacheLineSize :: FunPtr (IO CInt) 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.
- C declaration
SDL_GetCPUCacheLineSize, defined atSDL3/SDL_cpuinfo.h 87:33
Since: 3.2.0
sDL_HasAltiVec :: FunPtr (IO CBool) 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.
- C declaration
SDL_HasAltiVec, defined atSDL3/SDL_cpuinfo.h 101:34
Since: 3.2.0
sDL_HasMMX :: FunPtr (IO CBool) 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.
- C declaration
SDL_HasMMX, defined atSDL3/SDL_cpuinfo.h 114:34
Since: 3.2.0
sDL_HasSSE :: FunPtr (IO CBool) 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
sDL_HasSSE2,sDL_HasSSE3,sDL_HasSSE41,sDL_HasSSE42- C declaration
SDL_HasSSE, defined atSDL3/SDL_cpuinfo.h 132:34
Since: 3.2.0
sDL_HasSSE2 :: FunPtr (IO CBool) 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
sDL_HasSSE,sDL_HasSSE3,sDL_HasSSE41,sDL_HasSSE42- C declaration
SDL_HasSSE2, defined atSDL3/SDL_cpuinfo.h 150:34
Since: 3.2.0
sDL_HasSSE3 :: FunPtr (IO CBool) 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
sDL_HasSSE,sDL_HasSSE2,sDL_HasSSE41,sDL_HasSSE42- C declaration
SDL_HasSSE3, defined atSDL3/SDL_cpuinfo.h 168:34
Since: 3.2.0
sDL_HasSSE41 :: FunPtr (IO CBool) 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
sDL_HasSSE,sDL_HasSSE2,sDL_HasSSE3,sDL_HasSSE42- C declaration
SDL_HasSSE41, defined atSDL3/SDL_cpuinfo.h 186:34
Since: 3.2.0
sDL_HasSSE42 :: FunPtr (IO CBool) 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
sDL_HasSSE,sDL_HasSSE2,sDL_HasSSE3,sDL_HasSSE41- C declaration
SDL_HasSSE42, defined atSDL3/SDL_cpuinfo.h 204:34
Since: 3.2.0
sDL_HasAVX :: FunPtr (IO CBool) 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
sDL_HasAVX2,sDL_HasAVX512F- C declaration
SDL_HasAVX, defined atSDL3/SDL_cpuinfo.h 220:34
Since: 3.2.0
sDL_HasAVX2 :: FunPtr (IO CBool) 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
sDL_HasAVX,sDL_HasAVX512F- C declaration
SDL_HasAVX2, defined atSDL3/SDL_cpuinfo.h 236:34
Since: 3.2.0
sDL_HasAVX512F :: FunPtr (IO CBool) 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
sDL_HasAVX,sDL_HasAVX2- C declaration
SDL_HasAVX512F, defined atSDL3/SDL_cpuinfo.h 252:34
Since: 3.2.0
sDL_HasARMSIMD :: FunPtr (IO CBool) 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
sDL_HasNEON- C declaration
SDL_HasARMSIMD, defined atSDL3/SDL_cpuinfo.h 269:34
Since: 3.2.0
sDL_HasNEON :: FunPtr (IO CBool) 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.
- C declaration
SDL_HasNEON, defined atSDL3/SDL_cpuinfo.h 282:34
Since: 3.2.0
sDL_HasLSX :: FunPtr (IO CBool) 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.
- C declaration
SDL_HasLSX, defined atSDL3/SDL_cpuinfo.h 296:34
Since: 3.2.0
sDL_HasLASX :: FunPtr (IO CBool) 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.
- C declaration
SDL_HasLASX, defined atSDL3/SDL_cpuinfo.h 310:34
Since: 3.2.0
sDL_GetSystemRAM :: FunPtr (IO CInt) 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.
- C declaration
SDL_GetSystemRAM, defined atSDL3/SDL_cpuinfo.h 321:33
Since: 3.2.0
sDL_GetSIMDAlignment :: FunPtr (IO CSize) 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 SDL_HasAVX512F(), 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.
- 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
- SDL_aligned_alloc, SDL_aligned_free
- C declaration
SDL_GetSIMDAlignment, defined atSDL3/SDL_cpuinfo.h 345:36
Since: 3.2.0
sDL_GetSystemPageSize :: FunPtr (IO CInt) 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 SDL_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.
- C declaration
SDL_GetSystemPageSize, defined atSDL3/SDL_cpuinfo.h 366:33
Since: 3.4.0