IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo function

is_enabled

def is_enabled() -> Bool

Reports whether the libkineto profiler is currently enabled.

Cheap enough to call on the hot path to elide expensive trace-name materialization on the disabled fast path. Wraps KGEN_CompilerRT_RangeIsEnabled.

Example:

from profiling_range import Range, is_enabled

def dispatch_kernel() raises:
    if is_enabled():
        with Range("hot_kernel"):
            launch()
    else:
        launch()

Returns:

Bool: True while the libkineto profiler is enabled, False otherwise.