latest/source/lib/rocprof-sys-user/rocprofiler-systems/categories.h File Reference

latest/source/lib/rocprof-sys-user/rocprofiler-systems/categories.h File Reference#

rocprofiler-systems: latest/source/lib/rocprof-sys-user/rocprofiler-systems/categories.h File Reference
categories.h File Reference
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  rocprofsys_annotation
 A struct containing annotation data to be included in the perfetto trace. More...
 

Typedefs

typedef enum ROCPROFSYS_CATEGORIES rocprofsys_category_t
 Identifier for categories. More...
 
typedef enum ROCPROFSYS_ANNOTATION_TYPE rocprofsys_annotation_type_t
 
typedef struct rocprofsys_annotation rocprofsys_annotation_t
 

Enumerations

enum  ROCPROFSYS_CATEGORIES {
  ROCPROFSYS_CATEGORY_NONE = 0 ,
  ROCPROFSYS_CATEGORY_PYTHON ,
  ROCPROFSYS_CATEGORY_USER ,
  ROCPROFSYS_CATEGORY_HOST ,
  ROCPROFSYS_CATEGORY_DEVICE_HIP ,
  ROCPROFSYS_CATEGORY_DEVICE_HSA ,
  ROCPROFSYS_CATEGORY_ROCM_HIP ,
  ROCPROFSYS_CATEGORY_ROCM_HSA ,
  ROCPROFSYS_CATEGORY_ROCM_ROCTX ,
  ROCPROFSYS_CATEGORY_ROCM_SMI ,
  ROCPROFSYS_CATEGORY_ROCM_SMI_BUSY ,
  ROCPROFSYS_CATEGORY_ROCM_SMI_TEMP ,
  ROCPROFSYS_CATEGORY_ROCM_SMI_POWER ,
  ROCPROFSYS_CATEGORY_ROCM_SMI_MEMORY_USAGE ,
  ROCPROFSYS_CATEGORY_ROCM_RCCL ,
  ROCPROFSYS_CATEGORY_ROCTRACER ,
  ROCPROFSYS_CATEGORY_ROCPROFILER ,
  ROCPROFSYS_CATEGORY_SAMPLING ,
  ROCPROFSYS_CATEGORY_PTHREAD ,
  ROCPROFSYS_CATEGORY_KOKKOS ,
  ROCPROFSYS_CATEGORY_MPI ,
  ROCPROFSYS_CATEGORY_OMPT ,
  ROCPROFSYS_CATEGORY_PROCESS_SAMPLING ,
  ROCPROFSYS_CATEGORY_COMM_DATA ,
  ROCPROFSYS_CATEGORY_CAUSAL ,
  ROCPROFSYS_CATEGORY_CPU_FREQ ,
  ROCPROFSYS_CATEGORY_PROCESS_PAGE ,
  ROCPROFSYS_CATEGORY_PROCESS_VIRT ,
  ROCPROFSYS_CATEGORY_PROCESS_PEAK ,
  ROCPROFSYS_CATEGORY_PROCESS_CONTEXT_SWITCH ,
  ROCPROFSYS_CATEGORY_PROCESS_PAGE_FAULT ,
  ROCPROFSYS_CATEGORY_PROCESS_USER_MODE_TIME ,
  ROCPROFSYS_CATEGORY_PROCESS_KERNEL_MODE_TIME ,
  ROCPROFSYS_CATEGORY_THREAD_WALL_TIME ,
  ROCPROFSYS_CATEGORY_THREAD_CPU_TIME ,
  ROCPROFSYS_CATEGORY_THREAD_PAGE_FAULT ,
  ROCPROFSYS_CATEGORY_THREAD_PEAK_MEMORY ,
  ROCPROFSYS_CATEGORY_THREAD_CONTEXT_SWITCH ,
  ROCPROFSYS_CATEGORY_THREAD_HARDWARE_COUNTER ,
  ROCPROFSYS_CATEGORY_KERNEL_HARDWARE_COUNTER ,
  ROCPROFSYS_CATEGORY_NUMA ,
  ROCPROFSYS_CATEGORY_TIMER_SAMPLING ,
  ROCPROFSYS_CATEGORY_OVERFLOW_SAMPLING ,
  ROCPROFSYS_CATEGORY_LAST
}
 
