logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_GetSIMDAlignment - Report the alignment this system needs for SIMD allocations.

Availability

       This function is available since SDL 3.2.0.

Description

       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.

Header File

       Defined in SDL3/SDL_cpuinfo.h

Name

       SDL_GetSIMDAlignment - Report the alignment this system needs for SIMD allocations.

Return Value

       Returns the alignment in bytes needed for available, known SIMD instructions.

See Also

(3), SDL_aligned_alloc(3), (3), SDL_aligned_free(3)

Simple Directmedia Layer                           SDL 3.2.10                            SDL_GetSIMDAlignment(3)

Synopsis

#include"SDL3/SDL.h"size_tSDL_GetSIMDAlignment(void);

Thread Safety

       It is safe to call this function from any thread.

See Also