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

Python function

set_virtual_cpu_target

set_virtual_cpu_target()​

max.driver.set_virtual_cpu_target(cpu: str) → None

source

Sets the CPU target for host-independent kernel codegen.

Set this before any CPU kernel is compiled. CPU kernels compiled afterwards target this CPU, so the kernel cache can be shipped to, and reused on, a host with a different CPU. Mirrors set_virtual_device_target_arch() for GPUs.

Parameters:

cpu – An LLVM target-CPU name, such as x86-64-v3 or neoverse-n1; generic, for the most portable baseline of the host architecture family (x86-64 on x86_64, the armv8-a baseline on AArch64, an error for other families); or an empty string, which restores host-CPU codegen. native is rejected because it would compile for the host’s CPU.