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

global_cache_insert

def global_cache_insert(key: String, value: Pointer[NoneType, _safe=True])

Inserts a pointer into the process-wide compiler runtime global cache.

Stores value under key in the KGEN compiler runtime's global dictionary. Subsequent calls with the same key can retrieve the pointer via _get_global_or_null. Used to cache lazily-initialized resources (such as EP communicator handles) across kernel invocations without re-initialization overhead.

Args:

  • key (String): The string key to store value under.
  • value (Pointer[NoneType, _safe=True]): An opaque pointer to the resource to cache.

Was this page helpful?