enum  ROCPROFSYS_ANNOTATION_TYPE {
  ROCPROFSYS_VALUE_NONE = 0 ,
  ROCPROFSYS_VALUE_CSTR = 1 ,
  ROCPROFSYS_STRING = ROCPROFSYS_VALUE_CSTR ,
  ROCPROFSYS_VALUE_SIZE_T = 2 ,
  ROCPROFSYS_SIZE_T = ROCPROFSYS_VALUE_SIZE_T ,
  ROCPROFSYS_VALUE_INT64 = 3 ,
  ROCPROFSYS_INT64 = ROCPROFSYS_VALUE_INT64 ,
  ROCPROFSYS_I64 = ROCPROFSYS_VALUE_INT64 ,
  ROCPROFSYS_VALUE_UINT64 = 4 ,
  ROCPROFSYS_UINT64 = ROCPROFSYS_VALUE_UINT64 ,
  ROCPROFSYS_U64 = ROCPROFSYS_VALUE_UINT64 ,
  ROCPROFSYS_VALUE_FLOAT64 = 5 ,
  ROCPROFSYS_FLOAT64 = ROCPROFSYS_VALUE_FLOAT64 ,
  ROCPROFSYS_FP64 = ROCPROFSYS_VALUE_FLOAT64 ,
  ROCPROFSYS_VALUE_VOID_P = 6 ,
  ROCPROFSYS_VOID_P = ROCPROFSYS_VALUE_VOID_P ,
  ROCPROFSYS_PTR = ROCPROFSYS_VALUE_VOID_P ,
  ROCPROFSYS_VALUE_INT32 = 7 ,
  ROCPROFSYS_INT32 = ROCPROFSYS_VALUE_INT32 ,
  ROCPROFSYS_I32 = ROCPROFSYS_VALUE_INT32 ,
  ROCPROFSYS_VALUE_UINT32 = 8 ,
  ROCPROFSYS_UINT32 = ROCPROFSYS_VALUE_UINT32 ,
  ROCPROFSYS_U32 = ROCPROFSYS_VALUE_UINT32 ,
  ROCPROFSYS_VALUE_FLOAT32 = 9 ,
  ROCPROFSYS_FLOAT32 = ROCPROFSYS_VALUE_FLOAT32 ,
  ROCPROFSYS_FP32 = ROCPROFSYS_VALUE_FLOAT32 ,
  ROCPROFSYS_VALUE_INT16 = 10 ,
  ROCPROFSYS_INT16 = ROCPROFSYS_VALUE_INT16 ,
  ROCPROFSYS_I16 = ROCPROFSYS_VALUE_INT16 ,
  ROCPROFSYS_VALUE_UINT16 = 11 ,
  ROCPROFSYS_UINT16 = ROCPROFSYS_VALUE_UINT16 ,
  ROCPROFSYS_U16 = ROCPROFSYS_VALUE_UINT16 ,
  ROCPROFSYS_VALUE_LAST
}
 Identifier for the data type of the annotation. if the data type is not a pointer, pass the address of data. More...
 

Class Documentation

◆ rocprofsys_annotation

struct rocprofsys_annotation

A struct containing annotation data to be included in the perfetto trace.

#include <cstddef>
#include <cstdint>
double
compute_residual(size_t n, double* data);
double
compute(size_t n, double* data, size_t nitr, double tolerance)
{
rocprofsys_annotation_t _annotations[] = {
{ "iteration", ROCPROFSYS_VALUE_SIZE_T, nullptr },
{ "residual", ROCPROFSYS_VALUE_FLOAT64, nullptr },
{ "data", ROCPROFSYS_VALUE_PTR, data },
{ "size", ROCPROFSYS_VALUE_SIZE_T, &n },
{ "tolerance", ROCPROFSYS_VALUE_FLOAT64, &tolerance },
nullptr
};
double residual = tolerance;
for(size_t i = 0; i < nitr; ++i)
{
rocprofsys_user_push_annotated_region("compute", &_annotations);
residual = compute_residual(n, data);
_annotations[0].value = &i;
_annotations[1].value = &residual;
rocprofsys_user_pop_annotated_region("compute", &_annotations);
}
return residual;
}
void * value
data to annotate
Definition: categories.h:184
@ ROCPROFSYS_VALUE_FLOAT64
Definition: categories.h:112
@ ROCPROFSYS_VALUE_SIZE_T
Definition: categories.h:104
A struct containing annotation data to be included in the perfetto trace.
Definition: categories.h:178
int rocprofsys_user_pop_annotated_region(const char *, rocprofsys_annotation_t *, unsigned long)
int rocprofsys_user_push_annotated_region(const char *, rocprofsys_annotation_t *, unsigned long)

