docs-6.2.1/source/lib/omnitrace-user/omnitrace/categories.h File Reference

docs-6.2.1/source/lib/omnitrace-user/omnitrace/categories.h File Reference#

omnitrace: docs-6.2.1/source/lib/omnitrace-user/omnitrace/categories.h File Reference
categories.h File Reference
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

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

Typedefs

typedef enum OMNITRACE_CATEGORIES omnitrace_category_t
 Identifier for categories. More...
 
typedef enum OMNITRACE_ANNOTATION_TYPE omnitrace_annotation_type_t
 
typedef struct omnitrace_annotation omnitrace_annotation_t
 

Enumerations

enum  OMNITRACE_CATEGORIES {
  OMNITRACE_CATEGORY_NONE = 0 ,
  OMNITRACE_CATEGORY_PYTHON ,
  OMNITRACE_CATEGORY_USER ,
  OMNITRACE_CATEGORY_HOST ,
  OMNITRACE_CATEGORY_DEVICE_HIP ,
  OMNITRACE_CATEGORY_DEVICE_HSA ,
  OMNITRACE_CATEGORY_ROCM_HIP ,
  OMNITRACE_CATEGORY_ROCM_HSA ,
  OMNITRACE_CATEGORY_ROCM_ROCTX ,
  OMNITRACE_CATEGORY_ROCM_SMI ,
  OMNITRACE_CATEGORY_ROCM_SMI_BUSY ,
  OMNITRACE_CATEGORY_ROCM_SMI_TEMP ,
  OMNITRACE_CATEGORY_ROCM_SMI_POWER ,
  OMNITRACE_CATEGORY_ROCM_SMI_MEMORY_USAGE ,
  OMNITRACE_CATEGORY_ROCM_RCCL ,
  OMNITRACE_CATEGORY_ROCTRACER ,
  OMNITRACE_CATEGORY_ROCPROFILER ,
  OMNITRACE_CATEGORY_SAMPLING ,
  OMNITRACE_CATEGORY_PTHREAD ,
  OMNITRACE_CATEGORY_KOKKOS ,
  OMNITRACE_CATEGORY_MPI ,
  OMNITRACE_CATEGORY_OMPT ,
  OMNITRACE_CATEGORY_PROCESS_SAMPLING ,
  OMNITRACE_CATEGORY_COMM_DATA ,
  OMNITRACE_CATEGORY_CAUSAL ,
  OMNITRACE_CATEGORY_CPU_FREQ ,
  OMNITRACE_CATEGORY_PROCESS_PAGE ,
  OMNITRACE_CATEGORY_PROCESS_VIRT ,
  OMNITRACE_CATEGORY_PROCESS_PEAK ,
  OMNITRACE_CATEGORY_PROCESS_CONTEXT_SWITCH ,
  OMNITRACE_CATEGORY_PROCESS_PAGE_FAULT ,
  OMNITRACE_CATEGORY_PROCESS_USER_MODE_TIME ,
  OMNITRACE_CATEGORY_PROCESS_KERNEL_MODE_TIME ,
  OMNITRACE_CATEGORY_THREAD_WALL_TIME ,
  OMNITRACE_CATEGORY_THREAD_CPU_TIME ,
  OMNITRACE_CATEGORY_THREAD_PAGE_FAULT ,
  OMNITRACE_CATEGORY_THREAD_PEAK_MEMORY ,
  OMNITRACE_CATEGORY_THREAD_CONTEXT_SWITCH ,
  OMNITRACE_CATEGORY_THREAD_HARDWARE_COUNTER ,
  OMNITRACE_CATEGORY_KERNEL_HARDWARE_COUNTER ,
  OMNITRACE_CATEGORY_NUMA ,
  OMNITRACE_CATEGORY_TIMER_SAMPLING ,
  OMNITRACE_CATEGORY_OVERFLOW_SAMPLING ,
  OMNITRACE_CATEGORY_LAST
}
 
