ROCTx Application control/customization of profiling tools

ROCTx Application control/customization of profiling tools#

ROCTx Developer API: ROCTx Application control/customization of profiling tools
ROCTx Developer API 0.6.0
ROCm Profiling API and tools
ROCTx Application control/customization of profiling tools

Functions

int roctxProfilerPause (roctx_thread_id_t tid) ROCTX_API
 Request any currently running profiling tool that is should stop collecting data.
 
int roctxProfilerResume (roctx_thread_id_t tid) ROCTX_API
 Request any currently running profiling tool that is should resume collecting data.
 
int roctxNameOsThread (const char *) ROCTX_API ROCTX_NONNULL(1)
 Indicate to a profiling tool that, where possible, you would like the current CPU OS thread to be labeled by the provided name in the output of the profiling tool.
 
int roctxNameHsaAgent (const char *name, const struct hsa_agent_s *) ROCTX_API ROCTX_NONNULL(1
 Indicate to a profiling tool that, where possible, you would like the given HSA agent to be labeled by the provided name in the output of the profiling tool.
 
int int roctxNameHipDevice (const char *name, int device_id) ROCTX_API ROCTX_NONNULL(1)
 Indicate to a profiling tool that, where possible, you would like the given HIP device id to be labeled by the provided name in the output of the profiling tool.
 
int roctxNameHipStream (const char *name, const struct ihipStream_t *stream) ROCTX_API ROCTX_NONNULL(1)
 Indicate to a profiling tool that, where possible, you would like the given HIP stream to be labeled by the provided name in the output of the profiling tool.
 

Detailed Description

Applications can invoke these functions to control/customize profiling tool behavior.

Function Documentation

◆ roctxNameHipDevice()

int int roctxNameHipDevice ( const char *  name,
int  device_id 
)

Indicate to a profiling tool that, where possible, you would like the given HIP device id to be labeled by the provided name in the output of the profiling tool.

Rocprofiler does not provide any explicit support for how profiling tools handle this request: support for this capability is tool specific.

Parameters
[in]nameName for the specified device
[in]device_idHIP device ordinal
Returns
int A profiling tool may choose to set this value to a non-zero value to indicate a failure while executing the request or lack of support

◆ roctxNameHipStream()

int roctxNameHipStream ( const char *  name,
const struct ihipStream_t *  stream 
)

Indicate to a profiling tool that, where possible, you would like the given HIP stream to be labeled by the provided name in the output of the profiling tool.

Rocprofiler does not provide any explicit support for how profiling tools handle this request: support for this capability is tool specific.

Parameters
[in]nameName for the specified stream
[in]streamA hipStream_t value (hipStream_t == ihipStream_t*)
Returns
int A profiling tool may choose to set this value to a non-zero value to indicate a failure while executing the request or lack of support

◆ roctxNameHsaAgent()

int roctxNameHsaAgent ( const char *  name,
const struct hsa_agent_s *   
)

Indicate to a profiling tool that, where possible, you would like the given HSA agent to be labeled by the provided name in the output of the profiling tool.

Rocprofiler does not provide any explicit support for how profiling tools handle this request: support for this capability is tool specific.

Parameters
[in]nameName for the specified agent
[in]streamPointer to a HSA agent identifier
Returns
int A profiling tool may choose to set this value to a non-zero value to indicate a failure while executing the request or lack of support

◆ roctxNameOsThread()

int roctxNameOsThread ( const char *  )

Indicate to a profiling tool that, where possible, you would like the current CPU OS thread to be labeled by the provided name in the output of the profiling tool.

Rocprofiler does not provide explicit support for how profiling tools handle this request: support for this capability is tool specific. ROCTx does NOT rename the thread via pthread_setname_np.

Parameters
[in]nameName for the current OS thread
Returns
int A profiling tool may choose to set this value to a non-zero value to indicate a failure while executing the request or lack of support

◆ roctxProfilerPause()

int roctxProfilerPause ( roctx_thread_id_t  tid)

Request any currently running profiling tool that is should stop collecting data.

Within a profiling tool, it is recommended that the tool cache all active contexts at the time of the request and then stop them. By convention, the application should pass zero to indicate a global pause of the profiler in the current process. If the application wishes to pause only the current thread, the application should obtain the thread ID via roctxGetThreadId.

Parameters
[in]tidZero for all threads in current process or non-zero for a specific thread
Returns
int A profiling tool may choose to set this value to a non-zero value to indicate a failure while executing the request or lack of support. If the profiling tool supports pausing but is already paused, the tool should ignore the request and return zero.

◆ roctxProfilerResume()

int roctxProfilerResume ( roctx_thread_id_t  tid)

Request any currently running profiling tool that is should resume collecting data.

Within a profiling tool, it is recommended that the tool re-activated the active contexts which were cached when the pause request was issued. By convention, the application should pass zero to indicate a global pause of the profiler in the current process. If the application wishes to pause only the current thread, the application should obtain the thread ID via roctxGetThreadId.

Parameters
[in]tidZero for all threads in current process or non-zero for a specific thread
Returns
int A profiling tool may choose to set this value to a non-zero value to indicate a failure while executing the request or lack of support. If the profiling tool is supports resuming but is already active, the tool should ignore the request and return zero.