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).

Mojo function

sm_id

def sm_id() -> Int

Returns the Streaming Multiprocessor (SM) ID of the current thread.

The SM ID uniquely identifies which physical streaming multiprocessor the thread is executing on. This is useful for SM-level optimizations and understanding hardware utilization.

If called on non-NVIDIA GPUs, this function aborts as this functionality is only supported on NVIDIA hardware.

Returns:

Int: The SM ID of the current thread.

Was this page helpful?