rocprofiler-sdk/marker/api_args.h Source File

rocprofiler-sdk/marker/api_args.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/marker/api_args.h Source File
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
api_args.h
1// MIT License
2//
3// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23#pragma once
24
25#include <rocprofiler-sdk/defines.h>
26
27#include <rocprofiler-sdk-roctx/api_trace.h>
28#include <rocprofiler-sdk-roctx/types.h>
29
30#include <stdint.h>
31
32ROCPROFILER_EXTERN_C_INIT
33
34// Empty struct has a size of 0 in C but size of 1 in C++.
35// This struct is added to the union members which represent
36// functions with no arguments to ensure ABI compatibility
37typedef struct rocprofiler_marker_api_no_args
38{
39 char empty;
40} rocprofiler_marker_api_no_args;
41
42typedef union rocprofiler_marker_api_retval_t
43{
44 int32_t int32_t_retval;
45 int64_t int64_t_retval;
46 roctx_range_id_t roctx_range_id_t_retval;
47} rocprofiler_marker_api_retval_t;
48
49typedef union rocprofiler_marker_api_args_t
50{
51 struct
52 {
53 const char* message;
54 } roctxMarkA;
55 struct
56 {
57 const char* message;
58 } roctxRangePushA;
59 struct
60 {
61 // Empty struct has a size of 0 in C but size of 1 in C++.
62 // Add the rocprofiler_marker_api_no_args struct to fix this
63 rocprofiler_marker_api_no_args no_args;
64 } roctxRangePop;
65 struct
66 {
67 const char* message;
68 } roctxRangeStartA;
69 struct
70 {
71 roctx_range_id_t id;
72 } roctxRangeStop;
73 struct
74 {
75 roctx_thread_id_t* tid;
76 } roctxGetThreadId;
77 struct
78 {
79 roctx_thread_id_t tid;
80 } roctxProfilerPause;
81 struct
82 {
83 roctx_thread_id_t tid;
84 } roctxProfilerResume;
85 struct
86 {
87 const char* name;
88 } roctxNameOsThread;
89 struct
90 {
91 const char* name;
92 const struct hsa_agent_s* agent;
93 } roctxNameHsaAgent;
94 struct
95 {
96 const char* name;
97 int device_id;
98 } roctxNameHipDevice;
99 struct
100 {
101 const char* name;
102 const struct ihipStream_t* stream;
103 } roctxNameHipStream;
104 struct
105 {
106 const char* message;
107 } roctxThreadRangeA;
108 struct
109 {
110 const char* message;
111 // roctx_range_id_t id; // only set when range ends in callback tracing
112 } roctxProcessRangeA;
113} rocprofiler_marker_api_args_t;
114
115ROCPROFILER_EXTERN_C_FINI