enum  OMNITRACE_ANNOTATION_TYPE {
  OMNITRACE_VALUE_NONE = 0 ,
  OMNITRACE_VALUE_CSTR = 1 ,
  OMNITRACE_STRING = OMNITRACE_VALUE_CSTR ,
  OMNITRACE_VALUE_SIZE_T = 2 ,
  OMNITRACE_SIZE_T = OMNITRACE_VALUE_SIZE_T ,
  OMNITRACE_VALUE_INT64 = 3 ,
  OMNITRACE_INT64 = OMNITRACE_VALUE_INT64 ,
  OMNITRACE_I64 = OMNITRACE_VALUE_INT64 ,
  OMNITRACE_VALUE_UINT64 = 4 ,
  OMNITRACE_UINT64 = OMNITRACE_VALUE_UINT64 ,
  OMNITRACE_U64 = OMNITRACE_VALUE_UINT64 ,
  OMNITRACE_VALUE_FLOAT64 = 5 ,
  OMNITRACE_FLOAT64 = OMNITRACE_VALUE_FLOAT64 ,
  OMNITRACE_FP64 = OMNITRACE_VALUE_FLOAT64 ,
  OMNITRACE_VALUE_VOID_P = 6 ,
  OMNITRACE_VOID_P = OMNITRACE_VALUE_VOID_P ,
  OMNITRACE_PTR = OMNITRACE_VALUE_VOID_P ,
  OMNITRACE_VALUE_INT32 = 7 ,
  OMNITRACE_INT32 = OMNITRACE_VALUE_INT32 ,
  OMNITRACE_I32 = OMNITRACE_VALUE_INT32 ,
  OMNITRACE_VALUE_UINT32 = 8 ,
  OMNITRACE_UINT32 = OMNITRACE_VALUE_UINT32 ,
  OMNITRACE_U32 = OMNITRACE_VALUE_UINT32 ,
  OMNITRACE_VALUE_FLOAT32 = 9 ,
  OMNITRACE_FLOAT32 = OMNITRACE_VALUE_FLOAT32 ,
  OMNITRACE_FP32 = OMNITRACE_VALUE_FLOAT32 ,
  OMNITRACE_VALUE_INT16 = 10 ,
  OMNITRACE_INT16 = OMNITRACE_VALUE_INT16 ,
  OMNITRACE_I16 = OMNITRACE_VALUE_INT16 ,
  OMNITRACE_VALUE_UINT16 = 11 ,
  OMNITRACE_UINT16 = OMNITRACE_VALUE_UINT16 ,
  OMNITRACE_U16 = OMNITRACE_VALUE_UINT16 ,
  OMNITRACE_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

◆ omnitrace_annotation

struct omnitrace_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)
{
omnitrace_annotation_t _annotations[] = {
{ "iteration", OMNITRACE_VALUE_SIZE_T, nullptr },
{ "residual", OMNITRACE_VALUE_FLOAT64, nullptr },
{ "data", OMNITRACE_VALUE_PTR, data },
{ "size", OMNITRACE_VALUE_SIZE_T, &n },
{ "tolerance", OMNITRACE_VALUE_FLOAT64, &tolerance },
nullptr
};
double residual = tolerance;
for(size_t i = 0; i < nitr; ++i)
{
omnitrace_user_push_annotated_region("compute", &_annotations);
residual = compute_residual(n, data);
_annotations[0].value = &i;
_annotations[1].value = &residual;
omnitrace_user_pop_annotated_region("compute", &_annotations);
}
return residual;
}
@ OMNITRACE_VALUE_FLOAT64
Definition: categories.h:112
@ OMNITRACE_VALUE_SIZE_T
Definition: categories.h:104
void * value
data to annotate
Definition: categories.h:184
A struct containing annotation data to be included in the perfetto trace.
Definition: categories.h:178
int omnitrace_user_push_annotated_region(const char *, omnitrace_annotation_t *, unsigned long)
int omnitrace_user_pop_annotated_region(const char *, omnitrace_annotation_t *, unsigned long)

Definition at line 177 of file categories.h.

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

Typedef Documentation

◆ omnitrace_annotation_t

◆ omnitrace_annotation_type_t

◆ omnitrace_category_t

Identifier for categories.

Enumeration Type Documentation

◆ OMNITRACE_ANNOTATION_TYPE

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

