rocprofiler-sdk-roctx/api_trace.h Source File

rocprofiler-sdk-roctx/api_trace.h Source File#

ROCTx Developer API: rocprofiler-sdk-roctx/api_trace.h Source File
ROCTx Developer API 0.6.0
ROCm Profiling API and tools
api_trace.h
Go to the documentation of this file.
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 all
13// 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 THE
21// SOFTWARE.
22
23#pragma once
24
28
29#include <sched.h>
30#include <stddef.h>
31#include <stdint.h>
32
34
35#define ROCTX_API_TABLE_VERSION_MAJOR 0
36#define ROCTX_API_TABLE_VERSION_STEP 0
37
38#define ROCTX_CORE_API_TABLE_VERSION_MAJOR 0
39#define ROCTX_CORE_API_TABLE_VERSION_STEP 0
40
41#define ROCTX_CONTROL_API_TABLE_VERSION_MAJOR 0
42#define ROCTX_CONTROL_API_TABLE_VERSION_STEP 0
43
44#define ROCTX_RESOURCE_API_TABLE_VERSION_MAJOR 0
45#define ROCTX_RESOURCE_API_TABLE_VERSION_STEP 0
46
47typedef uint64_t roctx_range_id_t;
48typedef void (*roctxMarkA_fn_t)(const char* message);
49typedef int (*roctxRangePushA_fn_t)(const char* message);
50typedef int (*roctxRangePop_fn_t)(void);
51typedef roctx_range_id_t (*roctxRangeStartA_fn_t)(const char* message);
55typedef int (*roctxNameOsThread_fn_t)(const char* name);
56typedef int (*roctxNameHsaAgent_fn_t)(const char* name, const struct hsa_agent_s* agent);
57typedef int (*roctxNameHipDevice_fn_t)(const char* name, int device_id);
58typedef int (*roctxNameHipStream_fn_t)(const char* name, const struct ihipStream_t* stream);
60
71
78
87
roctxRangeStartA_fn_t roctxRangeStartA_fn
Definition api_trace.h:67
int(* roctxNameHipStream_fn_t)(const char *name, const struct ihipStream_t *stream)
Definition api_trace.h:58
void(* roctxMarkA_fn_t)(const char *message)
Definition api_trace.h:48
roctxGetThreadId_fn_t roctxGetThreadId_fn
Definition api_trace.h:69
roctxProfilerPause_fn_t roctxProfilerPause_fn
Definition api_trace.h:75
int(* roctxNameHipDevice_fn_t)(const char *name, int device_id)
Definition api_trace.h:57
roctxNameHsaAgent_fn_t roctxNameHsaAgent_fn
Definition api_trace.h:83
int(* roctxGetThreadId_fn_t)(roctx_thread_id_t *tid)
Definition api_trace.h:59
roctxNameHipStream_fn_t roctxNameHipStream_fn
Definition api_trace.h:85
roctx_range_id_t(* roctxRangeStartA_fn_t)(const char *message)
Definition api_trace.h:51
int(* roctxProfilerPause_fn_t)(roctx_thread_id_t tid)
Definition api_trace.h:53
void(* roctxRangeStop_fn_t)(roctx_range_id_t id)
Definition api_trace.h:52
int(* roctxRangePop_fn_t)(void)
Definition api_trace.h:50
roctxMarkA_fn_t roctxMarkA_fn
Definition api_trace.h:64
roctxRangePushA_fn_t roctxRangePushA_fn
Definition api_trace.h:65
int(* roctxRangePushA_fn_t)(const char *message)
Definition api_trace.h:49
int(* roctxNameHsaAgent_fn_t)(const char *name, const struct hsa_agent_s *agent)
Definition api_trace.h:56
roctxNameHipDevice_fn_t roctxNameHipDevice_fn
Definition api_trace.h:84
roctxNameOsThread_fn_t roctxNameOsThread_fn
Definition api_trace.h:82
roctxRangeStop_fn_t roctxRangeStop_fn
Definition api_trace.h:68
roctxProfilerResume_fn_t roctxProfilerResume_fn
Definition api_trace.h:76
roctxRangePop_fn_t roctxRangePop_fn
Definition api_trace.h:66
uint64_t roctx_range_id_t
Definition api_trace.h:47
int(* roctxNameOsThread_fn_t)(const char *name)
Definition api_trace.h:55
int(* roctxProfilerResume_fn_t)(roctx_thread_id_t tid)
Definition api_trace.h:54
#define ROCTX_EXTERN_C_INIT
Definition defines.h:114
#define ROCTX_EXTERN_C_FINI
Definition defines.h:115
uint64_t roctx_thread_id_t
ROCTx thread ID.
Definition types.h:54