rocm.bindings.cyroctx#
2026-09-24
6 min read time
Applies to Linux and Windows
Advanced Micro Devices, Inc.
Cython declarations for the C-level interface. Use
cimport rocm.bindings.cyroctx from your Cython code to access
these declarations directly.
See also
The high-level Python API is documented at rocm.bindings.roctx.
# MIT License
#
# Copyright (c) 2021-2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# This file has been autogenerated, do not modify.
from libc.stdint cimport *
ctypedef bint _Bool # bool is not a reserved keyword in C, _Bool is
cdef extern from "roctracer/roctx.h":
cdef int ROCTX_VERSION_MAJOR
cdef int ROCTX_VERSION_MINOR
#
# Query the major version of the installed library.
#
# Return the major version of the installed library. This can be used to check
# if it is compatible with this interface version.
#
# \return Returns the major version number.
cdef uint32_t roctx_version_major() noexcept nogil
#
# Query the minor version of the installed library.
#
# Return the minor version of the installed library. This can be used to check
# if it is compatible with this interface version.
#
# \return Returns the minor version number.
cdef uint32_t roctx_version_minor() noexcept nogil
#
# Mark an event.
#
# \param[in] message The message associated with the event.
cdef void roctxMarkA(const char * message) noexcept nogil
#
# Start a new nested range.
#
# Nested ranges are stacked and local to the current CPU thread.
#
# \param[in] message The message associated with this range.
#
# \return Returns the level this nested range is started at. Nested range
# levels are 0 based.
cdef int roctxRangePushA(const char * message) noexcept nogil
#
# Stop the current nested range.
#
# Stop the current nested range, and pop it from the stack. If a nested range
# was active before the last one was started, it becomes again the current
# nested range.
#
# \return Returns the level the stopped nested range was started at, or a
# negative value if there was no nested range active.
cdef int roctxRangePop() noexcept nogil
cdef extern from "roctracer/roctx.h":
ctypedef uint64_t roctx_range_id_t
#
# Starts a process range.
#
# Start/stop ranges can be started and stopped in different threads. Each
# timespan is assigned a unique range ID.
#
# \param[in] message The message associated with this range.
#
# \return Returns the ID of the new range.
cdef uint64_t roctxRangeStartA(const char * message) noexcept nogil
#
# Stop a process range.
cdef void roctxRangeStop(uint64_t id) noexcept nogil
cdef bint __roctx_has_symbol(const char* name) noexcept nogil