tvm.codegen#
Code generation related functions.
- tvm.codegen.build_module(mod, target)#
Build IRModule into Module.
- Parameters:
mod (tvm.IRModule) – The ir module.
target (str) – The target module type.
- Returns:
module – The corresponding module.
- Return type:
runtime.Module
- tvm.codegen.target_has_features(cpu_features, target=None)#
Check CPU features for the target’s -mtriple and -mcpu and -mattr.
- tvm.codegen.llvm_lookup_intrinsic_id(name)#
Lookup LLVM intrinsic id by name.
- tvm.codegen.llvm_get_intrinsic_name(intrin_id: int) str#
Get the name of an intrinsic for a given id.
- tvm.codegen.llvm_get_system_x86_vendor()#
Get system x86 vendor info.
- Returns:
vendor – The current system’s cpu vendor.
- Return type:
- tvm.codegen.llvm_get_system_triple()#
Get system host triple.
- Returns:
triple – The current system’s triple.
- Return type:
- tvm.codegen.llvm_get_system_cpu()#
Get system host cpu name.
- Returns:
cpu_name – The current system’s cpu name.
- Return type:
- tvm.codegen.llvm_get_targets()#
Get LLVM target list.
- tvm.codegen.llvm_get_cpu_archlist(target=None)#
Get CPU architectures for the target’s -mtriple.
- tvm.codegen.llvm_get_cpu_features(target=None)#
Get CPU features for the target’s -mtriple and -mcpu and considering -mattr.
- tvm.codegen.llvm_cpu_has_features(cpu_features, target=None)#
Check CPU features for the target’s -mtriple and -mcpu and considering -mattr.
- tvm.codegen.llvm_get_vector_width(target=None)#
Get vector width from LLVM target’s -mtriple and -mcpu and considering -mattr.
- tvm.codegen.llvm_is_valid_cpu(cpu, triple)#
Check if a CPU name is valid for the given LLVM triple.