Context Handling

Context Handling#

Rocprofiler SDK Developer API: Context Handling
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
Context Handling

Associate services with a handle. This handle is used to activate/deactivate the services during the application runtime. More...

Macros

#define ROCPROFILER_CONTEXT_NONE   ROCPROFILER_HANDLE_LITERAL(rocprofiler_context_id_t, UINT64_MAX)
 

Functions

rocprofiler_status_t rocprofiler_create_context (rocprofiler_context_id_t *context_id)
 Create context.
 
rocprofiler_status_t rocprofiler_start_context (rocprofiler_context_id_t context_id)
 Start context.
 
rocprofiler_status_t rocprofiler_stop_context (rocprofiler_context_id_t context_id)
 Stop context.
 
rocprofiler_status_t rocprofiler_context_is_active (rocprofiler_context_id_t context_id, int *status)
 Query whether context is currently active.
 
rocprofiler_status_t rocprofiler_context_is_valid (rocprofiler_context_id_t context_id, int *status)
 Query whether the context is valid.
 

Detailed Description

Associate services with a handle. This handle is used to activate/deactivate the services during the application runtime.

Macro Definition Documentation

◆ ROCPROFILER_CONTEXT_NONE

#define ROCPROFILER_CONTEXT_NONE   ROCPROFILER_HANDLE_LITERAL(rocprofiler_context_id_t, UINT64_MAX)

The NULL Context handle.

Definition at line 41 of file context.h.

Function Documentation

◆ rocprofiler_context_is_active()

rocprofiler_status_t rocprofiler_context_is_active ( rocprofiler_context_id_t  context_id,
int *  status 
)

Query whether context is currently active.

Parameters
[in]context_idContext identifier for the query
[out]statusIf context is active, this will be a nonzero value
Returns
rocprofiler_status_t
Return values
ROCPROFILER_STATUS_SUCCESSThe input context id identified a registered context
ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUNDThe input context id did not identify a registered context

◆ rocprofiler_context_is_valid()

rocprofiler_status_t rocprofiler_context_is_valid ( rocprofiler_context_id_t  context_id,
int *  status 
)

Query whether the context is valid.

Parameters
[in]context_idContext identifier for the query
[out]statusIf context is invalid, this will be a nonzero value
Returns
rocprofiler_status_t
Examples
api_buffered_tracing/client.cpp, and samples/api_callback_tracing/client.cpp.

◆ rocprofiler_create_context()

rocprofiler_status_t rocprofiler_create_context ( rocprofiler_context_id_t context_id)

Create context.

Parameters
[out]context_idContext identifier
Returns
rocprofiler_status_t
Examples
api_buffered_tracing/client.cpp, and samples/api_callback_tracing/client.cpp.

◆ rocprofiler_start_context()

rocprofiler_status_t rocprofiler_start_context ( rocprofiler_context_id_t  context_id)

Start context.

Parameters
[in]context_idIdentifier for context to be activated
Returns
rocprofiler_status_t
Examples
api_buffered_tracing/client.cpp, and samples/api_callback_tracing/client.cpp.

◆ rocprofiler_stop_context()

rocprofiler_status_t rocprofiler_stop_context ( rocprofiler_context_id_t  context_id)

Stop context.

Parameters
[in]context_idIdentifier for context to be deactivated
Returns
rocprofiler_status_t
Examples
api_buffered_tracing/client.cpp, and samples/api_callback_tracing/client.cpp.