IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

info

Implements methods for querying the host target info.

You can import these APIs from the sys package. For example:

from std.sys import CompilationTarget

print(CompilationTarget.is_x86())

Structs​

Functions​

  • ​align_of: Returns the align of (in bytes) of the type.
  • ​bit_width_of: Returns the size of (in bits) of the type.
  • ​has_accelerator: Returns True if the host system has an accelerator and False otherwise.
  • ​has_amd_gpu_accelerator: Returns True if the host system has an AMD GPU and False otherwise.
  • ​has_amd_rdna_gpu_accelerator: Returns True if the host system has an AMD RDNA GPU and False otherwise.
  • ​has_apple_gpu_accelerator: Returns True if the host system has a Metal GPU and False otherwise.
  • ​has_nvidia_gpu_accelerator: Returns True if the host system has an NVIDIA GPU 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.
  • ​is_amd_gpu: Returns True if the target triple of the compiler is amdgcn-amd-amdhsa False otherwise.
  • ​is_apple_gpu: Returns True if the target triple is for Apple GPU (Metal) and False otherwise.
  • ​is_apple_m5: Returns True if the target is an Apple M5 GPU and False otherwise.
  • ​is_big_endian: Returns True if the target's endianness is big and False otherwise.
  • ​is_gpu: Returns True if the target triple is GPU and False otherwise.
  • ​is_little_endian: Returns True if the target's endianness is little and False otherwise.
  • ​is_nvidia_gpu: Returns True if the target triple of the compiler is nvptx64-nvidia-cuda False otherwise.
  • ​is_triple: Returns True if the target triple of the compiler matches the input 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.
  • ​platform_map: Helper for defining a compile time value depending on the current compilation target, raising a compilation error if trying to access the value on an unsupported target.
  • ​simd_bit_width: Returns the vector size (in bits) of the specified target.
  • ​simd_byte_width: Returns the vector size (in bytes) of the specified target.
  • ​simd_width_of: Returns the vector size of the type on the host system.
  • ​size_of: Returns the size of (in bytes) of the type.
  • ​stdlib_plugin: Returns the stdlib plugin name for the specified target.