Enumerator
OMNITRACE_VALUE_NONE 
OMNITRACE_VALUE_CSTR 
OMNITRACE_STRING 
OMNITRACE_VALUE_SIZE_T 
OMNITRACE_SIZE_T 
OMNITRACE_VALUE_INT64 
OMNITRACE_INT64 
OMNITRACE_I64 
OMNITRACE_VALUE_UINT64 
OMNITRACE_UINT64 
OMNITRACE_U64 
OMNITRACE_VALUE_FLOAT64 
OMNITRACE_FLOAT64 
OMNITRACE_FP64 
OMNITRACE_VALUE_VOID_P 
OMNITRACE_VOID_P 
OMNITRACE_PTR 
OMNITRACE_VALUE_INT32 
OMNITRACE_INT32 
OMNITRACE_I32 
OMNITRACE_VALUE_UINT32 
OMNITRACE_UINT32 
OMNITRACE_U32 
OMNITRACE_VALUE_FLOAT32 
OMNITRACE_FLOAT32 
OMNITRACE_FP32 
OMNITRACE_VALUE_INT16 
OMNITRACE_INT16 
OMNITRACE_I16 
OMNITRACE_VALUE_UINT16 
OMNITRACE_UINT16 
OMNITRACE_U16 
OMNITRACE_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 OMNITRACE_ANNOTATION_TYPE omnitrace_annotation_type_t
@ OMNITRACE_FLOAT64
Definition: categories.h:113
@ OMNITRACE_INT16
Definition: categories.h:128
@ OMNITRACE_VOID_P
Definition: categories.h:116
@ OMNITRACE_FP32
Definition: categories.h:126
@ OMNITRACE_SIZE_T
Definition: categories.h:105
@ OMNITRACE_I32
Definition: categories.h:120
@ OMNITRACE_U16
Definition: categories.h:132
@ OMNITRACE_UINT64
Definition: categories.h:110
@ OMNITRACE_FLOAT32
Definition: categories.h:125
@ OMNITRACE_VALUE_INT64
Definition: categories.h:106
@ OMNITRACE_VALUE_VOID_P
Definition: categories.h:115
@ OMNITRACE_VALUE_FLOAT32
Definition: categories.h:124
@ OMNITRACE_UINT32
Definition: categories.h:122
@ OMNITRACE_VALUE_UINT16
Definition: categories.h:130
@ OMNITRACE_VALUE_INT32
Definition: categories.h:118
@ OMNITRACE_UINT16
Definition: categories.h:131
@ OMNITRACE_VALUE_INT16
Definition: categories.h:127
@ OMNITRACE_STRING
Definition: categories.h:103
@ OMNITRACE_PTR
Definition: categories.h:117
@ OMNITRACE_VALUE_LAST
Definition: categories.h:136
@ OMNITRACE_FP64
Definition: categories.h:114
@ OMNITRACE_INT32
Definition: categories.h:119
@ OMNITRACE_U32
Definition: categories.h:123
@ OMNITRACE_VALUE_UINT32
Definition: categories.h:121
@ OMNITRACE_VALUE_UINT64
Definition: categories.h:109
@ OMNITRACE_I16
Definition: categories.h:129
@ OMNITRACE_VALUE_CSTR
Definition: categories.h:102
@ OMNITRACE_VALUE_NONE
Definition: categories.h:99
@ OMNITRACE_U64
Definition: categories.h:111
@ OMNITRACE_INT64
Definition: categories.h:107
@ OMNITRACE_I64
Definition: categories.h:108

◆ OMNITRACE_CATEGORIES

