Skip to main content

Mojo function

is_run_in_comptime_interpreter

is_run_in_comptime_interpreter() -> Bool

Returns true if the current code is being interpreted during compilation time. This is often used to provide a different code execution path for the comptime evaluation in the interpreter from generated runtime code, e.g.: runtime code path uses GPU intrinsics while comptime interpreter code path uses simplified CPU host logic for GPU kernels. Returns false otherwise.

Returns:

Bool: A boolean value indicating whether it is currently running in the comptime interpreter or not.

Was this page helpful?