Definition at line 177 of file categories.h.

Class Members
const char * name label for annotation
unsigned long type rocprofsys_annotation_type_t
void * value data to annotate

Typedef Documentation

◆ rocprofsys_annotation_t

◆ rocprofsys_annotation_type_t

◆ rocprofsys_category_t

Identifier for categories.

Enumeration Type Documentation

◆ ROCPROFSYS_ANNOTATION_TYPE

Identifier for the data type of the annotation. if the data type is not a pointer, pass the address of data.

Enumerator
ROCPROFSYS_VALUE_NONE 
ROCPROFSYS_VALUE_CSTR 
ROCPROFSYS_STRING 
ROCPROFSYS_VALUE_SIZE_T 
ROCPROFSYS_SIZE_T 
ROCPROFSYS_VALUE_INT64 
ROCPROFSYS_INT64 
ROCPROFSYS_I64 
ROCPROFSYS_VALUE_UINT64 
ROCPROFSYS_UINT64 
ROCPROFSYS_U64 
ROCPROFSYS_VALUE_FLOAT64 
ROCPROFSYS_FLOAT64 
ROCPROFSYS_FP64 
ROCPROFSYS_VALUE_VOID_P 
ROCPROFSYS_VOID_P 
ROCPROFSYS_PTR 
ROCPROFSYS_VALUE_INT32 
ROCPROFSYS_INT32 
ROCPROFSYS_I32 
ROCPROFSYS_VALUE_UINT32 
ROCPROFSYS_UINT32 
ROCPROFSYS_U32 
ROCPROFSYS_VALUE_FLOAT32 
ROCPROFSYS_FLOAT32 
ROCPROFSYS_FP32 
ROCPROFSYS_VALUE_INT16 
ROCPROFSYS_INT16 
ROCPROFSYS_I16 
ROCPROFSYS_VALUE_UINT16 
ROCPROFSYS_UINT16 
ROCPROFSYS_U16 
ROCPROFSYS_VALUE_LAST 

Definition at line 96 of file categories.h.

