MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
The nvptx Plugin

See also
-X nvptx:<arg>
$CUDA_HOME
mim::plug::nvptx

An LLVM backend that targets NVIDIA GPUs. Loading this plugin (mim foo.mim -p nvptx) appends an emission phase to the compilation pipeline that splits the fully lowered program into a host world and a device world. It writes the host LLVM IR to <world>.ll and the device LLVM IR (with PTX intrinsics) to <world>_dev.ll, and — on Linux by default — compiles and embeds the device binary into the host LLVM IR. The output paths and the embedding behavior can be overridden via -X nvptx:<arg>. Its rt argument selects how the host module reaches the C runtime wrappers, just like ll's. Embedding needs libdevice, which it looks for in the CUDA paths and, failing that, under $CUDA_HOME.

Dependencies

plugin gpu;
plugin opt;
import compile;

Phases

emit

Emits the LLVM IR with PTX intrinsics for the host and device worlds split from the current world. This phase is spliced into the default pipeline (see opt) whenever the nvptx plugin is loaded.

axm emit: compile.Phase;