Enumerator
OMNITRACE_CATEGORY_NONE 
OMNITRACE_CATEGORY_PYTHON 
OMNITRACE_CATEGORY_USER 
OMNITRACE_CATEGORY_HOST 
OMNITRACE_CATEGORY_DEVICE_HIP 
OMNITRACE_CATEGORY_DEVICE_HSA 
OMNITRACE_CATEGORY_ROCM_HIP 
OMNITRACE_CATEGORY_ROCM_HSA 
OMNITRACE_CATEGORY_ROCM_ROCTX 
OMNITRACE_CATEGORY_ROCM_SMI 
OMNITRACE_CATEGORY_ROCM_SMI_BUSY 
OMNITRACE_CATEGORY_ROCM_SMI_TEMP 
OMNITRACE_CATEGORY_ROCM_SMI_POWER 
OMNITRACE_CATEGORY_ROCM_SMI_MEMORY_USAGE 
OMNITRACE_CATEGORY_ROCM_RCCL 
OMNITRACE_CATEGORY_ROCTRACER 
OMNITRACE_CATEGORY_ROCPROFILER 
OMNITRACE_CATEGORY_SAMPLING 
OMNITRACE_CATEGORY_PTHREAD 
OMNITRACE_CATEGORY_KOKKOS 
OMNITRACE_CATEGORY_MPI 
OMNITRACE_CATEGORY_OMPT 
OMNITRACE_CATEGORY_PROCESS_SAMPLING 
OMNITRACE_CATEGORY_COMM_DATA 
OMNITRACE_CATEGORY_CAUSAL 
OMNITRACE_CATEGORY_CPU_FREQ 
OMNITRACE_CATEGORY_PROCESS_PAGE 
OMNITRACE_CATEGORY_PROCESS_VIRT 
OMNITRACE_CATEGORY_PROCESS_PEAK 
OMNITRACE_CATEGORY_PROCESS_CONTEXT_SWITCH 
OMNITRACE_CATEGORY_PROCESS_PAGE_FAULT 
OMNITRACE_CATEGORY_PROCESS_USER_MODE_TIME 
OMNITRACE_CATEGORY_PROCESS_KERNEL_MODE_TIME 
OMNITRACE_CATEGORY_THREAD_WALL_TIME 
OMNITRACE_CATEGORY_THREAD_CPU_TIME 
OMNITRACE_CATEGORY_THREAD_PAGE_FAULT 
OMNITRACE_CATEGORY_THREAD_PEAK_MEMORY 
OMNITRACE_CATEGORY_THREAD_CONTEXT_SWITCH 
OMNITRACE_CATEGORY_THREAD_HARDWARE_COUNTER 
OMNITRACE_CATEGORY_KERNEL_HARDWARE_COUNTER 
OMNITRACE_CATEGORY_NUMA 
OMNITRACE_CATEGORY_TIMER_SAMPLING 
OMNITRACE_CATEGORY_OVERFLOW_SAMPLING 
OMNITRACE_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 OMNITRACE_CATEGORIES omnitrace_category_t
Identifier for categories.
@ OMNITRACE_CATEGORY_PROCESS_CONTEXT_SWITCH
Definition: categories.h:71
@ OMNITRACE_CATEGORY_HOST
Definition: categories.h:45
@ OMNITRACE_CATEGORY_ROCM_SMI_BUSY
Definition: categories.h:52
@ OMNITRACE_CATEGORY_ROCM_HSA
Definition: categories.h:49
@ OMNITRACE_CATEGORY_PROCESS_PAGE_FAULT
Definition: categories.h:72
@ OMNITRACE_CATEGORY_CAUSAL
Definition: categories.h:66
@ OMNITRACE_CATEGORY_PROCESS_KERNEL_MODE_TIME
Definition: categories.h:74
@ OMNITRACE_CATEGORY_THREAD_PAGE_FAULT
Definition: categories.h:77
@ OMNITRACE_CATEGORY_THREAD_WALL_TIME
Definition: categories.h:75
@ OMNITRACE_CATEGORY_NUMA
Definition: categories.h:82
@ OMNITRACE_CATEGORY_PTHREAD
Definition: categories.h:60
@ OMNITRACE_CATEGORY_LAST
Definition: categories.h:85
@ OMNITRACE_CATEGORY_ROCM_SMI_MEMORY_USAGE
Definition: categories.h:55
@ OMNITRACE_CATEGORY_ROCM_SMI_TEMP
Definition: categories.h:53
@ OMNITRACE_CATEGORY_USER
Definition: categories.h:44
@ OMNITRACE_CATEGORY_TIMER_SAMPLING
Definition: categories.h:83
@ OMNITRACE_CATEGORY_KERNEL_HARDWARE_COUNTER
Definition: categories.h:81
@ OMNITRACE_CATEGORY_ROCM_SMI_POWER
Definition: categories.h:54
@ OMNITRACE_CATEGORY_THREAD_CPU_TIME
Definition: categories.h:76
@ OMNITRACE_CATEGORY_ROCTRACER
Definition: categories.h:57
@ OMNITRACE_CATEGORY_PYTHON
Definition: categories.h:43
@ OMNITRACE_CATEGORY_ROCM_HIP
Definition: categories.h:48
@ OMNITRACE_CATEGORY_PROCESS_VIRT
Definition: categories.h:69
@ OMNITRACE_CATEGORY_ROCM_SMI
Definition: categories.h:51
@ OMNITRACE_CATEGORY_MPI
Definition: categories.h:62
@ OMNITRACE_CATEGORY_NONE
Definition: categories.h:40
@ OMNITRACE_CATEGORY_ROCPROFILER
Definition: categories.h:58
@ OMNITRACE_CATEGORY_ROCM_RCCL
Definition: categories.h:56
@ OMNITRACE_CATEGORY_THREAD_PEAK_MEMORY
Definition: categories.h:78
@ OMNITRACE_CATEGORY_CPU_FREQ
Definition: categories.h:67
@ OMNITRACE_CATEGORY_ROCM_ROCTX
Definition: categories.h:50
@ OMNITRACE_CATEGORY_DEVICE_HIP
Definition: categories.h:46
@ OMNITRACE_CATEGORY_PROCESS_PEAK
Definition: categories.h:70
@ OMNITRACE_CATEGORY_OMPT
Definition: categories.h:63
@ OMNITRACE_CATEGORY_SAMPLING
Definition: categories.h:59
@ OMNITRACE_CATEGORY_COMM_DATA
Definition: categories.h:65
@ OMNITRACE_CATEGORY_KOKKOS
Definition: categories.h:61
@ OMNITRACE_CATEGORY_THREAD_HARDWARE_COUNTER
Definition: categories.h:80
@ OMNITRACE_CATEGORY_THREAD_CONTEXT_SWITCH
Definition: categories.h:79
@ OMNITRACE_CATEGORY_DEVICE_HSA
Definition: categories.h:47
@ OMNITRACE_CATEGORY_PROCESS_USER_MODE_TIME
Definition: categories.h:73
@ OMNITRACE_CATEGORY_PROCESS_PAGE
Definition: categories.h:68
@ OMNITRACE_CATEGORY_PROCESS_SAMPLING
Definition: categories.h:64
@ OMNITRACE_CATEGORY_OVERFLOW_SAMPLING
Definition: categories.h:84