97  {
98  // Do not use first enum value
100  // arrange these in the order most likely to
101  // be used since they have to be iterated over
133  // the value of below enum is used for iterating
134  // over the enum in C++ templates. It MUST
135  // be the last enumerated id
enum ROCPROFSYS_ANNOTATION_TYPE rocprofsys_annotation_type_t
@ ROCPROFSYS_INT32
Definition: categories.h:119
@ ROCPROFSYS_FP64
Definition: categories.h:114
@ ROCPROFSYS_UINT64
Definition: categories.h:110
@ ROCPROFSYS_VOID_P
Definition: categories.h:116
@ ROCPROFSYS_VALUE_FLOAT32
Definition: categories.h:124
@ ROCPROFSYS_VALUE_UINT16
Definition: categories.h:130
@ ROCPROFSYS_SIZE_T
Definition: categories.h:105
@ ROCPROFSYS_UINT32
Definition: categories.h:122
@ ROCPROFSYS_VALUE_NONE
Definition: categories.h:99
@ ROCPROFSYS_UINT16
Definition: categories.h:131
@ ROCPROFSYS_FP32
Definition: categories.h:126
@ ROCPROFSYS_U32
Definition: categories.h:123
@ ROCPROFSYS_VALUE_CSTR
Definition: categories.h:102
@ ROCPROFSYS_VALUE_UINT64
Definition: categories.h:109
@ ROCPROFSYS_U64
Definition: categories.h:111
@ ROCPROFSYS_VALUE_INT64
Definition: categories.h:106
@ ROCPROFSYS_FLOAT64
Definition: categories.h:113
@ ROCPROFSYS_VALUE_LAST
Definition: categories.h:136
@ ROCPROFSYS_VALUE_UINT32
Definition: categories.h:121
@ ROCPROFSYS_INT16
Definition: categories.h:128
@ ROCPROFSYS_VALUE_VOID_P
Definition: categories.h:115
@ ROCPROFSYS_I64
Definition: categories.h:108
@ ROCPROFSYS_U16
Definition: categories.h:132
@ ROCPROFSYS_STRING
Definition: categories.h:103
@ ROCPROFSYS_FLOAT32
Definition: categories.h:125
@ ROCPROFSYS_I32
Definition: categories.h:120
@ ROCPROFSYS_VALUE_INT32
Definition: categories.h:118
@ ROCPROFSYS_PTR
Definition: categories.h:117
@ ROCPROFSYS_I16
Definition: categories.h:129
@ ROCPROFSYS_INT64
Definition: categories.h:107
@ ROCPROFSYS_VALUE_INT16
Definition: categories.h:127

◆ ROCPROFSYS_CATEGORIES

Enumerator
ROCPROFSYS_CATEGORY_NONE 
ROCPROFSYS_CATEGORY_PYTHON 
ROCPROFSYS_CATEGORY_USER 
ROCPROFSYS_CATEGORY_HOST 
ROCPROFSYS_CATEGORY_DEVICE_HIP 
ROCPROFSYS_CATEGORY_DEVICE_HSA 
ROCPROFSYS_CATEGORY_ROCM_HIP 
ROCPROFSYS_CATEGORY_ROCM_HSA 
ROCPROFSYS_CATEGORY_ROCM_ROCTX 
ROCPROFSYS_CATEGORY_ROCM_SMI 
ROCPROFSYS_CATEGORY_ROCM_SMI_BUSY 
ROCPROFSYS_CATEGORY_ROCM_SMI_TEMP 
ROCPROFSYS_CATEGORY_ROCM_SMI_POWER 
ROCPROFSYS_CATEGORY_ROCM_SMI_MEMORY_USAGE 
ROCPROFSYS_CATEGORY_ROCM_RCCL 
ROCPROFSYS_CATEGORY_ROCTRACER 
ROCPROFSYS_CATEGORY_ROCPROFILER 
ROCPROFSYS_CATEGORY_SAMPLING 
ROCPROFSYS_CATEGORY_PTHREAD 
ROCPROFSYS_CATEGORY_KOKKOS 
ROCPROFSYS_CATEGORY_MPI 
ROCPROFSYS_CATEGORY_OMPT 
ROCPROFSYS_CATEGORY_PROCESS_SAMPLING 
ROCPROFSYS_CATEGORY_COMM_DATA 
ROCPROFSYS_CATEGORY_CAUSAL 
ROCPROFSYS_CATEGORY_CPU_FREQ 
ROCPROFSYS_CATEGORY_PROCESS_PAGE 
ROCPROFSYS_CATEGORY_PROCESS_VIRT 
ROCPROFSYS_CATEGORY_PROCESS_PEAK 
ROCPROFSYS_CATEGORY_PROCESS_CONTEXT_SWITCH 
ROCPROFSYS_CATEGORY_PROCESS_PAGE_FAULT 
ROCPROFSYS_CATEGORY_PROCESS_USER_MODE_TIME 
ROCPROFSYS_CATEGORY_PROCESS_KERNEL_MODE_TIME 
ROCPROFSYS_CATEGORY_THREAD_WALL_TIME 
ROCPROFSYS_CATEGORY_THREAD_CPU_TIME 
ROCPROFSYS_CATEGORY_THREAD_PAGE_FAULT 
ROCPROFSYS_CATEGORY_THREAD_PEAK_MEMORY 
ROCPROFSYS_CATEGORY_THREAD_CONTEXT_SWITCH 
ROCPROFSYS_CATEGORY_THREAD_HARDWARE_COUNTER 
ROCPROFSYS_CATEGORY_KERNEL_HARDWARE_COUNTER 
ROCPROFSYS_CATEGORY_NUMA 
ROCPROFSYS_CATEGORY_TIMER_SAMPLING 
ROCPROFSYS_CATEGORY_OVERFLOW_SAMPLING 
ROCPROFSYS_CATEGORY_LAST 

Definition at line 37 of file categories.h.

38  {
39  // Do not use first enum value
41  // arrange these in the order most likely to
42  // be used since they have to be iterated over
86  // the value of below enum is used for iterating
87  // over the enum in C++ templates. It MUST
88  // be the last enumerated id
enum ROCPROFSYS_CATEGORIES rocprofsys_category_t
Identifier for categories.
@ ROCPROFSYS_CATEGORY_THREAD_CPU_TIME
Definition: categories.h:76
@ ROCPROFSYS_CATEGORY_KERNEL_HARDWARE_COUNTER
Definition: categories.h:81
@ ROCPROFSYS_CATEGORY_ROCPROFILER
Definition: categories.h:58
@ ROCPROFSYS_CATEGORY_NONE
Definition: categories.h:40
@ ROCPROFSYS_CATEGORY_HOST
Definition: categories.h:45
@ ROCPROFSYS_CATEGORY_THREAD_PEAK_MEMORY
Definition: categories.h:78
@ ROCPROFSYS_CATEGORY_ROCM_SMI_POWER
Definition: categories.h:54
@ ROCPROFSYS_CATEGORY_ROCM_HIP
Definition: categories.h:48
@ ROCPROFSYS_CATEGORY_LAST
Definition: categories.h:85
@ ROCPROFSYS_CATEGORY_COMM_DATA
Definition: categories.h:65
@ ROCPROFSYS_CATEGORY_DEVICE_HSA
Definition: categories.h:47
@ ROCPROFSYS_CATEGORY_ROCM_HSA
Definition: categories.h:49
@ ROCPROFSYS_CATEGORY_OVERFLOW_SAMPLING
Definition: categories.h:84
@ ROCPROFSYS_CATEGORY_PROCESS_SAMPLING
Definition: categories.h:64
@ ROCPROFSYS_CATEGORY_PROCESS_PAGE_FAULT
Definition: categories.h:72
@ ROCPROFSYS_CATEGORY_DEVICE_HIP
Definition: categories.h:46
@ ROCPROFSYS_CATEGORY_PROCESS_VIRT
Definition: categories.h:69
@ ROCPROFSYS_CATEGORY_THREAD_WALL_TIME
Definition: categories.h:75
@ ROCPROFSYS_CATEGORY_ROCM_ROCTX
Definition: categories.h:50
@ ROCPROFSYS_CATEGORY_MPI
Definition: categories.h:62
@ ROCPROFSYS_CATEGORY_PROCESS_PAGE
Definition: categories.h:68
@ ROCPROFSYS_CATEGORY_SAMPLING
Definition: categories.h:59
@ ROCPROFSYS_CATEGORY_CAUSAL
Definition: categories.h:66
@ ROCPROFSYS_CATEGORY_ROCM_SMI_MEMORY_USAGE
Definition: categories.h:55
@ ROCPROFSYS_CATEGORY_TIMER_SAMPLING
Definition: categories.h:83
@ ROCPROFSYS_CATEGORY_ROCM_RCCL
Definition: categories.h:56
@ ROCPROFSYS_CATEGORY_USER
Definition: categories.h:44
@ ROCPROFSYS_CATEGORY_OMPT
Definition: categories.h:63
@ ROCPROFSYS_CATEGORY_PTHREAD
Definition: categories.h:60
@ ROCPROFSYS_CATEGORY_KOKKOS
Definition: categories.h:61
@ ROCPROFSYS_CATEGORY_ROCTRACER
Definition: categories.h:57
@ ROCPROFSYS_CATEGORY_PYTHON
Definition: categories.h:43
@ ROCPROFSYS_CATEGORY_CPU_FREQ
Definition: categories.h:67
@ ROCPROFSYS_CATEGORY_PROCESS_KERNEL_MODE_TIME
Definition: categories.h:74
@ ROCPROFSYS_CATEGORY_THREAD_PAGE_FAULT
Definition: categories.h:77
@ ROCPROFSYS_CATEGORY_ROCM_SMI_BUSY
Definition: categories.h:52
@ ROCPROFSYS_CATEGORY_ROCM_SMI
Definition: categories.h:51
@ ROCPROFSYS_CATEGORY_THREAD_CONTEXT_SWITCH
Definition: categories.h:79
@ ROCPROFSYS_CATEGORY_PROCESS_PEAK
Definition: categories.h:70
@ ROCPROFSYS_CATEGORY_PROCESS_USER_MODE_TIME
Definition: categories.h:73
@ ROCPROFSYS_CATEGORY_PROCESS_CONTEXT_SWITCH
Definition: categories.h:71
@ ROCPROFSYS_CATEGORY_THREAD_HARDWARE_COUNTER
Definition: categories.h:80
@ ROCPROFSYS_CATEGORY_NUMA
Definition: categories.h:82
@ ROCPROFSYS_CATEGORY_ROCM_SMI_TEMP
Definition: categories.h:53