Skip to main content

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

  • is_x86: Returns True if the host system architecture is X86 and False otherwise.
  • has_sse4: Returns True if the host system has sse4, otherwise returns False.
  • 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_vnni: Returns True if the host system has avx512_vnni, 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.
  • 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_neoverse_n1: Returns True if the host system is a Neoverse N1 system, otherwise returns False.
  • has_intel_amx: Returns True if the host system has Intel AMX support, otherwise returns False.
  • os_is_macos: Returns True if the host operating system is macOS.
  • os_is_linux: Returns True if the host operating system is Linux.
  • os_is_windows: Returns True if the host operating system is Windows.
  • is_triple: Returns True if the target triple of the compiler matches the input and False otherwise.
  • triple_is_nvidia_cuda: Returns True if the target triple of the compiler is nvptx64-nvidia-cuda False otherwise.
  • is_little_endian: Returns True if the host endianness is little and False otherwise.
  • is_big_endian: Returns True if the host endianness is big and False otherwise.
  • is_32bit: Returns True if the maximum integral value is 32 bit.
  • is_64bit: Returns True if the maximum integral value is 64 bit.
  • simdbitwidth: Returns the vector size (in bits) of the host system.
  • simdbytewidth: Returns the vector size (in bytes) of the host system.
  • sizeof: Returns the size of (in bytes) of the type.
  • alignof: Returns the align of (in bytes) of the type.
  • bitwidthof: Returns the size of (in bits) of the type.
  • simdwidthof: Returns the vector size of the type on the host system.
  • num_physical_cores: Returns the number of physical cores across all CPU sockets.
  • 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.