rocprofiler-sdk/fwd.h Source File

rocprofiler-sdk/fwd.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/fwd.h Source File
ROCprofiler-SDK developer API 1.1.0
ROCm Profiling API and tools
fwd.h
1// MIT License
2//
3// Copyright (c) 2024-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
25#include <rocprofiler-sdk/defines.h>
26
27#include <stddef.h>
28#include <stdint.h>
29
30ROCPROFILER_EXTERN_C_INIT
31
32//--------------------------------------------------------------------------------------//
33//
34// ENUMERATIONS
35//
36//--------------------------------------------------------------------------------------//
37
38/**
39 * @defgroup BASIC_DATA_TYPES Basic data types
40 * @brief Basic data types and typedefs
41 *
42 * @{
43 */
44
45/**
46 * @brief Status codes.
47 */
48typedef enum rocprofiler_status_t // NOLINT(performance-enum-size)
49{
50 ROCPROFILER_STATUS_SUCCESS = 0, ///< No error occurred
51 ROCPROFILER_STATUS_ERROR, ///< Generalized error
52 ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND, ///< No valid context for given context id
53 ROCPROFILER_STATUS_ERROR_BUFFER_NOT_FOUND, ///< No valid buffer for given buffer id
54 ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND, ///< Kind identifier is invalid
55 ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUND, ///< Operation identifier is invalid for domain
56 ROCPROFILER_STATUS_ERROR_THREAD_NOT_FOUND, ///< No valid thread for given thread id
57 ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND, ///< Agent identifier not found
58 ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND, ///< Counter identifier does not exist
59 ROCPROFILER_STATUS_ERROR_CONTEXT_ERROR, ///< Generalized context error
60 ROCPROFILER_STATUS_ERROR_CONTEXT_INVALID, ///< Context configuration is not valid
61 ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_STARTED, ///< Context was not started (e.g., atomic swap
62 ///< into active array failed)
63 ROCPROFILER_STATUS_ERROR_CONTEXT_CONFLICT, ///< Context operation failed due to a conflict with
64 ///< another context
65 ROCPROFILER_STATUS_ERROR_CONTEXT_ID_NOT_ZERO, ///< Context ID is not initialized to zero
66 ROCPROFILER_STATUS_ERROR_BUFFER_BUSY, ///< buffer operation failed because it currently busy
67 ///< handling another request (e.g. flushing)
68 ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED, ///< service has already been configured
69 ///< in context
70 ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED, ///< Function call is not valid outside of
71 ///< rocprofiler configuration (i.e.
72 ///< function called post-initialization)
73 ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED, ///< Function is not implemented
74 ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_ABI, ///< Data structure provided by user is incompatible
75 ///< with current version of rocprofiler
76 ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT, ///< Function invoked with one or more invalid
77 ///< arguments
78 ROCPROFILER_STATUS_ERROR_METRIC_NOT_VALID_FOR_AGENT, ///< Invalid metric supplied to agent.
79 ROCPROFILER_STATUS_ERROR_FINALIZED, ///< invalid because rocprofiler has been finalized
80 ROCPROFILER_STATUS_ERROR_HSA_NOT_LOADED, ///< Call requires HSA to be loaded before performed
81 ROCPROFILER_STATUS_ERROR_DIM_NOT_FOUND, ///< Dimension is not found for counter
82 ROCPROFILER_STATUS_ERROR_PROFILE_COUNTER_NOT_FOUND, ///< Profile could not find counter for GPU
83 ///< agent
84 ROCPROFILER_STATUS_ERROR_AST_GENERATION_FAILED, ///< AST could not be generated correctly
86 ROCPROFILER_STATUS_ERROR_AQL_NO_EVENT_COORD, ///< Event coordinate was not found by AQL profile
87 ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_KERNEL, ///< A service depends on a newer version of KFD
88 ///< (amdgpu kernel driver). Check logs for
89 ///< service that report incompatibility
90 ROCPROFILER_STATUS_ERROR_OUT_OF_RESOURCES, ///< The given resources are
91 ///< insufficient to complete operation
92 ROCPROFILER_STATUS_ERROR_PROFILE_NOT_FOUND, ///< Could not find the counter profile
93 ROCPROFILER_STATUS_ERROR_AGENT_DISPATCH_CONFLICT, ///< Cannot enable both agent and dispatch
94 ///< counting in the same context.
95 ROCPROFILER_STATUS_INTERNAL_NO_AGENT_CONTEXT, ///< No agent context found, may not be an error
97 ROCPROFILER_STATUS_ERROR_NO_PROFILE_QUEUE, ///< Profile queue creation failed
98 ROCPROFILER_STATUS_ERROR_NO_HARDWARE_COUNTERS, ///< No hardware counters were specified
99 ROCPROFILER_STATUS_ERROR_AGENT_MISMATCH, ///< Agent mismatch between profile and context.
100 ROCPROFILER_STATUS_ERROR_NOT_AVAILABLE, ///< The service is not available.
101 ///< Please refer to API functions that return this
102 ///< status code for more information.
103 ROCPROFILER_STATUS_ERROR_EXCEEDS_HW_LIMIT, ///< Exceeds hardware limits for collection.
104 ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED, ///< Agent HW architecture not supported.
106 ROCPROFILER_STATUS_LAST,
108
109/**
110 * @brief Buffer record categories. This enumeration type is encoded in
111 * ::rocprofiler_record_header_t category field
112 */
113typedef enum rocprofiler_buffer_category_t // NOLINT(performance-enum-size)
114{
115 ROCPROFILER_BUFFER_CATEGORY_NONE = 0,
116 ROCPROFILER_BUFFER_CATEGORY_TRACING,
117 ROCPROFILER_BUFFER_CATEGORY_PC_SAMPLING,
118 ROCPROFILER_BUFFER_CATEGORY_COUNTERS,
119 ROCPROFILER_BUFFER_CATEGORY_LAST,
121
122/**
123 * @brief Agent type.
124 */
125typedef enum rocprofiler_agent_type_t // NOLINT(performance-enum-size)
126{
127 ROCPROFILER_AGENT_TYPE_NONE = 0, ///< Agent type is unknown
128 ROCPROFILER_AGENT_TYPE_CPU, ///< Agent type is a CPU
129 ROCPROFILER_AGENT_TYPE_GPU, ///< Agent type is a GPU
130 ROCPROFILER_AGENT_TYPE_LAST,
132
133/**
134 * @brief Service Callback Phase.
135 */
136typedef enum rocprofiler_callback_phase_t // NOLINT(performance-enum-size)
137{
138 ROCPROFILER_CALLBACK_PHASE_NONE = 0, ///< Callback has no phase
139 ROCPROFILER_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to function execution
141 ROCPROFILER_CALLBACK_PHASE_ENTER, ///< Callback invoked prior to code object loading
142 ROCPROFILER_CALLBACK_PHASE_EXIT, ///< Callback invoked after to function execution
144 ROCPROFILER_CALLBACK_PHASE_EXIT, ///< Callback invoked prior to code object unloading
145 ROCPROFILER_CALLBACK_PHASE_LAST,
147
148/**
149 * @brief Service Callback Tracing Kind. @see rocprofiler_configure_callback_tracing_service.
150 */
151typedef enum rocprofiler_callback_tracing_kind_t // NOLINT(performance-enum-size)
152{
153 ROCPROFILER_CALLBACK_TRACING_NONE = 0,
154 ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API, ///< @see ::rocprofiler_hsa_core_api_id_t
155 ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API, ///< @see ::rocprofiler_hsa_amd_ext_api_id_t
156 ROCPROFILER_CALLBACK_TRACING_HSA_IMAGE_EXT_API, ///< @see ::rocprofiler_hsa_image_ext_api_id_t
158 ///< ::rocprofiler_hsa_finalize_ext_api_id_t
159 ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API, ///< @see ::rocprofiler_hip_runtime_api_id_t
160 ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API, ///< @see ::rocprofiler_hip_compiler_api_id_t
161 ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API, ///< @see ::rocprofiler_marker_core_api_id_t
163 ///< ::rocprofiler_marker_control_api_id_t
164 ROCPROFILER_CALLBACK_TRACING_MARKER_NAME_API, ///< @see ::rocprofiler_marker_name_api_id_t
165 ROCPROFILER_CALLBACK_TRACING_CODE_OBJECT, ///< @see ::rocprofiler_code_object_operation_t
166 ROCPROFILER_CALLBACK_TRACING_SCRATCH_MEMORY, ///< @see ::rocprofiler_scratch_memory_operation_t
167 ROCPROFILER_CALLBACK_TRACING_KERNEL_DISPATCH, ///< Callbacks for kernel dispatches
168 ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY, ///< @see ::rocprofiler_memory_copy_operation_t
170 ROCPROFILER_CALLBACK_TRACING_OMPT, ///< @see ::rocprofiler_ompt_operation_t
172 ///< ::rocprofiler_memory_allocation_operation_t
173 ROCPROFILER_CALLBACK_TRACING_RUNTIME_INITIALIZATION, ///< Callback notifying that a runtime
174 ///< library has been initialized
177 ROCPROFILER_CALLBACK_TRACING_HIP_STREAM, ///< @see ::rocprofiler_hip_stream_operation_t
179 ///< ::rocprofiler_marker_core_range_api_id_t
180 ROCPROFILER_CALLBACK_TRACING_LAST,
182
183/**
184 * @brief Service Buffer Tracing Kind. @see rocprofiler_configure_buffer_tracing_service.
185 */
186typedef enum rocprofiler_buffer_tracing_kind_t // NOLINT(performance-enum-size)
187{
188 ROCPROFILER_BUFFER_TRACING_NONE = 0,
189 ROCPROFILER_BUFFER_TRACING_HSA_CORE_API, ///< @see ::rocprofiler_hsa_core_api_id_t
190 ROCPROFILER_BUFFER_TRACING_HSA_AMD_EXT_API, ///< @see ::rocprofiler_hsa_amd_ext_api_id_t
191 ROCPROFILER_BUFFER_TRACING_HSA_IMAGE_EXT_API, ///< @see ::rocprofiler_hsa_image_ext_api_id_t
193 ///< ::rocprofiler_hsa_finalize_ext_api_id_t
194 ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API, ///< @see ::rocprofiler_hip_runtime_api_id_t
195 ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API, ///< @see ::rocprofiler_hip_compiler_api_id_t
196 ROCPROFILER_BUFFER_TRACING_MARKER_CORE_API, ///< @see ::rocprofiler_marker_core_api_id_t
197 ROCPROFILER_BUFFER_TRACING_MARKER_CONTROL_API, ///< @see ::rocprofiler_marker_control_api_id_t
198 ROCPROFILER_BUFFER_TRACING_MARKER_NAME_API, ///< @see ::rocprofiler_marker_name_api_id_t
199 ROCPROFILER_BUFFER_TRACING_MEMORY_COPY, ///< @see ::rocprofiler_memory_copy_operation_t
200 ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH, ///< Buffer kernel dispatch info
201 ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY, ///< Buffer scratch memory reclaimation info
202 ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT, ///< Correlation ID in no longer in use
204 ROCPROFILER_BUFFER_TRACING_OMPT, ///< @see ::rocprofiler_ompt_operation_t
206 ///< ::rocprofiler_memory_allocation_operation_t
207 ROCPROFILER_BUFFER_TRACING_RUNTIME_INITIALIZATION, ///< Record indicating a runtime library has
208 ///< been initialized. @see
209 ///< ::rocprofiler_runtime_initialization_operation_t
212 ROCPROFILER_BUFFER_TRACING_HIP_STREAM, ///< @see ::rocprofiler_hip_stream_operation_t
213 ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API_EXT,
214 ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API_EXT,
215 ROCPROFILER_BUFFER_TRACING_ROCDECODE_API_EXT,
216
218 ///< rocprofiler_kfd_event_page_migrate_operation_t
220 ///< rocprofiler_kfd_event_page_fault_operation_t
221 ROCPROFILER_BUFFER_TRACING_KFD_EVENT_QUEUE, ///< @see rocprofiler_kfd_event_queue_operation_t
223 ///< rocprofiler_kfd_event_unmap_from_gpu_operation_t
225 ///< rocprofiler_kfd_event_dropped_events_operation_t
226 ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE, ///< @see rocprofiler_kfd_page_migrate_operation_t
227 ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT, ///< @see rocprofiler_kfd_page_fault_operation_t
228 ROCPROFILER_BUFFER_TRACING_KFD_QUEUE, ///< @see rocprofiler_kfd_queue_operation_t
230 ///< ::rocprofiler_marker_core_range_api_id_t
231 ROCPROFILER_BUFFER_TRACING_LAST,
232
233 /// @var ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API_EXT
234 /// @brief Similar to ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API except the buffer record
235 /// contains the function argument(s) and return value
236 /// @var ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API_EXT
237 /// @brief Similar to ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API except the buffer record
238 /// contains the function argument(s) and return value
239 /// @var ROCPROFILER_BUFFER_TRACING_ROCDECODE_API_EXT
240 /// @brief Similar to ROCPROFILER_BUFFER_TRACING_ROCDECODE_API except the buffer record
241 /// contains the function argument(s) and return value
243
244/**
245 * @brief ROCProfiler Code Object Tracer Operations.
246 */
247typedef enum rocprofiler_code_object_operation_t // NOLINT(performance-enum-size)
248{
249 ROCPROFILER_CODE_OBJECT_NONE = 0, ///< Unknown code object operation
250 ROCPROFILER_CODE_OBJECT_LOAD, ///< Code object containing kernel symbols
253 ROCPROFILER_CODE_OBJECT_LAST,
255
256/**
257 * @brief ROCProfiler HIP Stream Operations. These operations can be used to associate subsequent
258 * information with a HIP stream
259 */
260typedef enum rocprofiler_hip_stream_operation_t // NOLINT(performance-enum-size)
261{
262 ROCPROFILER_HIP_STREAM_NONE = 0, ///< Unknown stream handle operation
263 ROCPROFILER_HIP_STREAM_CREATE, ///< A stream handle is created
264 ROCPROFILER_HIP_STREAM_DESTROY, ///< A stream handle is destroyed
265 ROCPROFILER_HIP_STREAM_SET,
266 ROCPROFILER_HIP_STREAM_LAST,
267
268 /// @var ROCPROFILER_HIP_STREAM_SET
269 /// @brief Invokes callbacks before and after a HIP API, kernel dispatch, or memory copy
270 /// operation that has a stream handle associated with it. HIP API calls will always have a
271 /// stream, but kernel dispatches and memory copy operations may or may not.
273
274/**
275 * @brief Memory Copy Operations.
276 */
277typedef enum rocprofiler_memory_copy_operation_t // NOLINT(performance-enum-size)
278{
279 ROCPROFILER_MEMORY_COPY_NONE = 0, ///< Unknown memory copy direction
280 ROCPROFILER_MEMORY_COPY_HOST_TO_HOST, ///< Memory copy from host to host
281 ROCPROFILER_MEMORY_COPY_HOST_TO_DEVICE, ///< Memory copy from host to device
282 ROCPROFILER_MEMORY_COPY_DEVICE_TO_HOST, ///< Memory copy from device to host
283 ROCPROFILER_MEMORY_COPY_DEVICE_TO_DEVICE, ///< Memory copy from device to device
284 ROCPROFILER_MEMORY_COPY_LAST,
286
287/**
288 * @brief Memory Allocation Operation.
289 */
290typedef enum rocprofiler_memory_allocation_operation_t // NOLINT(performance-enum-size)
291{
292 ROCPROFILER_MEMORY_ALLOCATION_NONE = 0, ///< Unknown memory allocation function
293 ROCPROFILER_MEMORY_ALLOCATION_ALLOCATE, ///< Allocate memory function
294 ROCPROFILER_MEMORY_ALLOCATION_VMEM_ALLOCATE, ///< Allocate vmem memory handle
295 ROCPROFILER_MEMORY_ALLOCATION_FREE, ///< Free memory function
296 ROCPROFILER_MEMORY_ALLOCATION_VMEM_FREE, ///< Release vmem memory handle
297 ROCPROFILER_MEMORY_ALLOCATION_LAST,
299
300/**
301 * @brief ROCProfiler Kernel Dispatch Tracing Operation Types.
302 */
303typedef enum rocprofiler_kernel_dispatch_operation_t // NOLINT(performance-enum-size)
304{
305 ROCPROFILER_KERNEL_DISPATCH_NONE = 0, ///< Unknown kernel dispatch operation
306 ROCPROFILER_KERNEL_DISPATCH_ENQUEUE = 1,
307 ROCPROFILER_KERNEL_DISPATCH_COMPLETE,
308 ROCPROFILER_KERNEL_DISPATCH_LAST,
309
310 /// @var ROCPROFILER_KERNEL_DISPATCH_ENQUEUE
311 /// @brief Invoke callback prior to a kernel being enqueued and after the kernel has been
312 /// enqueued. When the phase is ::ROCPROFILER_CALLBACK_PHASE_ENTER, this is an opportunity to
313 /// push an external correlation id and/or modify the active contexts before a kernel is
314 /// launched. Any active contexts containing services related to a kernel dispatch (kernel
315 /// tracing, counter collection, etc.) will be captured after this callback and attached to the
316 /// kernel. These captured contexts will be considered "active" when the kernel completes even
317 /// if the context was stopped before the kernel completes -- this contract is designed to
318 /// ensure that tools do not have to delay stopping a context because of an async operation in
319 /// order to get the data they requested when the async operation was started. When the phase is
320 /// ::ROCPROFILER_CALLBACK_PHASE_EXIT, the active contexts for the kernel dispatch have been
321 /// captured and it is safe to disable those contexts without affecting the delivery of the
322 /// requested data when the kernel completes. It is important to note that, even if the context
323 /// associated with the kernel dispatch callback tracing service is disabled in between the
324 /// enter and exit phase, the exit phase callback is still delievered but that context will not
325 /// be captured when the kernel is enqueued and therefore will not provide a
326 /// ::ROCPROFILER_KERNEL_DISPATCH_COMPLETE callback. Furthermore, it should be
327 /// noted that if a tool encodes information into the `::rocprofiler_user_data_t` output
328 /// parameter in ::rocprofiler_callback_tracing_cb_t, that same value will be delivered in the
329 /// exit phase and in the ::ROCPROFILER_KERNEL_DISPATCH_COMPLETE callback. In
330 /// other words, any modifications to that user data value in the exit phase will not be
331 /// reflected in the ::ROCPROFILER_KERNEL_DISPATCH_COMPLETE callback because a
332 /// copy of that user data struct is attached to the kernel, not a reference to the user data
333 /// struct.
334 ///
335 /// @var ROCPROFILER_KERNEL_DISPATCH_COMPLETE
336 /// @brief Invoke callback after a kernel has completed and the HSA runtime has processed the
337 /// signal indicating that the kernel has completed. The latter half of this statement is
338 /// important. There is no guarantee that these callbacks are invoked in any order related to
339 /// when the kernels were dispatched, i.e. even if kernel A is launched and fully executed
340 /// before kernel B is launched, it is entirely possible that the HSA runtime ends up processing
341 /// the signal associated with kernel B before processing the signal associated with kernel A --
342 /// resulting in rocprofiler-sdk invoking this operation callback for kernel B before invoking
343 /// the callback for kernel A.
345
346/**
347 * @brief PC Sampling Method.
348 */
349typedef enum rocprofiler_pc_sampling_method_t // NOLINT(performance-enum-size)
350{
351 ROCPROFILER_PC_SAMPLING_METHOD_NONE = 0, ///< Unknown sampling type
352 ROCPROFILER_PC_SAMPLING_METHOD_STOCHASTIC, ///< Stochastic sampling (MI300+)
353 ROCPROFILER_PC_SAMPLING_METHOD_HOST_TRAP, ///< Interval sampling (MI200+)
354 ROCPROFILER_PC_SAMPLING_METHOD_LAST,
356
357/**
358 * @brief PC Sampling Unit.
359 */
360typedef enum rocprofiler_pc_sampling_unit_t // NOLINT(performance-enum-size)
361{
362 ROCPROFILER_PC_SAMPLING_UNIT_NONE = 0, ///< Sample interval has unspecified units
363 ROCPROFILER_PC_SAMPLING_UNIT_INSTRUCTIONS, ///< Sample interval is in instructions
364 ROCPROFILER_PC_SAMPLING_UNIT_CYCLES, ///< Sample interval is in cycles
365 ROCPROFILER_PC_SAMPLING_UNIT_TIME, ///< Sample internval is in nanoseconds
366 ROCPROFILER_PC_SAMPLING_UNIT_LAST,
368
369/**
370 * @brief Actions when Buffer is full.
371 */
372typedef enum rocprofiler_buffer_policy_t // NOLINT(performance-enum-size)
373{
374 ROCPROFILER_BUFFER_POLICY_NONE = 0, ///< No policy has been set
375 ROCPROFILER_BUFFER_POLICY_DISCARD, ///< Drop records when buffer is full
376 ROCPROFILER_BUFFER_POLICY_LOSSLESS, ///< Block when buffer is full
377 ROCPROFILER_BUFFER_POLICY_LAST,
379
380/**
381 * @brief Scratch event kind
382 */
384{
385 ROCPROFILER_SCRATCH_MEMORY_NONE = 0, ///< Unknown scratch operation
386 ROCPROFILER_SCRATCH_MEMORY_ALLOC, ///< Scratch memory allocation event
387 ROCPROFILER_SCRATCH_MEMORY_FREE, ///< Scratch memory free event
388 ROCPROFILER_SCRATCH_MEMORY_ASYNC_RECLAIM, ///< Scratch memory asynchronously reclaimed
389 ROCPROFILER_SCRATCH_MEMORY_LAST,
391
392/**
393 * @brief Enumeration for specifying runtime libraries supported by rocprofiler. This enumeration is
394 * used for thread creation callbacks. @see INTERNAL_THREADING.
395 */
397{
398 ROCPROFILER_LIBRARY = (1 << 0),
399 ROCPROFILER_HSA_LIBRARY = (1 << 1),
400 ROCPROFILER_HIP_LIBRARY = (1 << 2),
401 ROCPROFILER_MARKER_LIBRARY = (1 << 3),
402 ROCPROFILER_RCCL_LIBRARY = (1 << 4),
403 ROCPROFILER_ROCDECODE_LIBRARY = (1 << 5),
404 ROCPROFILER_ROCJPEG_LIBRARY = (1 << 6),
405 ROCPROFILER_LIBRARY_LAST = ROCPROFILER_ROCJPEG_LIBRARY,
407
408/**
409 * @brief Enumeration for specifying intercept tables supported by rocprofiler. This enumeration is
410 * used for intercept tables. @see INTERCEPT_TABLE.
411 */
413{
414 ROCPROFILER_HSA_TABLE = (1 << 0),
415 ROCPROFILER_HIP_RUNTIME_TABLE = (1 << 1),
416 ROCPROFILER_HIP_COMPILER_TABLE = (1 << 2),
417 ROCPROFILER_MARKER_CORE_TABLE = (1 << 3),
418 ROCPROFILER_MARKER_CONTROL_TABLE = (1 << 4),
419 ROCPROFILER_MARKER_NAME_TABLE = (1 << 5),
420 ROCPROFILER_RCCL_TABLE = (1 << 6),
421 ROCPROFILER_ROCDECODE_TABLE = (1 << 7),
422 ROCPROFILER_ROCJPEG_TABLE = (1 << 8),
423 ROCPROFILER_TABLE_LAST = ROCPROFILER_ROCJPEG_TABLE,
425
426/**
427 * @brief ROCProfiler Runtime Initialization Tracer Operations.
428 */
429typedef enum rocprofiler_runtime_initialization_operation_t // NOLINT(performance-enum-size)
430{
431 ROCPROFILER_RUNTIME_INITIALIZATION_NONE = 0, ///< Unknown runtime initialization
432 ROCPROFILER_RUNTIME_INITIALIZATION_HSA, ///< Application loaded HSA runtime
433 ROCPROFILER_RUNTIME_INITIALIZATION_HIP, ///< Application loaded HIP runtime
434 ROCPROFILER_RUNTIME_INITIALIZATION_MARKER, ///< Application loaded Marker (ROCTx) runtime
435 ROCPROFILER_RUNTIME_INITIALIZATION_RCCL, ///< Application loaded RCCL runtime
436 ROCPROFILER_RUNTIME_INITIALIZATION_ROCDECODE, ///< Application loaded rocDecoder runtime
437 ROCPROFILER_RUNTIME_INITIALIZATION_ROCJPEG, ///< Application loaded rocJPEG runtime
438 ROCPROFILER_RUNTIME_INITIALIZATION_LAST,
440
441/**
442 * @brief Enumeration for specifying the counter info struct version you want.
443 */
445{
446 ROCPROFILER_COUNTER_INFO_VERSION_NONE,
447 ROCPROFILER_COUNTER_INFO_VERSION_0, ///< @see ::rocprofiler_counter_info_v0_t
448 ROCPROFILER_COUNTER_INFO_VERSION_1, ///< @see ::rocprofiler_counter_info_v1_t
449 ROCPROFILER_COUNTER_INFO_VERSION_LAST,
451
452/**
453 * @brief Enumeration for distinguishing different buffer record kinds within the
454 * ::ROCPROFILER_BUFFER_CATEGORY_COUNTERS category
455 */
457{
458 ROCPROFILER_COUNTER_RECORD_NONE = 0,
459 ROCPROFILER_COUNTER_RECORD_PROFILE_COUNTING_DISPATCH_HEADER, ///< ::rocprofiler_dispatch_counting_service_record_t
460 ROCPROFILER_COUNTER_RECORD_VALUE,
461 ROCPROFILER_COUNTER_RECORD_LAST,
462
463 /// @var ROCPROFILER_COUNTER_RECORD_KIND_DISPATCH_PROFILE_HEADER
464 /// @brief Indicates the payload type is of type
465 /// ::rocprofiler_dispatch_counting_service_record_t
467
468/**
469 * @brief Enumeration of flags that can be used with some counter api calls
470 */
472{
473 ROCPROFILER_COUNTER_FLAG_NONE = 0,
474 ROCPROFILER_COUNTER_FLAG_ASYNC, ///< Do not wait for completion before returning.
475 ROCPROFILER_COUNTER_FLAG_APPEND_DEFINITION, ///< Append the counter definition to the system
476 ///< provided counter definition file.
477 ROCPROFILER_COUNTER_FLAG_LAST,
479
480/**
481 * @brief Enumeration for distinguishing different buffer record kinds within the
482 * ::ROCPROFILER_BUFFER_CATEGORY_PC_SAMPLING category
483 */
485{
486 ROCPROFILER_PC_SAMPLING_RECORD_NONE = 0,
487 ROCPROFILER_PC_SAMPLING_RECORD_INVALID_SAMPLE, ///< ::rocprofiler_pc_sampling_record_invalid_t
488 ROCPROFILER_PC_SAMPLING_RECORD_HOST_TRAP_V0_SAMPLE, ///< ::rocprofiler_pc_sampling_record_host_trap_v0_t
489 ROCPROFILER_PC_SAMPLING_RECORD_STOCHASTIC_V0_SAMPLE, ///< ::rocprofiler_pc_sampling_record_stochastic_v0_t
490 ROCPROFILER_PC_SAMPLING_RECORD_LAST,
492
493//--------------------------------------------------------------------------------------//
494//
495// ALIASES
496//
497//--------------------------------------------------------------------------------------//
498
499/**
500 * @brief ROCProfiler Timestamp.
501 */
502typedef uint64_t rocprofiler_timestamp_t;
503
504/**
505 * @brief Thread ID. Value will be equivalent to `syscall(__NR_gettid)`
506 */
507typedef uint64_t rocprofiler_thread_id_t;
508
509/**
510 * @brief Tracing Operation ID. Depending on the kind, operations can be determined.
511 * If the value is equal to zero that means all operations will be considered
512 * for tracing. Detailed API tracing operations can be found at associated header file
513 * for that partiular operation. i.e: For ROCProfiler enumeration of HSA AMD Extended API tracing
514 * operations, look at source/include/rocprofiler-sdk/hsa/amd_ext_api_id.h
515 */
517
518/**
519 * @brief Kernel identifier type
520 *
521 */
522typedef uint64_t rocprofiler_kernel_id_t;
523
524// /**
525// * @brief Sequence identifier type
526// *
527// */
528typedef uint64_t rocprofiler_dispatch_id_t;
529
530/**
531 * @brief Unique record id encoding both the counter
532 * and dimensional values (positions) for the record.
533 */
535
536/**
537 * @brief A dimension for counter instances. Some example
538 * dimensions include XCC, SM (Shader), etc. This
539 * value represents the dimension beind described
540 * or queried about.
541 */
543
544//--------------------------------------------------------------------------------------//
545//
546// UNIONS
547//
548//--------------------------------------------------------------------------------------//
549
550/**
551 * @brief User-assignable data type
552 *
553 */
555{
556 uint64_t value; ///< usage example: set to process id, thread id, etc.
557 void* ptr; ///< usage example: set to address of data allocation
559
560/**
561 * @brief Stores memory address for profiling
562 *
563 */
565{
566 uint64_t handle; ///< compatability
567 uint64_t value; ///< usage example: store address in uint64_t format
568 const void* ptr; ///< usage example: generic form of address
570
571/**
572 * @brief Stores UUID for devices.
573 *
574 */
575typedef struct rocprofiler_uuid_t
576{
577 uint8_t bytes[16]; // numerical value
579
580//--------------------------------------------------------------------------------------//
581//
582// STRUCTS
583//
584//--------------------------------------------------------------------------------------//
585
586/**
587 * @brief Versioning info.
588 */
590{
591 uint32_t major;
592 uint32_t minor;
593 uint32_t patch;
595
596/**
597 * @brief Context ID.
598 */
600{
601 uint64_t handle;
603
604/**
605 * @brief Queue ID.
606 */
608{
609 uint64_t handle;
611
612/**
613 * @brief Stream ID.
614 */
616{
617 uint64_t handle;
619
620/**
621 * @brief ROCProfiler Record Correlation ID.
622 */
624{
625 uint64_t internal;
627 uint64_t ancestor;
628
629 /// @var internal
630 /// @brief A unique ID created by rocprofiler-sdk when an API call is invoked.
631 /// @var external
632 /// @brief An ID specified by tools to associate external events.
633 /// See include/rocprofiler-sdk/external_correlation.h
634 /// @var ancestor
635 /// @brief Stores the @ref internal value of the API call that generated this
636 /// API call.
638
639/**
640 * @brief ROCProfiler Correlation ID record for async activity.
641 */
643{
644 uint64_t internal;
646
647 /// @var internal
648 /// @brief A unique ID created by rocprofiler-sdk when an API call is invoked.
649 /// @var external
650 /// @brief An ID specified by tools to associate external events.
651 /// See include/rocprofiler-sdk/external_correlation.h
653
654/**
655 * @brief The NULL value of an internal correlation ID.
656 */
657#define ROCPROFILER_CORRELATION_ID_INTERNAL_NONE ROCPROFILER_UINT64_C(0)
658
659/**
660 * @brief The NULL value of an ancestor correlation ID.
661 */
662#define ROCPROFILER_CORRELATION_ID_ANCESTOR_NONE ROCPROFILER_UINT64_C(0)
663
664/**
665 * @struct rocprofiler_buffer_id_t
666 * @brief Buffer ID.
667 */
669{
670 uint64_t handle;
672
673/**
674 * @brief Agent Identifier
675 */
677{
678 uint64_t handle;
680
681/**
682 * @brief Counter ID.
683 */
685{
686 uint64_t handle;
688
689/**
690 * @brief Profile Configurations
691 * @see rocprofiler_create_counter_config for how to create.
692 */
694{
695 uint64_t handle; ///< Opaque handle
697
698/**
699 * @brief Multi-dimensional struct of data used to describe GPU workgroup and grid sizes
700 */
701typedef struct rocprofiler_dim3_t
702{
703 uint32_t x;
704 uint32_t y;
705 uint32_t z;
707
708/**
709 * @brief Tracing record
710 *
711 */
722
723/**
724 * @brief Generic record with type identifier(s) and a pointer to data. This data type is used with
725 * buffered data.
726 *
727 * @code{.cpp}
728 * void
729 * tool_tracing_callback(rocprofiler_record_header_t** headers,
730 * size_t num_headers)
731 * {
732 * for(size_t i = 0; i < num_headers; ++i)
733 * {
734 * rocprofiler_record_header_t* header = headers[i];
735 *
736 * if(header->category == ROCPROFILER_BUFFER_CATEGORY_TRACING &&
737 * header->kind == ROCPROFILER_BUFFER_TRACING_HSA_API)
738 * {
739 * // cast to rocprofiler_buffer_tracing_hsa_api_record_t which
740 * // is type associated with this category + kind
741 * auto* record =
742 * static_cast<rocprofiler_buffer_tracing_hsa_api_record_t*>(header->payload);
743 *
744 * // trivial test
745 * assert(record->start_timestamp <= record->end_timestamp);
746 * }
747 * }
748 * }
749 *
750 * @endcode
751 */
753{
754 union
755 {
756 struct
757 {
758 /** @brief ::rocprofiler_buffer_category_t */
759 uint32_t category;
760 /** @brief domain */
761 uint32_t kind;
762 };
763 /** @brief generic identifier. You can compute this via: `uint64_t hash = category |
764 * ((uint64_t)(kind) << 32)` */
765 uint64_t hash;
766 };
767 /** @brief Pointer to data. Should be casted to data type based on category + kind */
768 void* payload;
770
771/**
772 * @brief Function for computing the unsigned 64-bit hash value in ::rocprofiler_record_header_t
773 * from a category and kind (two unsigned 32-bit values)
774 *
775 * @param [in] category a value from ::rocprofiler_buffer_category_t
776 * @param [in] kind depending on the category, this is the domain value, e.g.,
777 * ::rocprofiler_buffer_tracing_kind_t value
778 * @return uint64_t hash value of category and kind
779 */
780static inline uint64_t
781rocprofiler_record_header_compute_hash(uint32_t category, uint32_t kind)
782{
783 uint64_t value = category;
784 value |= ((uint64_t)(kind)) << 32;
785 return value;
786}
787
788/**
789 * @brief ROCProfiler kernel dispatch information
790 *
791 */
793{
794 uint64_t size; ///< Size of this struct (minus reserved padding)
795 rocprofiler_agent_id_t agent_id; ///< Agent ID where kernel is launched
796 rocprofiler_queue_id_t queue_id; ///< Queue ID where kernel packet is enqueued
797 rocprofiler_kernel_id_t kernel_id; ///< Kernel identifier
798 rocprofiler_dispatch_id_t dispatch_id; ///< unique id for each dispatch
801 rocprofiler_dim3_t workgroup_size; ///< runtime workgroup size (grid * threads)
802 rocprofiler_dim3_t grid_size; ///< runtime grid size
803 uint8_t reserved_padding[56]; // reserved for extensions w/o ABI break
804
805 /// @var group_segment_size
806 /// @brief Runtime group memory segment size. Size of group segment memory (static + runtime)
807 /// required by the kernel (per work-group), in bytes. AKA: LDS size
808 ///
809 /// @var private_segment_size
810 /// @brief Runtime private memory segment size. Size of private, spill, and arg segment memory
811 /// (static + runtime) required by this kernel (per work-item), in bytes. AKA: scratch size
813
814/**
815 * @brief (experimental) Details for the dimension, including its size, for a counter record.
816 */
817typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_record_dimension_info_t
818{
819 const char* name;
820 size_t instance_size;
822
823 /// @var id
824 /// @brief Id for this dimension used by ::rocprofiler_query_record_dimension_position
826
827ROCPROFILER_SDK_DEPRECATED("rocprofiler_counter_record_dimension_info_t was renamed to "
828 "rocprofiler_counter_record_dimension_info_t")
830
831/**
832 * @brief (experimental) ROCProfiler Profile Counting Counter Record per instance.
833 */
834typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_counter_record_t
835{
836 rocprofiler_counter_instance_id_t id; ///< counter identifier
837 double counter_value; ///< counter value
838 rocprofiler_dispatch_id_t dispatch_id;
839 rocprofiler_user_data_t user_data;
840 rocprofiler_agent_id_t agent_id;
841
842 /// @var dispatch_id
843 /// @brief A value greater than zero indicates that this counter record is associated with a
844 /// specific dispatch.
845 ///
846 /// This value can be mapped to a dispatch via the `dispatch_info` field (@see
847 /// ::rocprofiler_kernel_dispatch_info_t) of a ::rocprofiler_dispatch_counting_service_data_t
848 /// instance (provided during callback for profile config) or a
849 /// ::rocprofiler_dispatch_counting_service_record_t records (which will be insert into the
850 /// buffer prior to the associated ::rocprofiler_counter_record_t records).
852
853ROCPROFILER_SDK_DEPRECATED(
854 "rocprofiler_record_counter_t was renamed to rocprofiler_counter_record_t")
856
857#if defined(ROCPROFILER_SDK_BETA_COMPAT) && ROCPROFILER_SDK_BETA_COMPAT > 0
858
859// "profile_config" renamed to "counter_config"
860ROCPROFILER_SDK_DEPRECATED("profile_config renamed to counter_config")
861typedef rocprofiler_counter_config_id_t rocprofiler_profile_config_id_t;
862
863#endif
864
865/** @} */
866
867ROCPROFILER_EXTERN_C_FINI
868
869ROCPROFILER_CXX_CODE(
870 static_assert(sizeof(rocprofiler_kernel_dispatch_info_t) == 128,
871 "Increasing the size of the kernel dispatch info is not permitted");)
void * ptr
usage example: set to address of data allocation
Definition fwd.h:557
uint32_t private_segment_size
Runtime private memory segment size. Size of private, spill, and arg segment memory (static + runtime...
Definition fwd.h:799
rocprofiler_dim3_t grid_size
runtime grid size
Definition fwd.h:802
uint64_t handle
compatability
Definition fwd.h:566
uint64_t handle
Opaque handle.
Definition fwd.h:695
uint64_t value
usage example: set to process id, thread id, etc.
Definition fwd.h:556
rocprofiler_user_data_t external
An ID specified by tools to associate external events. See include/rocprofiler-sdk/external_correlati...
Definition fwd.h:626
rocprofiler_agent_id_t agent_id
Agent ID where kernel is launched.
Definition fwd.h:795
const void * ptr
usage example: generic form of address
Definition fwd.h:568
uint64_t internal
A unique ID created by rocprofiler-sdk when an API call is invoked.
Definition fwd.h:644
rocprofiler_user_data_t external
An ID specified by tools to associate external events. See include/rocprofiler-sdk/external_correlati...
Definition fwd.h:645
void * payload
Pointer to data. Should be casted to data type based on category + kind.
Definition fwd.h:768
rocprofiler_dispatch_id_t dispatch_id
unique id for each dispatch
Definition fwd.h:798
rocprofiler_kernel_id_t kernel_id
Kernel identifier.
Definition fwd.h:797
uint32_t group_segment_size
Runtime group memory segment size. Size of group segment memory (static + runtime) required by the ke...
Definition fwd.h:800
uint64_t internal
A unique ID created by rocprofiler-sdk when an API call is invoked.
Definition fwd.h:625
uint64_t size
Size of this struct (minus reserved padding)
Definition fwd.h:794
uint64_t value
usage example: store address in uint64_t format
Definition fwd.h:567
double counter_value
counter value
Definition fwd.h:837
rocprofiler_dispatch_id_t dispatch_id
A value greater than zero indicates that this counter record is associated with a specific dispatch.
Definition fwd.h:838
rocprofiler_dim3_t workgroup_size
runtime workgroup size (grid * threads)
Definition fwd.h:801
rocprofiler_counter_instance_id_t id
counter identifier
Definition fwd.h:836
rocprofiler_counter_dimension_id_t id
Id for this dimension used by rocprofiler_query_record_dimension_position.
Definition fwd.h:821
rocprofiler_queue_id_t queue_id
Queue ID where kernel packet is enqueued.
Definition fwd.h:796
uint64_t ancestor
Stores the internal value of the API call that generated this API call.
Definition fwd.h:627
rocprofiler_pc_sampling_method_t
PC Sampling Method.
Definition fwd.h:350
rocprofiler_code_object_operation_t
ROCProfiler Code Object Tracer Operations.
Definition fwd.h:248
int32_t rocprofiler_tracing_operation_t
Tracing Operation ID. Depending on the kind, operations can be determined. If the value is equal to z...
Definition fwd.h:516
rocprofiler_buffer_policy_t
Actions when Buffer is full.
Definition fwd.h:373
rocprofiler_scratch_memory_operation_t
Scratch event kind.
Definition fwd.h:384
uint64_t rocprofiler_counter_dimension_id_t
A dimension for counter instances. Some example dimensions include XCC, SM (Shader),...
Definition fwd.h:542
rocprofiler_memory_copy_operation_t
Memory Copy Operations.
Definition fwd.h:278
uint64_t rocprofiler_counter_instance_id_t
Unique record id encoding both the counter and dimensional values (positions) for the record.
Definition fwd.h:534
rocprofiler_runtime_initialization_operation_t
ROCProfiler Runtime Initialization Tracer Operations.
Definition fwd.h:430
rocprofiler_memory_allocation_operation_t
Memory Allocation Operation.
Definition fwd.h:291
rocprofiler_counter_record_kind_t
Enumeration for distinguishing different buffer record kinds within the ROCPROFILER_BUFFER_CATEGORY_C...
Definition fwd.h:457
rocprofiler_pc_sampling_unit_t
PC Sampling Unit.
Definition fwd.h:361
rocprofiler_intercept_table_t
Enumeration for specifying intercept tables supported by rocprofiler. This enumeration is used for in...
Definition fwd.h:413
rocprofiler_status_t
Status codes.
Definition fwd.h:49
rocprofiler_callback_phase_t
Service Callback Phase.
Definition fwd.h:137
uint64_t rocprofiler_kernel_id_t
Kernel identifier type.
Definition fwd.h:522
uint64_t rocprofiler_thread_id_t
Thread ID. Value will be equivalent to syscall(__NR_gettid)
Definition fwd.h:507
rocprofiler_buffer_tracing_kind_t
Service Buffer Tracing Kind.
Definition fwd.h:187
rocprofiler_pc_sampling_record_kind_t
Enumeration for distinguishing different buffer record kinds within the ROCPROFILER_BUFFER_CATEGORY_P...
Definition fwd.h:485
rocprofiler_kernel_dispatch_operation_t
ROCProfiler Kernel Dispatch Tracing Operation Types.
Definition fwd.h:304
rocprofiler_runtime_library_t
Enumeration for specifying runtime libraries supported by rocprofiler. This enumeration is used for t...
Definition fwd.h:397
uint64_t rocprofiler_timestamp_t
ROCProfiler Timestamp.
Definition fwd.h:502
rocprofiler_buffer_category_t
Buffer record categories. This enumeration type is encoded in rocprofiler_record_header_t category fi...
Definition fwd.h:114
rocprofiler_callback_tracing_kind_t
Service Callback Tracing Kind.
Definition fwd.h:152
rocprofiler_hip_stream_operation_t
ROCProfiler HIP Stream Operations. These operations can be used to associate subsequent information w...
Definition fwd.h:261
rocprofiler_agent_type_t
Agent type.
Definition fwd.h:126
rocprofiler_counter_info_version_id_t
Enumeration for specifying the counter info struct version you want.
Definition fwd.h:445
rocprofiler_counter_flag_t
Enumeration of flags that can be used with some counter api calls.
Definition fwd.h:472
@ ROCPROFILER_PC_SAMPLING_METHOD_STOCHASTIC
Stochastic sampling (MI300+)
Definition fwd.h:352
@ ROCPROFILER_PC_SAMPLING_METHOD_HOST_TRAP
Interval sampling (MI200+)
Definition fwd.h:353
@ ROCPROFILER_PC_SAMPLING_METHOD_NONE
Unknown sampling type.
Definition fwd.h:351
@ ROCPROFILER_CODE_OBJECT_HOST_KERNEL_SYMBOL_REGISTER
Kernel symbols - Host.
Definition fwd.h:252
@ ROCPROFILER_CODE_OBJECT_DEVICE_KERNEL_SYMBOL_REGISTER
Kernel symbols - Device.
Definition fwd.h:251
@ ROCPROFILER_CODE_OBJECT_NONE
Unknown code object operation.
Definition fwd.h:249
@ ROCPROFILER_CODE_OBJECT_LOAD
Code object containing kernel symbols.
Definition fwd.h:250
@ ROCPROFILER_BUFFER_POLICY_DISCARD
Drop records when buffer is full.
Definition fwd.h:375
@ ROCPROFILER_BUFFER_POLICY_NONE
No policy has been set.
Definition fwd.h:374
@ ROCPROFILER_BUFFER_POLICY_LOSSLESS
Block when buffer is full.
Definition fwd.h:376
@ ROCPROFILER_SCRATCH_MEMORY_ALLOC
Scratch memory allocation event.
Definition fwd.h:386
@ ROCPROFILER_SCRATCH_MEMORY_FREE
Scratch memory free event.
Definition fwd.h:387
@ ROCPROFILER_SCRATCH_MEMORY_ASYNC_RECLAIM
Scratch memory asynchronously reclaimed.
Definition fwd.h:388
@ ROCPROFILER_SCRATCH_MEMORY_NONE
Unknown scratch operation.
Definition fwd.h:385
@ ROCPROFILER_MEMORY_COPY_DEVICE_TO_DEVICE
Memory copy from device to device.
Definition fwd.h:283
@ ROCPROFILER_MEMORY_COPY_HOST_TO_HOST
Memory copy from host to host.
Definition fwd.h:280
@ ROCPROFILER_MEMORY_COPY_DEVICE_TO_HOST
Memory copy from device to host.
Definition fwd.h:282
@ ROCPROFILER_MEMORY_COPY_NONE
Unknown memory copy direction.
Definition fwd.h:279
@ ROCPROFILER_MEMORY_COPY_HOST_TO_DEVICE
Memory copy from host to device.
Definition fwd.h:281
@ ROCPROFILER_RUNTIME_INITIALIZATION_NONE
Unknown runtime initialization.
Definition fwd.h:431
@ ROCPROFILER_RUNTIME_INITIALIZATION_ROCJPEG
Application loaded rocJPEG runtime.
Definition fwd.h:437
@ ROCPROFILER_RUNTIME_INITIALIZATION_ROCDECODE
Application loaded rocDecoder runtime.
Definition fwd.h:436
@ ROCPROFILER_RUNTIME_INITIALIZATION_HIP
Application loaded HIP runtime.
Definition fwd.h:433
@ ROCPROFILER_RUNTIME_INITIALIZATION_MARKER
Application loaded Marker (ROCTx) runtime.
Definition fwd.h:434
@ ROCPROFILER_RUNTIME_INITIALIZATION_RCCL
Application loaded RCCL runtime.
Definition fwd.h:435
@ ROCPROFILER_RUNTIME_INITIALIZATION_HSA
Application loaded HSA runtime.
Definition fwd.h:432
@ ROCPROFILER_MEMORY_ALLOCATION_NONE
Unknown memory allocation function.
Definition fwd.h:292
@ ROCPROFILER_MEMORY_ALLOCATION_ALLOCATE
Allocate memory function.
Definition fwd.h:293
@ ROCPROFILER_MEMORY_ALLOCATION_FREE
Free memory function.
Definition fwd.h:295
@ ROCPROFILER_MEMORY_ALLOCATION_VMEM_FREE
Release vmem memory handle.
Definition fwd.h:296
@ ROCPROFILER_MEMORY_ALLOCATION_VMEM_ALLOCATE
Allocate vmem memory handle.
Definition fwd.h:294
@ ROCPROFILER_COUNTER_RECORD_PROFILE_COUNTING_DISPATCH_HEADER
rocprofiler_dispatch_counting_service_record_t
Definition fwd.h:459
@ ROCPROFILER_PC_SAMPLING_UNIT_TIME
Sample internval is in nanoseconds.
Definition fwd.h:365
@ ROCPROFILER_PC_SAMPLING_UNIT_NONE
Sample interval has unspecified units.
Definition fwd.h:362
@ ROCPROFILER_PC_SAMPLING_UNIT_INSTRUCTIONS
Sample interval is in instructions.
Definition fwd.h:363
@ ROCPROFILER_PC_SAMPLING_UNIT_CYCLES
Sample interval is in cycles.
Definition fwd.h:364
@ ROCPROFILER_STATUS_ERROR_FINALIZED
invalid because rocprofiler has been finalized
Definition fwd.h:79
@ ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_STARTED
Context was not started (e.g., atomic swap into active array failed)
Definition fwd.h:61
@ ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT
Function invoked with one or more invalid arguments.
Definition fwd.h:76
@ ROCPROFILER_STATUS_ERROR_NO_PROFILE_QUEUE
Profile queue creation failed.
Definition fwd.h:97
@ ROCPROFILER_STATUS_ERROR_CONTEXT_ERROR
Generalized context error.
Definition fwd.h:59
@ ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED
Function call is not valid outside of rocprofiler configuration (i.e. function called post-initializa...
Definition fwd.h:70
@ ROCPROFILER_STATUS_ERROR_BUFFER_NOT_FOUND
No valid buffer for given buffer id.
Definition fwd.h:53
@ ROCPROFILER_STATUS_ERROR_PROFILE_NOT_FOUND
Could not find the counter profile.
Definition fwd.h:92
@ ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND
Counter identifier does not exist.
Definition fwd.h:58
@ ROCPROFILER_STATUS_ERROR_THREAD_NOT_FOUND
No valid thread for given thread id.
Definition fwd.h:56
@ ROCPROFILER_STATUS_ERROR_CONTEXT_CONFLICT
Context operation failed due to a conflict with another context.
Definition fwd.h:63
@ ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED
service has already been configured in context
Definition fwd.h:68
@ ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED
Function is not implemented.
Definition fwd.h:73
@ ROCPROFILER_STATUS_ERROR_AGENT_MISMATCH
Agent mismatch between profile and context.
Definition fwd.h:99
@ ROCPROFILER_STATUS_ERROR_PERMISSION_DENIED
Permission denied.
Definition fwd.h:105
@ ROCPROFILER_STATUS_ERROR_AGENT_DISPATCH_CONFLICT
Cannot enable both agent and dispatch counting in the same context.
Definition fwd.h:93
@ ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUND
Operation identifier is invalid for domain.
Definition fwd.h:55
@ ROCPROFILER_STATUS_ERROR_AQL_NO_EVENT_COORD
Event coordinate was not found by AQL profile.
Definition fwd.h:86
@ ROCPROFILER_STATUS_ERROR_NOT_AVAILABLE
The service is not available. Please refer to API functions that return this status code for more inf...
Definition fwd.h:100
@ ROCPROFILER_STATUS_ERROR_SAMPLE_RATE_EXCEEDED
Sample rate exceeded.
Definition fwd.h:96
@ ROCPROFILER_STATUS_ERROR_CONTEXT_INVALID
Context configuration is not valid.
Definition fwd.h:60
@ ROCPROFILER_STATUS_ERROR_OUT_OF_RESOURCES
The given resources are insufficient to complete operation.
Definition fwd.h:90
@ ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND
Agent identifier not found.
Definition fwd.h:57
@ ROCPROFILER_STATUS_ERROR
Generalized error.
Definition fwd.h:51
@ ROCPROFILER_STATUS_ERROR_EXCEEDS_HW_LIMIT
Exceeds hardware limits for collection.
Definition fwd.h:103
@ ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND
No valid context for given context id.
Definition fwd.h:52
@ ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND
Kind identifier is invalid.
Definition fwd.h:54
@ ROCPROFILER_STATUS_INTERNAL_NO_AGENT_CONTEXT
No agent context found, may not be an error.
Definition fwd.h:95
@ ROCPROFILER_STATUS_ERROR_AST_GENERATION_FAILED
AST could not be generated correctly.
Definition fwd.h:84
@ ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_KERNEL
A service depends on a newer version of KFD (amdgpu kernel driver). Check logs for service that repor...
Definition fwd.h:87
@ ROCPROFILER_STATUS_ERROR_PROFILE_COUNTER_NOT_FOUND
Profile could not find counter for GPU agent.
Definition fwd.h:82
@ ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED
Agent HW architecture not supported.
Definition fwd.h:104
@ ROCPROFILER_STATUS_ERROR_DIM_NOT_FOUND
Dimension is not found for counter.
Definition fwd.h:81
@ ROCPROFILER_STATUS_ERROR_METRIC_NOT_VALID_FOR_AGENT
Invalid metric supplied to agent.
Definition fwd.h:78
@ ROCPROFILER_STATUS_ERROR_BUFFER_BUSY
buffer operation failed because it currently busy handling another request (e.g. flushing)
Definition fwd.h:66
@ ROCPROFILER_STATUS_SUCCESS
No error occurred.
Definition fwd.h:50
@ ROCPROFILER_STATUS_ERROR_INCOMPATIBLE_ABI
Data structure provided by user is incompatible with current version of rocprofiler.
Definition fwd.h:74
@ ROCPROFILER_STATUS_ERROR_CONTEXT_ID_NOT_ZERO
Context ID is not initialized to zero.
Definition fwd.h:65
@ ROCPROFILER_STATUS_ERROR_NO_HARDWARE_COUNTERS
No hardware counters were specified.
Definition fwd.h:98
@ ROCPROFILER_STATUS_ERROR_AST_NOT_FOUND
AST was not found.
Definition fwd.h:85
@ ROCPROFILER_STATUS_ERROR_HSA_NOT_LOADED
Call requires HSA to be loaded before performed.
Definition fwd.h:80
@ ROCPROFILER_CALLBACK_PHASE_NONE
Callback has no phase.
Definition fwd.h:138
@ ROCPROFILER_CALLBACK_PHASE_UNLOAD
Callback invoked prior to code object unloading.
Definition fwd.h:143
@ ROCPROFILER_CALLBACK_PHASE_EXIT
Callback invoked after to function execution.
Definition fwd.h:142
@ ROCPROFILER_CALLBACK_PHASE_ENTER
Callback invoked prior to function execution.
Definition fwd.h:139
@ ROCPROFILER_CALLBACK_PHASE_LOAD
Callback invoked prior to code object loading.
Definition fwd.h:140
@ ROCPROFILER_BUFFER_TRACING_KFD_EVENT_QUEUE
Definition fwd.h:221
@ ROCPROFILER_BUFFER_TRACING_MARKER_CORE_API
Definition fwd.h:196
@ ROCPROFILER_BUFFER_TRACING_KFD_EVENT_PAGE_FAULT
Definition fwd.h:219
@ ROCPROFILER_BUFFER_TRACING_RUNTIME_INITIALIZATION
Record indicating a runtime library has been initialized.
Definition fwd.h:207
@ ROCPROFILER_BUFFER_TRACING_MEMORY_ALLOCATION
Definition fwd.h:205
@ ROCPROFILER_BUFFER_TRACING_KFD_EVENT_UNMAP_FROM_GPU
Definition fwd.h:222
@ ROCPROFILER_BUFFER_TRACING_HIP_STREAM
Definition fwd.h:212
@ ROCPROFILER_BUFFER_TRACING_MARKER_NAME_API
Definition fwd.h:198
@ ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE
Definition fwd.h:226
@ ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT
Correlation ID in no longer in use.
Definition fwd.h:202
@ ROCPROFILER_BUFFER_TRACING_MARKER_CORE_RANGE_API
Definition fwd.h:229
@ ROCPROFILER_BUFFER_TRACING_HSA_CORE_API
Definition fwd.h:189
@ ROCPROFILER_BUFFER_TRACING_MEMORY_COPY
Definition fwd.h:199
@ ROCPROFILER_BUFFER_TRACING_RCCL_API
RCCL tracing.
Definition fwd.h:203
@ ROCPROFILER_BUFFER_TRACING_ROCDECODE_API
rocDecode tracing
Definition fwd.h:210
@ ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY
Buffer scratch memory reclaimation info.
Definition fwd.h:201
@ ROCPROFILER_BUFFER_TRACING_KFD_EVENT_DROPPED_EVENTS
Definition fwd.h:224
@ ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH
Buffer kernel dispatch info.
Definition fwd.h:200
@ ROCPROFILER_BUFFER_TRACING_KFD_EVENT_PAGE_MIGRATE
Definition fwd.h:217
@ ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API
Definition fwd.h:194
@ ROCPROFILER_BUFFER_TRACING_MARKER_CONTROL_API
Definition fwd.h:197
@ ROCPROFILER_BUFFER_TRACING_OMPT
Definition fwd.h:204
@ ROCPROFILER_BUFFER_TRACING_ROCJPEG_API
rocJPEG tracing
Definition fwd.h:211
@ ROCPROFILER_BUFFER_TRACING_KFD_QUEUE
Definition fwd.h:228
@ ROCPROFILER_BUFFER_TRACING_HSA_IMAGE_EXT_API
Definition fwd.h:191
@ ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API
Definition fwd.h:195
@ ROCPROFILER_BUFFER_TRACING_HSA_AMD_EXT_API
Definition fwd.h:190
@ ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT
Definition fwd.h:227
@ ROCPROFILER_BUFFER_TRACING_HSA_FINALIZE_EXT_API
Definition fwd.h:192
@ ROCPROFILER_PC_SAMPLING_RECORD_HOST_TRAP_V0_SAMPLE
rocprofiler_pc_sampling_record_host_trap_v0_t
Definition fwd.h:488
@ ROCPROFILER_PC_SAMPLING_RECORD_INVALID_SAMPLE
rocprofiler_pc_sampling_record_invalid_t
Definition fwd.h:487
@ ROCPROFILER_PC_SAMPLING_RECORD_STOCHASTIC_V0_SAMPLE
rocprofiler_pc_sampling_record_stochastic_v0_t
Definition fwd.h:489
@ ROCPROFILER_KERNEL_DISPATCH_NONE
Unknown kernel dispatch operation.
Definition fwd.h:305
@ ROCPROFILER_CALLBACK_TRACING_CODE_OBJECT
Definition fwd.h:165
@ ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API
rocJPEG API Tracing
Definition fwd.h:176
@ ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API
rocDecode API Tracing
Definition fwd.h:175
@ ROCPROFILER_CALLBACK_TRACING_MEMORY_ALLOCATION
Definition fwd.h:171
@ ROCPROFILER_CALLBACK_TRACING_OMPT
Definition fwd.h:170
@ ROCPROFILER_CALLBACK_TRACING_MARKER_CONTROL_API
Definition fwd.h:162
@ ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_RANGE_API
Definition fwd.h:178
@ ROCPROFILER_CALLBACK_TRACING_KERNEL_DISPATCH
Callbacks for kernel dispatches.
Definition fwd.h:167
@ ROCPROFILER_CALLBACK_TRACING_RCCL_API
RCCL tracing.
Definition fwd.h:169
@ ROCPROFILER_CALLBACK_TRACING_RUNTIME_INITIALIZATION
Callback notifying that a runtime library has been initialized.
Definition fwd.h:173
@ ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API
Definition fwd.h:160
@ ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API
Definition fwd.h:155
@ ROCPROFILER_CALLBACK_TRACING_MARKER_NAME_API
Definition fwd.h:164
@ ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API
Definition fwd.h:154
@ ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY
Definition fwd.h:168
@ ROCPROFILER_CALLBACK_TRACING_SCRATCH_MEMORY
Definition fwd.h:166
@ ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API
Definition fwd.h:159
@ ROCPROFILER_CALLBACK_TRACING_HIP_STREAM
Definition fwd.h:177
@ ROCPROFILER_CALLBACK_TRACING_HSA_IMAGE_EXT_API
Definition fwd.h:156
@ ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API
Definition fwd.h:161
@ ROCPROFILER_CALLBACK_TRACING_HSA_FINALIZE_EXT_API
Definition fwd.h:157
@ ROCPROFILER_HIP_STREAM_DESTROY
A stream handle is destroyed.
Definition fwd.h:264
@ ROCPROFILER_HIP_STREAM_NONE
Unknown stream handle operation.
Definition fwd.h:262
@ ROCPROFILER_HIP_STREAM_CREATE
A stream handle is created.
Definition fwd.h:263
@ ROCPROFILER_AGENT_TYPE_NONE
Agent type is unknown.
Definition fwd.h:127
@ ROCPROFILER_AGENT_TYPE_GPU
Agent type is a GPU.
Definition fwd.h:129
@ ROCPROFILER_AGENT_TYPE_CPU
Agent type is a CPU.
Definition fwd.h:128
@ ROCPROFILER_COUNTER_INFO_VERSION_0
Definition fwd.h:447
@ ROCPROFILER_COUNTER_INFO_VERSION_1
Definition fwd.h:448
@ ROCPROFILER_COUNTER_FLAG_APPEND_DEFINITION
Append the counter definition to the system provided counter definition file.
Definition fwd.h:475
@ ROCPROFILER_COUNTER_FLAG_ASYNC
Do not wait for completion before returning.
Definition fwd.h:474
Agent Identifier.
Definition fwd.h:677
ROCProfiler Correlation ID record for async activity.
Definition fwd.h:643
Context ID.
Definition fwd.h:600
ROCProfiler Record Correlation ID.
Definition fwd.h:624
Profile Configurations.
Definition fwd.h:694
Counter ID.
Definition fwd.h:685
(experimental) Details for the dimension, including its size, for a counter record.
Definition fwd.h:818
(experimental) ROCProfiler Profile Counting Counter Record per instance.
Definition fwd.h:835
Multi-dimensional struct of data used to describe GPU workgroup and grid sizes.
Definition fwd.h:702
ROCProfiler kernel dispatch information.
Definition fwd.h:793
Generic record with type identifier(s) and a pointer to data. This data type is used with buffered da...
Definition fwd.h:753
Stores UUID for devices.
Definition fwd.h:576
Versioning info.
Definition fwd.h:590
Stores memory address for profiling.
Definition fwd.h:565
User-assignable data type.
Definition fwd.h:555