rocprofiler-sdk/counter_config.h Source File

rocprofiler-sdk/counter_config.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/counter_config.h Source File
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
counter_config.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 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/agent.h>
26#include <rocprofiler-sdk/defines.h>
27#include <rocprofiler-sdk/fwd.h>
28
29ROCPROFILER_EXTERN_C_INIT
30
31/**
32 * @defgroup COUNTER_CONFIG HW Counter Configurations
33 * @brief Group one or more hardware counters into a unique handle
34 *
35 * @{
36 */
37
38/**
39 * @brief (experimental) Create Counter Configuration. A config is bound to an agent but can
40 * be used across many contexts. The config has a fixed set of counters
41 * that are collected (and specified by counter_list). The available
42 * counters for an agent can be queried using
43 * ::rocprofiler_iterate_agent_supported_counters. An existing config
44 * may be supplied via config_id to use as a base for the new config.
45 * All counters in the existing config will be copied over to the new
46 * config. The existing config will remain unmodified and usable with
47 * the new config id being returned in config_id.
48 *
49 * @param [in] agent_id Agent identifier
50 * @param [in] counters_list List of GPU counters
51 * @param [in] counters_count Size of counters list
52 * @param [in,out] config_id Identifier for GPU counters group. If an existing
53 config is supplied, that profiles counters will be copied
54 over to a new config (returned via this id)
55 * @return ::rocprofiler_status_t
56 * @retval ROCPROFILER_STATUS_SUCCESS if config created
57 * @retval ROCPROFILER_STATUS_ERROR if config could not be created
58 *
59 */
60ROCPROFILER_SDK_EXPERIMENTAL
63 rocprofiler_counter_id_t* counters_list,
64 size_t counters_count,
65 rocprofiler_counter_config_id_t* config_id) ROCPROFILER_API
66 ROCPROFILER_NONNULL(4);
67
68/**
69 * @brief (experimental) Destroy Profile Configuration.
70 *
71 * @param [in] config_id
72 * @return ::rocprofiler_status_t
73 * @retval ROCPROFILER_STATUS_SUCCESS if config destroyed
74 * @retval ROCPROFILER_STATUS_ERROR if config could not be destroyed
75 */
76ROCPROFILER_SDK_EXPERIMENTAL
79
80/** @} */
81
82ROCPROFILER_EXTERN_C_FINI
rocprofiler_status_t
Status codes.
Definition fwd.h:49
Agent Identifier.
Definition fwd.h:677
Profile Configurations.
Definition fwd.h:694
Counter ID.
Definition fwd.h:685
rocprofiler_status_t rocprofiler_create_counter_config(rocprofiler_agent_id_t agent_id, rocprofiler_counter_id_t *counters_list, unsigned long counters_count, rocprofiler_counter_config_id_t *config_id)
(experimental) Create Counter Configuration. A config is bound to an agent but can be used across man...
rocprofiler_status_t rocprofiler_destroy_counter_config(rocprofiler_counter_config_id_t config_id)
(experimental) Destroy Profile Configuration.