NVTX C API Reference v3
NVIDIA Tools Extension Library
Loading...
Searching...
No Matches
nvToolsExtSemanticsCounters.h
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * Licensed under the Apache License v2.0 with LLVM Exceptions.
18 * See https://nvidia.github.io/NVTX/LICENSE.txt for license information.
19 */
20
21#if defined(NVTX_AS_SYSTEM_HEADER)
22#if defined(__clang__)
23#pragma clang system_header
24#elif defined(__GNUC__) || defined(__NVCOMPILER)
25#pragma GCC system_header
26#elif defined(_MSC_VER)
27#pragma system_header
28#endif
29#endif
30
31#include "nvToolsExtPayload.h"
32
34#ifndef NVTX_SEMANTIC_ID_COUNTERS_V1
35#define NVTX_SEMANTIC_ID_COUNTERS_V1 5
36
37/* Use with the version field of `nvtxSemanticsHeader_t`. */
38#define NVTX_COUNTER_SEMANTIC_VERSION 2
39
40/*** Flags to augment the counter value. ***/
41#define NVTX_COUNTER_FLAGS_NONE 0
42
48#define NVTX_COUNTER_FLAG_NORMALIZE (1 << 1)
49
54#define NVTX_COUNTER_FLAG_LIMIT_MIN (1 << 2)
55#define NVTX_COUNTER_FLAG_LIMIT_MAX (1 << 3)
56#define NVTX_COUNTER_FLAG_LIMITS \
57 (NVTX_COUNTER_FLAG_LIMIT_MIN | NVTX_COUNTER_FLAG_LIMIT_MAX)
58
62#define NVTX_COUNTER_FLAG_VALUETYPE_ABSOLUTE (1 << 4)
63/* Delta to previous sample, tool-defined if no previous sample is available. */
64#define NVTX_COUNTER_FLAG_VALUETYPE_DELTA (2 << 4)
65#define NVTX_COUNTER_FLAG_VALUETYPE_DELTA_SINCE_START (3 << 4)
66/* Mask covering the NVTX_COUNTER_FLAG_VALUETYPE_* bit range;
67 * use to test whether a value type is already set, or to clear the current
68 * value type before OR-ing in a new one. */
69#define NVTX_COUNTER_FLAG_VALUETYPES (3 << 4)
70
74/* No interpolation between samples. */
75#define NVTX_COUNTER_FLAG_INTERPOLATION_POINT (1 << 8)
76/* Piecewise constant interpolation between the current and the last sample. */
77#define NVTX_COUNTER_FLAG_INTERPOLATION_SINCE_LAST (2 << 8)
78/* Piecewise constant interpolation between the current and the next sample. */
79#define NVTX_COUNTER_FLAG_INTERPOLATION_UNTIL_NEXT (3 << 8)
80/* Piecewise linear interpolation between samples. */
81#define NVTX_COUNTER_FLAG_INTERPOLATION_LINEAR (4 << 8)
82/* Mask covering the NVTX_COUNTER_FLAG_INTERPOLATION_* bit range;
83 * use to test whether a value type is already set, or to clear the current
84 * value type before OR-ing in a new one. */
85#define NVTX_COUNTER_FLAG_INTERPOLATIONS (7 << 8)
86
90#define NVTX_COUNTER_LIMIT_UNDEFINED 0
91#define NVTX_COUNTER_LIMIT_I64 1
92#define NVTX_COUNTER_LIMIT_U64 2
93#define NVTX_COUNTER_LIMIT_F64 3
94
95
99typedef union
100{
101 int64_t i64;
102 uint64_t u64;
103 double f64;
105
109typedef struct nvtxSemanticsCounter_v1
110{
112 struct nvtxSemanticsHeader_v1 header;
113
118 uint64_t flags;
119
121 const char* unit;
122
125
128
133 int64_t limitType;
134
139
140#endif /* NVTX_SEMANTIC_ID_COUNTERS_V1 */
NVTX payload extension API: schema types, entry flags, and registration.
Specify additional properties of a counter or counter group.