ROCTx Ranges

ROCTx Ranges#

ROCTx developer API: ROCTx Ranges
ROCTx developer API 1.0.0
ROCm Profiling API and tools
ROCTx Ranges

Ranges are used to describe a span of code execution in a ROCm application. More...

Functions

int roctxRangePushA (const char *message)
 
int roctxRangePop ()
 
roctx_range_id_t roctxRangeStartA (const char *message)
 Starts a process range.
 
void roctxRangeStop (roctx_range_id_t id)
 

Detailed Description

Ranges are used to describe a span of code execution in a ROCm application.

Ranges can be nested, and the API provides functions to start and stop ranges. Ranges are thread-local, meaning that each thread can have its own stack of ranges. The API provides functions to push and pop ranges from the stack. The API also provides functions to start and stop ranges, which are process-wide. Each range is assigned a unique ID, which can be used to identify the range when stopping it.

Function Documentation

◆ roctxRangePop()

int roctxRangePop ( )

#include <rocprofiler-sdk-roctx/roctx.h>

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.

Returns
Returns the level the stopped nested range was started at, or a negative value if there was no nested range active.

◆ roctxRangePushA()

int roctxRangePushA ( const char *  message)

#include <rocprofiler-sdk-roctx/roctx.h>

Start a new nested range.

Nested ranges are stacked and local to the current CPU thread.

Parameters
[in]messageThe message associated with this range.
Returns
Returns the level this nested range is started at. Nested range levels are 0 based.

◆ roctxRangeStartA()

roctx_range_id_t roctxRangeStartA ( const char *  message)

#include <rocprofiler-sdk-roctx/roctx.h>

Starts a process range.

Start/stop ranges can be started and stopped in different threads. Each timespan is assigned a unique range ID.

Parameters
[in]messageThe message associated with this range.
Returns
Returns the ID of the new range.

◆ roctxRangeStop()

void roctxRangeStop ( roctx_range_id_t  id)

#include <rocprofiler-sdk-roctx/roctx.h>

Stop a process range.

Parameters
[in]idroctx_range_id_t returned from roctxRangeStartA to stop