develop/projects/rocprofiler-systems/source/lib/rocprof-sys-common-api/rocprofiler-systems/annotation.h File Reference

develop/projects/rocprofiler-systems/source/lib/rocprof-sys-common-api/rocprofiler-systems/annotation.h File Reference#

rocprofiler-systems: develop/projects/rocprofiler-systems/source/lib/rocprof-sys-common-api/rocprofiler-systems/annotation.h File Reference
annotation.h File Reference
#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_ANNOTATION_TYPE rocprofsys_annotation_type_t
 
typedef struct rocprofsys_annotation rocprofsys_annotation_t
 

Enumerations

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)
{
size_t iteration = 0;
double residual = tolerance;
rocprofsys_annotation_t _annotations[] = {
{ "iteration", ROCPROFSYS_VALUE_SIZE_T, &iteration },
{ "residual", ROCPROFSYS_VALUE_FLOAT64, &residual },
};
for(iteration = 0; iteration < nitr; ++iteration)
{
rocprofsys_push_category_region(ROCPROFSYS_CATEGORY_USER, "compute",
_annotations, 2);
residual = compute_residual(n, data);
rocprofsys_pop_category_region(ROCPROFSYS_CATEGORY_USER, "compute",
_annotations, 2);
}
return residual;
}
@ ROCPROFSYS_VALUE_FLOAT64
Definition: annotation.h:37
@ ROCPROFSYS_VALUE_SIZE_T
Definition: annotation.h:29
A struct containing annotation data to be included in the perfetto trace.
Definition: annotation.h:101

Definition at line 100 of file annotation.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

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 21 of file annotation.h.

22  {
23  // Do not use first enum value
25  // arrange these in the order most likely to
26  // be used since they have to be iterated over
58  // the value of below enum is used for iterating
59  // over the enum in C++ templates. It MUST
60  // be the last enumerated id
enum ROCPROFSYS_ANNOTATION_TYPE rocprofsys_annotation_type_t
@ ROCPROFSYS_INT32
Definition: annotation.h:44
@ ROCPROFSYS_FP64
Definition: annotation.h:39
@ ROCPROFSYS_UINT64
Definition: annotation.h:35
@ ROCPROFSYS_VOID_P
Definition: annotation.h:41
@ ROCPROFSYS_VALUE_FLOAT32
Definition: annotation.h:49
@ ROCPROFSYS_VALUE_UINT16
Definition: annotation.h:55
@ ROCPROFSYS_SIZE_T
Definition: annotation.h:30
@ ROCPROFSYS_UINT32
Definition: annotation.h:47
@ ROCPROFSYS_VALUE_NONE
Definition: annotation.h:24
@ ROCPROFSYS_UINT16
Definition: annotation.h:56
@ ROCPROFSYS_FP32
Definition: annotation.h:51
@ ROCPROFSYS_U32
Definition: annotation.h:48
@ ROCPROFSYS_VALUE_CSTR
Definition: annotation.h:27
@ ROCPROFSYS_VALUE_UINT64
Definition: annotation.h:34
@ ROCPROFSYS_U64
Definition: annotation.h:36
@ ROCPROFSYS_VALUE_INT64
Definition: annotation.h:31
@ ROCPROFSYS_FLOAT64
Definition: annotation.h:38
@ ROCPROFSYS_VALUE_LAST
Definition: annotation.h:61
@ ROCPROFSYS_VALUE_UINT32
Definition: annotation.h:46
@ ROCPROFSYS_INT16
Definition: annotation.h:53
@ ROCPROFSYS_VALUE_VOID_P
Definition: annotation.h:40
@ ROCPROFSYS_I64
Definition: annotation.h:33
@ ROCPROFSYS_U16
Definition: annotation.h:57
@ ROCPROFSYS_STRING
Definition: annotation.h:28
@ ROCPROFSYS_FLOAT32
Definition: annotation.h:50
@ ROCPROFSYS_I32
Definition: annotation.h:45
@ ROCPROFSYS_VALUE_INT32
Definition: annotation.h:43
@ ROCPROFSYS_PTR
Definition: annotation.h:42
@ ROCPROFSYS_I16
Definition: annotation.h:54
@ ROCPROFSYS_INT64
Definition: annotation.h:32
@ ROCPROFSYS_VALUE_INT16
Definition: annotation.h:52