Mojo module
info
Implements methods for querying the host target info.
You can import these APIs from the sys
package. For example:
from sys import is_x86
Functionsβ
- β
alignof
: Returns the align of (in bytes) of the type. - β
bitwidthof
: Returns the size of (in bits) of the type. - β
has_avx
: Returns True if the host system has AVX, otherwise returns False. - β
has_avx2
: Returns True if the host system has AVX2, otherwise returns False. - β
has_avx512f
: Returns True if the host system has AVX512, otherwise returns False. - β
has_fma
: Returns True if the host system has FMA (Fused Multiply-Add) support, otherwise returns False. - β
has_intel_amx
: Returns True if the host system has Intel AMX support, otherwise returns False. - β
has_neon
: Returns True if the host system has Neon support, otherwise returns False. - β
has_neon_int8_dotprod
: Returns True if the host system has the Neon int8 dot product extension, otherwise returns False. - β
has_neon_int8_matmul
: Returns True if the host system has the Neon int8 matrix multiplication extension (I8MM), otherwise returns False. - β
has_sse4
: Returns True if the host system has sse4, otherwise returns False. - β
has_vnni
: Returns True if the host system has avx512_vnni, otherwise returns False. - β
is_32bit
: Returns True if the maximum integral value is 32 bit. - β
is_64bit
: Returns True if the maximum integral value is 64 bit. - β
is_apple_m1
: Returns True if the host system is an Apple M1 with AMX support, otherwise returns False. - β
is_apple_m2
: Returns True if the host system is an Apple M2 with AMX support, otherwise returns False. - β
is_apple_m3
: Returns True if the host system is an Apple M3 with AMX support, otherwise returns False. - β
is_apple_silicon
: Returns True if the host system is an Apple Silicon with AMX support, otherwise returns False. - β
is_big_endian
: Returns True if the host endianness is big and False otherwise. - β
is_little_endian
: Returns True if the host endianness is little and False otherwise. - β
is_neoverse_n1
: Returns True if the host system is a Neoverse N1 system, otherwise returns False. - β
is_triple
: Returns True if the target triple of the compiler matches the input and False otherwise. - β
is_x86
: Returns True if the host system architecture is X86 and False otherwise. - β
num_logical_cores
: Returns the number of hardware threads, including hyperthreads across all CPU sockets. - β
num_performance_cores
: Returns the number of physical performance cores across all CPU sockets. If not known, returns the total number of physical cores. - β
num_physical_cores
: Returns the number of physical cores across all CPU sockets. - β
os_is_linux
: Returns True if the host operating system is Linux. - β
os_is_macos
: Returns True if the host operating system is macOS. - β
os_is_windows
: Returns True if the host operating system is Windows. - β
simdbitwidth
: Returns the vector size (in bits) of the host system. - β
simdbytewidth
: Returns the vector size (in bytes) of the host system. - β
simdwidthof
: Returns the vector size of the type on the host system. - β
sizeof
: Returns the size of (in bytes) of the type. - β
triple_is_nvidia_cuda
: Returns True if the target triple of the compiler isnvptx64-nvidia-cuda
False otherwise.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?